Package com.xceptance.xlt.api.engine
Class GlobalClock
- java.lang.Object
-
- com.xceptance.xlt.api.engine.GlobalClock
-
public abstract class GlobalClock extends java.lang.ObjectThe GlobalClock provides the current time in the test cluster. Depending on the configuration, the GlobalClock uses either the master controller's time as the reference time or the local system time (the default).
Sometimes the local system clocks of the test machines diverge significantly. This may lead to unexpected results in the test report. There are two ways to get around this:
- Install a NTP client on all test machines which synchronizes the local time with a time server. This is the preferred solution.
- Use the time of one machine (in this case the master controller's machine) as the reference time. All timestamps are created relative to this reference time.
System.currentTimeMillis()in favor ofGlobalClock.getInstance().getTime().
-
-
Constructor Summary
Constructors Constructor Description GlobalClock()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static GlobalClockgetInstance()Returns the GlobalClock singleton.abstract longgetTime()Returns the current time as a number of milliseconds elapsed since January 1st, 1970 GMT.
-
-
-
Method Detail
-
getInstance
public static GlobalClock getInstance()
Returns the GlobalClock singleton.- Returns:
- the global clock
-
getTime
public abstract long getTime()
Returns the current time as a number of milliseconds elapsed since January 1st, 1970 GMT.- Returns:
- the time
-
-