Tracking Session Data Portlet

Viewpoint
Enthusiast

Tracking Session Data Portlet

I am creating a portlet that will be able to graph certain variables such as delta CPU by user name over a day. I know that I can pull all the session data grouped by user name, but I was wondering if there is a method or DAO that you could recommend that would give me a list of user names for a system. It does not have to filter out ones that don't have any sessions during the day. I can do this in my code but was wondering if there is something that you have created to do this already.
7 REPLIES
Teradata Employee

Re: Tracking Session Data Portlet

The AccountInfoDAO can be used to query for a list of Teradata users. The method is:

getUniqueMetricListForAccountType(int systemId, AccountInfoColumn metricName,
AccountInfoAccountType accountType, Timestamp startTime, Timestamp endTime);

And you would want to call it as follows, making sure that startTime is at most a week prior to the current time:

accountInfoDAO.getFilteredUniqueMetricListForAccountType(systemId,
AccountInfo.AccountInfoColumn.USER_NAME,
AccountInfo.AccountInfoAccountType.USER, startTime, java.lang.System.currentTimeMillis(),
filter, limit);
Enthusiast

Re: Tracking Session Data Portlet

Thanks. My next question is about the getSessionsGroupedByUserName() function in the SessionDAO. How does it treat multiple sessions from the same user that are open during the time stamp. Does it add the values in the columns up so that you have a cumulative total. For example does it add the delta CPU for each session the user name has open?
Teradata Employee

Re: Tracking Session Data Portlet

Yes, it sums the values in the columns to provide a cumulative total.
Enthusiast

Re: Tracking Session Data Portlet



I am not trying to use the to have different graphs for the user to choose from. I am not getting it to display properly in Firefox. In Firefox the tabs widget displays all the tabs and nothing happens when you select a tab. I have set it up as follows:

div class="GraphSelector${context}"
vp:tabs id="${context}widgets" context="${context}"
vp:tab context="${context}" label="DeltaCPU"

div class="DeltaCPU_Content${context}"

/div

/vp:tab
vp:tab context="${context}" label="ImpactCPU"

div class="ImpactCPU_Content${context}"

/div

/vp:tab
vp:tab context="${context}" label="DeltaI/O"

div class="DeltaIO_Content${context}"

/div

/vp:tab
vp:tab context="${context}" label="CPU_Usage"

div class="CPU_Usage_Content${context}"

/div

/vp:tab
vp:tab context="${context}" label="Active_Count"

div class="Active_Count_Content${context}"

/div

/vp:tab
/vp:tabs
/div

This works fine in IE so I was wondering if maybe you guys develop specifically for IE or if I am doing something wrong here.
dfu
Teradata Employee

Re: Tracking Session Data Portlet

Looking at the code above, I don't see anything wrong on the surface. The code should work both in IE and Firefox. My suggestion is to bring up FireBug and see if there are any JS errors.
Enthusiast

Re: Tracking Session Data Portlet

I have generated a graph of Delta CPU for all users for a specified day. When displaying this data I noticed that the Delta CPU was constant for an hour and was also zero for 5 hours but jumped around after that, I don't think that this is right because we have about 100-200 thousand queries a day. Also one of my co workers gave me the session data that he had gathered from active session. These two data sets are different by a large margin. The max value for Delta CPU on my graph was 1.5k, in the active session data it was 3.3k. Can you give me some kind of insight as to why this would be happening.

To get the session data for a day I am using the getSessionsGroupedByUserName(SystemID,Timestamp,null) in the SessionDAO

I have a loop that increments a Timestamp by minutes to get the sessions that are on at every minute during the day.

Should I be using a different function to achieve this?
Teradata Employee

Re: Tracking Session Data Portlet

The delta CPU metric represents the CPU consumed during the latest session sampling period. So, what is the session sampling rate for the system you are monitoring? You would need to make sure that you call the SessionDAO method once for every session sampling period.

With that said though, there are some serious performance implications that might be involved in trying to run this volume of queries, especially if these queries are being driven by user interactions so that you don't have definitive control over the volume of requests.

If you don't mind, I would appreciate the chance to exchange emails offline or set up a phone call to get an understanding of your goals for this sessions portlet. You can send me an email at steve dot ratay at teradata dot com.