in reply to How to Iterate to Identify Concurrent Users

What do you want to output? A single number indicating the greatest number of concurrent users? A list indicating the number of concurrent users whenever that number changes? A list of hourly (or some other period) reports indicating the maximum number of concurrent users in that period? Something else?

If you have a list of connect/disconnect times then you can sort the list by event, then iterate through the list incrementing or decrementing a connected count as appropriate for each event.


Perl is environmentally friendly - it saves trees
  • Comment on Re: How to Iterate to Identify Concurrent Users

Replies are listed 'Best First'.
Re^2: How to Iterate to Identify Concurrent Users
by Anonymous Monk on Oct 26, 2007 at 00:21 UTC
    Quite simply, I would like to output the total number of concurrent users. The list is sorted since it is chronologically based. Thanks Grandfather.
      "The total number of concurrent users" doesn't define much. If you mean "the number of users ever", then say that. If you mean "the number of users that had at least one other user logged in at the same time", that might make sense. For example, if one user logs in at 5, and leaves at 8, and another user logs in at 6, and leaves at 9, and a third user logs in from 10 to 11, how many is that? Two, or Three, or none? :)

      Or maybe you mean average users over time, which from 5 to 11 pm on that example is (calculating... 3 + 3 + 1 over 6) 2.333 or so.

        Randal,

        >if one user logs in at 5, and leaves at 8, and another user >logs in at 6, and leaves at 9, and a third user logs in from >10 to 11, how many is that? Two, or Three, or none? :)

        That would be 2, given your example. I mean the total number of simultaneous users on the system at a particular point in time. Any overlapping session of two users counts as two concurrent users. I hope this makes sense to the Greatest Monk of all ;-}
      Do you mean "the maximum number of concurrent users over the span of the log file"? The total of one number is rather uninteresting, especially when you're not clear on what that number is.
        If user A logs on at 9:30 and leaves at 9:45 and user B logs at 9:40 and leaves at 10:00, that would be two concurrent/simultaneous users. I would like to capture the incremental number of concurrent users over the lifetime of the log file, as unintresting as it seems ;-) I hope this makes sense.