From: Leech, J. <jl...@vi...> - 2008-11-17 16:57:07
|
Jim, Poller.java grabs the system time in several places. The relevant one for the database writes occurs right before polling each interface. For a 24 port switch, all the targets for a particular interface will have the same poll time, but each interface will have a slightly older poll time from the next. The interfaces on a device are processed sequentially in a single thread. You want to be careful normalizing the times, so as not to affect the rate calculations. So don't change the time going in to the TargetStatistic object, but rather change it at the time of insert in the database (if you are using RTGDBDriver its on line 175). The safest / easiest way to do that would be to round the significant digits out of the poll time (if you have a 5 minute poll cycle, put the times at :00 :05 :10, etc). Otherwise you would have to take extra care to make sure your change is compatible with the buffering in DBBuffer. Sincerely, Jonathan Leech Virtela Communications -----Original Message----- From: Jim Archer [mailto:ji...@ar...] Sent: Sunday, November 16, 2008 3:39 AM To: jrt...@li... Subject: [Jrtg-users] Poller.java - thread question Hello List... I have been going through the code, trying to get a handle on how it works. I see in Poller.java which appears to be a thread and I see the thread pool stuff. What I am trying to figure out how to do is to somehow sync all the readings taken during a single poll run, so that they can be grouped together. It looks like Poller.java takes the system time, but there is no reason to think it would be the same across all the threads. But it only takes it once, so it would be the same for all devices read by this thread in a single run. So, for any given device, like a 24 port switch, would the readings from all 24 ports have the same system time and be saved in the database that way? And, if the thread reads more than one device, would the time then be saved for all reading for all the devices read by the same thread? Thanks... Jim ------------------------------------------------------------------------ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Jrtg-users mailing list Jrt...@li... https://lists.sourceforge.net/lists/listinfo/jrtg-users |