Class MeasurementImpl

  • All Implemented Interfaces:
    Measurement

    public class MeasurementImpl
    extends java.lang.Object
    implements Measurement
    Measurement implementation which measures elapsed time from beginning the execution of the scenario.
    Author:
    Erhan Bagdemir
    • Constructor Summary

      Constructors 
      Constructor Description
      MeasurementImpl​(java.lang.String userId, MeasurableDsl measureableDslItem)  
      MeasurementImpl​(java.lang.String parentName, java.lang.String userId)  
      MeasurementImpl​(java.lang.String parentName, java.lang.String tagName, java.lang.String userId)  
      MeasurementImpl​(java.lang.String parentName, java.lang.String userId, java.lang.String measurementPoint, boolean cumulativeMeasurement, boolean measurementEnabled, EventDispatcher dispatcher)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(long millis)  
      void commit​(java.lang.String status)  
      void commit​(java.lang.String measurement, java.lang.String status)  
      void fail​(java.lang.String message)
      Stops the measurement by committing the measurement to the dispatcher.
      void finish()
      Finishes the measurement by committing it to the dispatcher.
      java.util.List<LogEvent> getEvents()  
      java.lang.String getMeasurementPoint()  
      java.lang.String getParentName()  
      boolean isCumulativeMeasurement()  
      boolean isMeasurementEnabled()  
      boolean isMeasurementStarted()  
      long measure​(java.lang.String status)  
      long measure​(java.lang.String measurement, java.lang.String status)
      Call measure(String, int) to measure the temporal metrics.
      void purge()
      Purge the backing data structure by deleting all the events stored.
      void record​(LogEvent event)
      The LogEvent will be recorded and stored internally.
      void start()
      Starts the measurement.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MeasurementImpl

        public MeasurementImpl​(java.lang.String parentName,
                               java.lang.String userId)
      • MeasurementImpl

        public MeasurementImpl​(java.lang.String parentName,
                               java.lang.String tagName,
                               java.lang.String userId)
      • MeasurementImpl

        public MeasurementImpl​(java.lang.String userId,
                               MeasurableDsl measureableDslItem)
      • MeasurementImpl

        public MeasurementImpl​(java.lang.String parentName,
                               java.lang.String userId,
                               java.lang.String measurementPoint,
                               boolean cumulativeMeasurement,
                               boolean measurementEnabled,
                               EventDispatcher dispatcher)
    • Method Detail

      • start

        public void start()
        Description copied from interface: Measurement
        Starts the measurement.
        Specified by:
        start in interface Measurement
      • add

        public void add​(long millis)
        Specified by:
        add in interface Measurement
      • commit

        public void commit​(java.lang.String status)
        Specified by:
        commit in interface Measurement
      • commit

        public void commit​(java.lang.String measurement,
                           java.lang.String status)
        Specified by:
        commit in interface Measurement
      • finish

        public void finish()
        Description copied from interface: Measurement
        Finishes the measurement by committing it to the dispatcher.
        Specified by:
        finish in interface Measurement
      • measure

        public long measure​(java.lang.String measurement,
                            java.lang.String status)
        Description copied from interface: Measurement
        Call measure(String, int) to measure the temporal metrics.

        Specified by:
        measure in interface Measurement
        Parameters:
        measurement - The name of the step.
        status - HTTP status of the load execution.
      • measure

        public long measure​(java.lang.String status)
        Specified by:
        measure in interface Measurement
      • record

        public void record​(LogEvent event)
        Description copied from interface: Measurement
        The LogEvent will be recorded and stored internally. The EventDispatcher will then dispatch the persisted events to the instances which process these events.

        Specified by:
        record in interface Measurement
        Parameters:
        event - log event.
      • fail

        public void fail​(java.lang.String message)
        Description copied from interface: Measurement
        Stops the measurement by committing the measurement to the dispatcher.
        Specified by:
        fail in interface Measurement
        Parameters:
        message - Failure description.
      • purge

        public void purge()
        Description copied from interface: Measurement
        Purge the backing data structure by deleting all the events stored.

        Specified by:
        purge in interface Measurement
      • getParentName

        public java.lang.String getParentName()
      • getMeasurementPoint

        public java.lang.String getMeasurementPoint()
      • isCumulativeMeasurement

        public boolean isCumulativeMeasurement()
      • isMeasurementEnabled

        public boolean isMeasurementEnabled()
      • isMeasurementStarted

        public boolean isMeasurementStarted()