Class GlobalClock


  • public abstract class GlobalClock
    extends java.lang.Object

    The 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:

    1. Install a NTP client on all test machines which synchronizes the local time with a time server. This is the preferred solution.
    2. 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.
    If the latter approach is used, one needs to give the system the chance to correct the local time. So, avoid using System.currentTimeMillis() in favor of GlobalClock.getInstance().getTime().
    • Constructor Summary

      Constructors 
      Constructor Description
      GlobalClock()  
    • Constructor Detail

      • GlobalClock

        public GlobalClock()
    • 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