[SNMP4J] sysUpTime units doc example.

Mooli Tayer mtayer at redhat.com
Sun Aug 31 15:37:45 CEST 2014


Anything about this?

----- Original Message -----
> *******************************************************************************
> 
> Hi,
> 
> At the org.snmp4j[1] Package documentation There is the following
> example:
> 
> // sysUpTime
> long sysUpTime = (System.nanoTime() - startTime) / 10000;
> pdu.add(new VariableBinding(SnmpConstants.sysUpTime, new
> TimeTicks(sysUpTime)));
> 
> 
> Here the unites are 10^-9 / 10^5 = 10^-4 but according to docks[2]
> is seems[3] we need to devide by 10000000 to get 10^-2 (a 100th of a second)
> 
> Testing locally I saw that:
> (System.nanoTime() - nanoStart) / 10000000)
> gives:
> DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2333) 0:00:23.33
> 
> For several seconds.
> 
> Please advise how this should be done and if there might be an error
> in the example.
> 
> 
> [1] http://www.snmp4j.org/doc/org/snmp4j/package-summary.html
> [2] http://www.snmp4j.org/doc/org/snmp4j/smi/TimeTicks.html
> [3] it does not state what the long units are but it states:
> "The TimeTicks class represents the time in 1/100 seconds since some
> epoch..."



More information about the SNMP4J mailing list