Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find CPU time used by user?

Status
Not open for further replies.

CapsuleCorpJX

IS-IT--Management
Jun 23, 2004
70
US
Currently our system logs "elapsed" time used by any particular user. Elapsed time for a query varies between heavy and light loads, and just means the length of time between submission of a query and the returned result. So the statistics are not very dependable.

Is there a way to log the CPU time consumed by a particular query submitted by a user?

Also is there a easy way to log the database that a query is being run against? Most people would set their default database first before running a series of queries, so its hard to determine the database they are accessing from the logged query string.

The elapsed time statistics are currently being calculated by dbc.DBQLogTbl
 
Hello,

Account String Extension allows to do that ( user level )

the ASE variable could be : &I ( add hostid, session number and request number into the account string )

be careful ASE uses AMPUsage mechanism , the amount of data recorded can increase very quickly.

and to see the CPU time consumed :

select username, accountname , sum(CPUTIME) from dbc.ampusage
where username = 'XX'
group by 1,2

regards

goryn



 
If you "begin query logging WITH OBJECTS" details about all accessed objects including databasename are logged to DBC.QryLogObjects.

In V2R5.1 DBC.QryLog.TotalCPUTime and TotalIOcount are populated, but in V2R5 ASE with &I is the only way to collect CPU time.

Dieter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top