Package org.jpos.util

Class TPS

  • All Implemented Interfaces:
    Loggeable

    public class TPS
    extends java.lang.Object
    implements Loggeable
    TPS can be used to measure Transactions Per Second (or transactions during other period of time).

    It can operate in two different modes:

    • Auto update
    • Manual update

    When operating in auto update mode, a Timer is created and the number of transactions (calls to tick()) is automatically calculated for every period. Under this mode, user has to call the stop() method when this TPS object is no longer needed, otherwise it will keep a Thread lingering around.

    When operating in manual update mode, user has to call one of its floatValue() or intValue() method at regular intervals. The returned value will be the average TPS for the given period since the last call

    .
    Since:
    1.6.7 r2912
    • Constructor Detail

      • TPS

        public TPS()
      • TPS

        public TPS​(boolean autoupdate)
        Parameters:
        autoupdate - true to auto update
      • TPS

        public TPS​(long period,
                   boolean autoupdate)
        Parameters:
        period - in millis
        autoupdate - true to autoupdate