Skip to main content

Posts

Showing posts with the label max user

How to find the maximum number of logged on users on a given day...

This checks max users for every hour because my original task was to show user count by hour.  You can easily modify this to check every second or whatever if you need a much more detailed number. static void JobFindMaxUsersLoggedInPerDay(Args _args) { SysUserLog sysUserLog; utcDateTime utc = DateTimeUtil::addHours(DateTimeUtil::newDateTime(systemDateGet(), 0), 8); int i; int n; int iUsers; ; utc = DateTimeUtil::newDateTime(systemDateGet(), 0); utc = DateTimeUtil::addDays(DateTimeUtil::addHours(utc, 13), -13); // utc = DateTimeUtil::applyTimeZoneOffset(utc, DateTimeUtil::getUserPreferredTimeZone()); for (i=1; i<=90; i++) { iUsers = 0; for (n=1; n<=11; n++) { // Find the number of users logged in select count(recId) from sysUserLog where sysUserLog.createdDateTime < DateTimeUtil::addHours(utc, n) &...