Usage Statistics module

0 views
Skip to first unread message

Mark Goodrich

unread,
May 30, 2012, 4:04:57 PM5/30/12
to Rowan Seymour, Dave Thomas (pihdave@gmail.com), Lara Kellett, Michael Seaton, d...@openmrs.org

Rowen, Lara, Dave, & Mike,

 

So, I’ve a couple of changes to the Usage Statistics module.  First, I ripped the JMX functionality out of the code.

 

Also, I had to make one small change to get the module to run on 1.9.  Evidently the constant Hibernate.LONG has been removed in the latest version of Hibernate. The constant is used three times within HibernateUsageStatisticsDAO in the context:

 

return sessionFactory.getCurrentSession().createSQLQuery(sb.toString())

                                                .addEntity("l", Location.class)

                                                .addScalar("count", Hibernate.LONG)

                                                .list();

 

Simply removing Hibernate.LONG and calling the single-parameter method addScalar("count") fixes the error and appears to work correctly.  Is there a specific reason we need to explicitly declare the type to be Hibernate.LONG?  Is this going to fail now if the count gets particularly bug?

 

@Rowen—I will submit a pull request with these changes… take a look and let me know if you think anything I did was in error.

 

I ran into one other error… the “Options” section for the module threw a stack trace when I tried to open it. I discovered that this was because one of the Usage Statistics schedule tasks had been duplicated and scheduled twice. Deleting one of the instances corrected the problem. I’m not quite sure how this happened, so this should be looked into more, but it isn’t a showstopper.

 

@Lara—I can’t get to the Rwanda server or the testing server at the moment.  When you get a chance, can you check out the Scheduled Tasks and see if there is a Usage Statistics task that has been duplicated

 

Other than that, I wasn’t sure exactly how to test the module… I confirmed that all the admin tabs loaded correctly; I also confirmed that when I viewed a patient record, the “patient views” statistic was correctly incremented by one.  Let me know if there is anything else in particular I should check.

 

@Lara—I was going to install the updated module on the testing server so you guys could test it, but I can’t get to any of the Rwanda servers at the moment.

 

@Rowen—let me know if you are okay with these changes; if you want, I can go ahead and handle releasing the 1.4 version of the module.  It is not critical that we get this done, but we will be upgrading Rwanda next week and I’d rather use official module releases rather than snapshot releases wherever possible.  If you want, you can ask Downey to give me admin rights to the Usage Statistics module and I will handle adding the new version number and properly settting the fix version, etc, in the appropriate tickets.

 

Mark

 

Jeremy Keiper

unread,
Jun 4, 2012, 12:07:41 PM6/4/12
to d...@openmrs.org, Rowan Seymour, Dave Thomas (pihdave@gmail.com), Lara Kellett, Michael Seaton
Rowan -


where it says: Deprecated. Use StandardBasicTypes.LONG instead.

Can you try that and see if it helps?

Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support


-- OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org
Unsubscribe: dev+uns...@openmrs.org

Jeremy Keiper

unread,
Jun 4, 2012, 12:11:24 PM6/4/12
to d...@openmrs.org, Rowan Seymour, Dave Thomas (pihdave@gmail.com), Lara Kellett, Michael Seaton
Sorry, I meant to address this to Mark.


Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support


Mark Goodrich

unread,
Jun 4, 2012, 4:56:08 PM6/4/12
to d...@openmrs.org, Rowan Seymour, Dave Thomas (pihdave@gmail.com), Lara Kellett, Michael Seaton
Jeremy--
 
I'm travelling to Rwanda and won't have time to try this out for a bit, but if I remember correctly there was a reason I couldn't do this... like the version of hibernate we are using in 1.9 is after Hibernate.LONG had been removed but before StandardBasicTypes had been added?  (Which, admittedly, doesn't make much sense, but I think it was something like that).
 
Mark
 

From: d...@openmrs.org [d...@openmrs.org] On Behalf Of Jeremy Keiper [jer...@openmrs.org]
Sent: Monday, June 04, 2012 12:11 PM
To: d...@openmrs.org
Cc: Rowan Seymour; Dave Thomas (pih...@gmail.com); Lara Kellett; Michael Seaton
Subject: Re: Usage Statistics module

Michael Seaton

unread,
Jun 4, 2012, 5:26:23 PM6/4/12
to Mark Goodrich, d...@openmrs.org, Rowan Seymour, Dave Thomas (pihdave@gmail.com), Lara Kellett
@Darius - didn't you fix a bunch of stuff like this in the reporting module recently?


On 06/04/2012 04:56 PM, Mark Goodrich wrote:
Jeremy--
�
I'm travelling to Rwanda and won't have time to try this out for a bit, but if I remember correctly there was a reason I couldn't do this... like the version of hibernate we�are�using�in 1.9 is�after Hibernate.LONG had been removed but before StandardBasicTypes had been added?� (Which, admittedly, doesn't make much sense, but I think it was something like that).
�
Mark
�

From: d...@openmrs.org [d...@openmrs.org] On Behalf Of Jeremy Keiper [jer...@openmrs.org]
Sent: Monday, June 04, 2012 12:11 PM
To: d...@openmrs.org
Cc: Rowan Seymour; Dave Thomas (pih...@gmail.com); Lara Kellett; Michael Seaton
Subject: Re: Usage Statistics module

Sorry, I meant to address this to Mark.

Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support


On Mon, Jun 4, 2012 at 12:07 PM, Jeremy Keiper <jer...@openmrs.org> wrote:
Rowan -


where it says:�Deprecated.�Use�StandardBasicTypes.LONG�instead.

Can you try that and see if it helps?

Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support
On Wed, May 30, 2012 at 4:04 PM, Mark Goodrich <mgoo...@pih.org> wrote:

Rowen, Lara, Dave, & Mike,

�

So, I�ve a couple of changes to the Usage Statistics module.� First, I ripped the JMX functionality out of the code.

�

Also, I had to make one small change to get the module to run on 1.9.� Evidently the constant Hibernate.LONG has been removed in the latest version of Hibernate. The constant is used three times within HibernateUsageStatisticsDAO in the context:

�

return sessionFactory.getCurrentSession().createSQLQuery(sb.toString())

����������������������������������������������� .addEntity("l", Location.class)

����������������������������������������������� .addScalar("count", Hibernate.LONG)

����������������������������������������������� .list();

�

Simply removing Hibernate.LONG and calling the single-parameter method addScalar("count") fixes the error and appears to work correctly.� Is there a specific reason we need to explicitly declare the type to be Hibernate.LONG?� Is this going to fail now if the count gets particularly bug?

�

@Rowen�I will submit a pull request with these changes� take a look and let me know if you think anything I did was in error.

�

I ran into one other error� the �Options� section for the module threw a stack trace when I tried to open it. I discovered that this was because one of the Usage Statistics schedule tasks had been duplicated and scheduled twice. Deleting one of the instances corrected the problem. I�m not quite sure how this happened, so this should be looked into more, but it isn�t a showstopper.

�

@Lara�I can�t get to the Rwanda server or the testing server at the moment.� When you get a chance, can you check out the Scheduled Tasks and see if there is a Usage Statistics task that has been duplicated

�

Other than that, I wasn�t sure exactly how to test the module� I confirmed that all the admin tabs loaded correctly; I also confirmed that when I viewed a patient record, the �patient views� statistic was correctly incremented by one.� Let me know if there is anything else in particular I should check.

�

@Lara�I was going to install the updated module on the testing server so you guys could test it, but I can�t get to any of the Rwanda servers at the moment.

�

@Rowen�let me know if you are okay with these changes; if you want, I can go ahead and handle releasing the 1.4 version of the module.� It is not critical that we get this done, but we will be upgrading Rwanda next week and I�d rather use official module releases rather than snapshot releases wherever possible.� If you want, you can ask Downey to give me admin rights to the Usage Statistics module and I will handle adding the new version number and properly settting the fix version, etc, in the appropriate tickets.

�

Mark

�

-- OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org
Unsubscribe: dev+uns...@openmrs.org

Darius Jazayeri

unread,
Jun 4, 2012, 10:34:06 PM6/4/12
to d...@openmrs.org, Rowan Seymour, Dave Thomas, Lara Kellett, Mark Goodrich

Yes. Look for a wiki page like "non backwards compatible hibernate changes" and/or migration guide for developers.

-Darius (by phone)

On Jun 4, 2012 4:26 PM, "Michael Seaton" <mse...@pih.org> wrote:
@Darius - didn't you fix a bunch of stuff like this in the reporting module recently?


On 06/04/2012 04:56 PM, Mark Goodrich wrote:
Jeremy--
 
I'm travelling to Rwanda and won't have time to try this out for a bit, but if I remember correctly there was a reason I couldn't do this... like the version of hibernate we are using in 1.9 is after Hibernate.LONG had been removed but before StandardBasicTypes had been added?  (Which, admittedly, doesn't make much sense, but I think it was something like that).
 
Mark
 

From: d...@openmrs.org [d...@openmrs.org] On Behalf Of Jeremy Keiper [jer...@openmrs.org]
Sent: Monday, June 04, 2012 12:11 PM
To: d...@openmrs.org
Cc: Rowan Seymour; Dave Thomas (pih...@gmail.com); Lara Kellett; Michael Seaton
Subject: Re: Usage Statistics module

Sorry, I meant to address this to Mark.

Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support


On Mon, Jun 4, 2012 at 12:07 PM, Jeremy Keiper <jer...@openmrs.org> wrote:

Can you try that and see if it helps?

Jeremy Keiper
OpenMRS Core Developer
AMPATH / IU-Kenya Support
On Wed, May 30, 2012 at 4:04 PM, Mark Goodrich <mgoo...@pih.org> wrote:

Rowen, Lara, Dave, & Mike,

 

So, I’ve a couple of changes to the Usage Statistics module.  First, I ripped the JMX functionality out of the code.

 

Also, I had to make one small change to get the module to run on 1.9.  Evidently the constant Hibernate.LONG has been removed in the latest version of Hibernate. The constant is used three times within HibernateUsageStatisticsDAO in the context:

 

return sessionFactory.getCurrentSession().createSQLQuery(sb.toString())

                                                .addEntity("l", Location.class)

                                                .addScalar("count", Hibernate.LONG)

                                                .list();

 

Simply removing Hibernate.LONG and calling the single-parameter method addScalar("count") fixes the error and appears to work correctly.  Is there a specific reason we need to explicitly declare the type to be Hibernate.LONG?  Is this going to fail now if the count gets particularly bug?

 

@Rowen—I will submit a pull request with these changes… take a look and let me know if you think anything I did was in error.

 

I ran into one other error… the “Options” section for the module threw a stack trace when I tried to open it. I discovered that this was because one of the Usage Statistics schedule tasks had been duplicated and scheduled twice. Deleting one of the instances corrected the problem. I’m not quite sure how this happened, so this should be looked into more, but it isn’t a showstopper.

 

@Lara—I can’t get to the Rwanda server or the testing server at the moment.  When you get a chance, can you check out the Scheduled Tasks and see if there is a Usage Statistics task that has been duplicated

 

Other than that, I wasn’t sure exactly how to test the module… I confirmed that all the admin tabs loaded correctly; I also confirmed that when I viewed a patient record, the “patient views” statistic was correctly incremented by one.  Let me know if there is anything else in particular I should check.

 

@Lara—I was going to install the updated module on the testing server so you guys could test it, but I can’t get to any of the Rwanda servers at the moment.

 

@Rowen—let me know if you are okay with these changes; if you want, I can go ahead and handle releasing the 1.4 version of the module.  It is not critical that we get this done, but we will be upgrading Rwanda next week and I’d rather use official module releases rather than snapshot releases wherever possible.  If you want, you can ask Downey to give me admin rights to the Usage Statistics module and I will handle adding the new version number and properly settting the fix version, etc, in the appropriate tickets.

 

Mark

 

-- OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org
Unsubscribe: dev+uns...@openmrs.org

-- OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org
Unsubscribe: dev+uns...@openmrs.org
Reply all
Reply to author
Forward
0 new messages