Kieker 1.9

kieker.monitoring.timer
Class SystemNanoTimer

java.lang.Object
  extended by kieker.monitoring.timer.AbstractTimeSource
      extended by kieker.monitoring.timer.SystemNanoTimer
All Implemented Interfaces:
ITimeSource

public final class SystemNanoTimer
extends AbstractTimeSource

A timer implementation, counting in nanoseconds since a specified offset.

Since:
1.5
Author:
Jan Waller

Field Summary
static String CONFIG_OFFSET
          This is the name of the configuration determining the used offset (in nanoseconds).
static String CONFIG_UNIT
          This is the name of the configuration determining the used time unit (0 = nanoseconds, 1 = microseconds, 2 = milliseconds, 3 = seconds).
 
Constructor Summary
SystemNanoTimer(Configuration configuration)
          Creates a new instance of this class using the given parameters.
 
Method Summary
 long getOffset()
           
 long getTime()
           
 TimeUnit getTimeUnit()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIG_OFFSET

public static final String CONFIG_OFFSET
This is the name of the configuration determining the used offset (in nanoseconds).


CONFIG_UNIT

public static final String CONFIG_UNIT
This is the name of the configuration determining the used time unit (0 = nanoseconds, 1 = microseconds, 2 = milliseconds, 3 = seconds).

Constructor Detail

SystemNanoTimer

public SystemNanoTimer(Configuration configuration)
Creates a new instance of this class using the given parameters.

Parameters:
configuration - The configuration for this timer.
Method Detail

getTime

public final long getTime()
Returns:
The timestamp for the current time in TimeUnit.
See Also:
ITimeSource.getTimeUnit()

getOffset

public long getOffset()
Returns:
The offset of the timesource to 1970-1-1 in TimeUnit.
See Also:
ITimeSource.getTimeUnit()

getTimeUnit

public final TimeUnit getTimeUnit()
Returns:
The TimeUnit of the timesource.

toString

public final String toString()
Specified by:
toString in interface ITimeSource
Specified by:
toString in class AbstractTimeSource
Returns:
A String representation of the timesource. E.g., the meaning of a timestamp from this source.

Kieker 1.9

Copyright 2014 Kieker Project, http://kieker-monitoring.net