Class TimeMeasurement
java.lang.Object
org.apache.wayang.commons.util.profiledb.model.Measurement
org.apache.wayang.commons.util.profiledb.model.measurement.TimeMeasurement
A
Measurement that captures a certain amount of time in milliseconds. Instances can be nested within
each other.
Besides storing those data, it also provides utility functionality to obtain measurements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRounds(TimeMeasurement round) static StringformatDuration(long millis) Formats the given milliseconds ash:MM:ss.mmm.longRetrieves an existingTimeMeasurementfromroundswith the givenidor creates and stores a new one.voidsetMillis(long millis) voidstart()Start measuring time for this instance.Start a (potentially new) sub-TimeMeasurement.voidstop()Stop a measurement that has been started viastart()or derivatives.voidStop a measurement that has been started viastart(String...)or related.toString()Methods inherited from class org.apache.wayang.commons.util.profiledb.model.Measurement
equals, getId, getType, getTypeName, hashCode, setId
-
Constructor Details
-
TimeMeasurement
Creates a new instance.- Parameters:
id- the ID of the new instance
-
-
Method Details
-
start
public void start()Start measuring time for this instance. -
start
Start a (potentially new) sub-TimeMeasurement.- Parameters:
identifiers- identifies the targetTimeMeasurementas a path of IDs- Returns:
- the started instance
-
getOrCreateRound
Retrieves an existingTimeMeasurementfromroundswith the givenidor creates and stores a new one.- Parameters:
id- the ID of theTimeMeasurement- Returns:
- the
TimeMeasurement
-
stop
public void stop()Stop a measurement that has been started viastart()or derivatives. -
stop
Stop a measurement that has been started viastart(String...)or related.- Parameters:
identfiers- identify the targetTimeMeasurementas a path of IDs
-
getMillis
public long getMillis() -
setMillis
public void setMillis(long millis) -
getRounds
-
addRounds
-
formatDuration
Formats the given milliseconds ash:MM:ss.mmm.- Parameters:
millis- the milliseconds to format- Returns:
- the formatted milliseconds
-
toString
-