[Building Sakai] request for review: KNL-498, get last event time for a user

Steve Swinsburg steve.swinsburg at gmail.com
Tue May 18 02:33:16 PDT 2010


On 18/05/2010, at 6:40 PM, Jean-Francois Leveque wrote:

> Would the x duration in minutes be set by the user in the preferences, by the admin in the configuration or elsewhere? How will it work with other related settings?

The x duration is set in Profile2, since that is where the connection entity provider is, and will be exposed in sakai.properties that can be configured, defaulting to 5 minutes.

> 
> How about having the activity status detection available in EventTrackingService or another shared API?

The Profile2 API currently handles this, and exposes the information through EntityBroker so hopefully anyone that needs it can use EB to get the data. Alternatively we can look at moving the method into a kernel service.

> 
> I wonder how it will work from a performance point of view and could use cache or admin settings to protect us from heavy load.

Our production instance has events and sessions dating back to 2007 still in the event and session table and there are no noticeable performance issues. I'll take a snapshot tomorrow and run this against it to see how it performs. However there exist similar queries in use and they seem ok. But I'll get back to you on the performance issue.


> 
> "group by SAKAI_SESSION.SESSION_USER" is not needed in getLastEventTimeForUserSql with MySQL. I think it might also not be needed with Oracle, can someone else confirm this?

Correct, it's redundant since MAX takes care of this. I'll amend. 

cheers,
Steve


> 
> thanks,
> Jean-Francois
> 
> Steve Swinsburg a écrit :
>> Hi all,
>> I would like your feedback on two new methods I propose to add to the EventTrackingService in order to retrieve the last event time for a user/set of users. This is an addition that will be used by the Profile2 connections entity provider. Used in conjunction with KNL-497 (see if a user has an active session, already committed) you will be able to see if your connections are online and if they are active/idle (ie no event in the last x minutes = idle). This entity provider will also be used by the floating chat widget we are prototyping.
>> http://jira.sakaiproject.org/browse/KNL-498
>> A patch is attached to the JIRA ticket for your perusal, and the methods are below:
>> /** * Get last event time for the given user * * @param userId userId to check * @return time of event as Long, null if no event. */ Long getLastEventTimeForUser(String userId); /** * Get last event time for the given list of users * * @param userIds List of userId's to check * @return map of userId and time of last event. If no event, there will be no entry in the map for that user. */ Map<String, Long> getLastEventTimeForUsers(List<String> userIds);
>> thanks,
>> Steve



More information about the sakai-dev mailing list