EPrints Technical Mailing List Archive

Message: #08337


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] IRStats2: Slow in Chrome?


Your solution worked brilliantly on my Test server (going on live when my team have finished for the day). I briefly got caught out in KeyFigures.pm with the $id, but realised what was happening.

I'm totally bewildered by my attempts to alias the View.pm plugin (/eprints3/archives/uolrepo/cfg/plugins/EPrints/Plugin/Stats/LocalView.pm). I moved it to the local plugins folders and prefixed it with "Local" as I tend to do:

$c->{plugin_alias_map}->{"Stats::View"} = "Stats::LocalView";
$c->{plugin_alias_map}->{"Stats::LocalView"} = undef;
$c->{plugins}{"Stats::LocalView"}{params}{disable} = 0;

It doesn't seem to catch it, so on the Test server only I've gone to the View.pm that I'm not supposed to change (/eprints3/lib/plugins/EPrints/Plugin/Stats/View.pm). Oddly I was able to alias the KeyFiguress.pm with LocalKeyFigures.pm with the same relative locations.

I even accounted for the expected loading order of cfg.d and included the required code in plugins.pl and zz_irstas2.pl.

Anyway that's a different issue that I should be able to resolve myself.

Thanks,
James

On Fri, Oct 9, 2020 at 11:31 AM David R Newman <drn@ecs.soton.ac.uk> wrote:

Hi James,

I cannot remember off hand what caching issues you may need to deal with.  First rule is always make sure you reload the webserver after making the changes.  Then on any pages you load make sure your hard refresh (e.g. Ctrl+Shift+R).  If you have download graphs on abstract/summary pages I think you will need to run refresh abstracts. 

This definitely fixed the issue for me and I had several independent people test this to confirm.

Regards

David Newman

On 09/10/2020 11:20, James Kerwin wrote:
Hi David,

Thank you very much. I'll make the necessary changes today and see how we get on. I wouldn't have worked this out if I had centuries to look at it.

I did try changing the load in /cfg.d/z_irstats2.pl in line with this:


This particular attempt didn't solve the problem, but it didn't break it either and it did change the load method when I inspected it (in Chrome when you look at the HTML etc).

Anyway I better get on with these changes, thank you for the guidance, appreciated as ever!

Thanks,
James

On Thu, Oct 8, 2020 at 9:32 AM David R Newman <drn@ecs.soton.ac.uk> wrote:

Hi James,

Yes, I have noticed this as well.  I fixed by change the following block of code in EPrints/Plugin/Stats/View.pm

125                 if( document.loaded )
126                       new EPJS_Stats_$js_class( { 'context': $json_context, 'options': $view_options } );
127                 else
128                         document.observe("dom:loaded",function(){
129                                   new EPJS_Stats_$js_class( { 'context': $json_context, 'options': $view_options } );
130                         });

to:

     125            google.setOnLoadCallback(drawChart_$id);
     126            function drawChart_$id()
     127            {
     128                    new EPJS_Stats_$js_class( { 'context': $json_context, 'options': $view_options } );
     129   
     130            }

I also made a similar change in EPrints/Plugin/Stats/View/KeyFigures.pm as well.  If you have download stats boxes on abstract/summary pages you will also need to make a similar change to one of the phrases in lang/en/phrases/irstats2.xml.

Regards

David Newman
On 08/10/2020 08:51, James Kerwin via Eprints-tech wrote:
Hi All,

I updated IRStats2 to the most recent version back in May (I think it was 1.01 to 1.1) from the Bazaar.

All seemed well until this week when I looked and realised there was no data. since the upgrade. It turns out it was because of the permissions and ownership of the process_stats file which is supposed to run frequently to process the stats and I assume update the irstats2_ tables in the database.

After the upgrade the script was owned by www-data (whatever it's called) and the "eprints" user didn't have permission to execute it. Due to the "no output" options set in cron I wasn't getting any info.

It was my fault for not being thorough enough and it's all sorted now, but I thought I would offer this as a warning to anybody who upgrades and doesn't know to check this sort of thing.

Also the IRStats2 pages stay "loading" forever on Chrome, but load almost immediately on FireFox. Any idea what causes this?

Thanks,
James

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

Virus-free. www.avg.com