[EP-tech] IRStats2: Slow in Chrome?

David R Newman drn at ecs.soton.ac.uk
Thu Nov 12 18:11:25 GMT 2020


Hi all,

I noted an issue with the JavaScript I provided for generating IRStats2 
download graphs on eprint abstract pages.  The below JavaScript should 
work better as I have noticed that when you try to use an epc:pin a 
second or third time it will be empty:

         google.setOnLoadCallback( function(){ drawChart_eprint( 
'<epc:pin name='eprintid'/>' ) } );
         function drawChart_eprint( irstats2_summary_page_eprintid ){

                 /* $( 'irstats2_summary_page:link' ).setAttribute( 
'href', '/cgi/stats/report/eprint/' + irstats2_summary_page_eprintid ); */

                 new EPJS_Stats_GoogleGraph ( { 'context': {
                         'range':'1y',
                         'set_name': 'eprint',
                         'set_value': irstats2_summary_page_eprintid,
                         'datatype':'downloads' },
                         'options': {
                         'container_id': 
'irstats2_summary_page_downloads', 
'date_resolution':'month','graph_type':'column'
                         } } );
         }

Regards

David Newman

On 09/10/2020 11:31, David R Newman 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 
>> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fz_irstats2.pl%2F&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866049152%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=dLtf%2BZXQUTxMxzN4F%2BC437gx44h9JiNz%2FaRbW9eGAwA%3D&amp;reserved=0> 
>> in line with this:
>>
>> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevelopers.google.com%2Fchart%2Finteractive%2Fdocs%2Fbasic_load_libs%23update-library-loader-code&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866049152%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=wKvr9o20ZM6dAAE2WsTSTP90Ujb7kYkvr7g3FHETz9s%3D&amp;reserved=0 
>> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevelopers.google.com%2Fchart%2Finteractive%2Fdocs%2Fbasic_load_libs%23update-library-loader-code&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866049152%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=wKvr9o20ZM6dAAE2WsTSTP90Ujb7kYkvr7g3FHETz9s%3D&amp;reserved=0> 
>>
>>
>> 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 at ecs.soton.ac.uk 
>> <mailto:drn at 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  <http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech>
>>>     *** Archive:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866049152%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=boXj9hzxLWUjaVPgj8KDQJGcugxNqxbC6YV07OYam9Q%3D&amp;reserved=0  <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866049152%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=boXj9hzxLWUjaVPgj8KDQJGcugxNqxbC6YV07OYam9Q%3D&amp;reserved=0>
>>>     *** EPrints community wiki:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866049152%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=qwUNm8%2FlRLdpRQSip02ZPk%2BgdtHVdJltBfZ5zgfVtao%3D&amp;reserved=0  <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866059139%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=LpMCnVo%2BnlZISFRM8X7%2BGzDrnAO0l%2BkYBO7qpM%2BohSk%3D&amp;reserved=0>
>>
>>     <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866059139%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=W6Qbs3wJGEC7ryh8jaIKzBG%2Ff3BaBF3RUOWohe2sCdg%3D&amp;reserved=0>
>>     	Virus-free. https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2F&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866059139%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=jH8t4e5fQzefoTUyymUlg5wPiTaTpFo6jyV6V1XW4fs%3D&amp;reserved=0
>>     <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866059139%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=W6Qbs3wJGEC7ryh8jaIKzBG%2Ff3BaBF3RUOWohe2sCdg%3D&amp;reserved=0>
>>
>>
>>     <#m_8275029250304110295_m_5935789201647633706_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>


-- 
This email has been checked for viruses by AVG.
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.avg.com%2F&amp;data=04%7C01%7C%7Cd798f23d14c74b32653f08d887365e81%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637408014866059139%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=1bidA0KAH0K4RhbiakceSVttg8Q69t0cwQSrLS%2FFfBQ%3D&amp;reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20201112/43318fff/attachment-0001.html 


More information about the Eprints-tech mailing list