Package com.amazonaws.util
Class TimingInfo
java.lang.Object
com.amazonaws.util.TimingInfo
Used both as a base class and a minimal support of timing info.
In contrast to TimingInfoFullSupport, which is intended to be a full
support of the timing info, this class only provides a minimal support of
start and end time (ie with no-ops for sub-event measurements) for backward
compatiblity reasons.
This class is instantiated instead of TimingInfoFullSupport when
request metric collection is not required during a particular service
request/response cycle.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTimingInfo(Long startEpochTimeMilli, long startTimeNano, Long endTimeNano) A private ctor to facilitate the deprecation of using millisecond and migration to using nanosecond for timing measurement. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubMeasurement(String subMeasurementName, TimingInfo timingInfo) static doubledurationMilliOf(long startTimeNano, long endTimeNano) Returns the duration in milliseconds as double, preserving the decimal precision as necessary, for the given start and end time in nanoseconds.getAllSubMeasurements(String subMeasurementName) getCounter(String key) final longDeprecated.final longDeprecated.final Longfinal longDeprecated.final longfinal LonggetLastSubMeasurement(String subMeasurementName) final longDeprecated.final Longfinal longDeprecated.final longgetSubMeasurement(String subMeasurementName) getSubMeasurement(String subMesurementName, int index) final doubleDeprecated.final DoublevoidincrementCounter(String key) final booleanfinal booleanstatic TimingInfonewTimingInfoFullSupport(long startTimeNano, long endTimeNano) Returns aTimingInfoFullSupportbased on the given start and end time in nanosecond, ignoring the wall clock time.static TimingInfonewTimingInfoFullSupport(long startEpochTimeMilli, long startTimeNano, long endTimeNano) Returns aTimingInfoFullSupportbased on the given start time since epoch in millisecond, and the given start and end time in nanosecond.voidsetCounter(String key, long count) voidsetEndTime(long endTimeMilli) Deprecated.voidsetEndTimeNano(long endTimeNano) static TimingInfoCaptures the current wall clock time (since epoch in millisecond) and the current time (in nanosecond) used for timing measurement.static TimingInfoCaptures the current wall clock time (since epoch in millisecond) and the current time (in nanosecond) used for timing measurement.static TimingInfostartTimingFullSupport(long startTimeNano) Captures the given start time in nanosecond, ignoring the wall clock time.final StringtoString()static TimingInfounmodifiableTimingInfo(long startEpochTimeMilli, long startTimeNano, Long endTimeNano) Returns an instance ofTimingInfothat is not modifiable.static TimingInfounmodifiableTimingInfo(long startTimeNano, Long endTimeNano) Returns an instance ofTimingInfothat is not modifiable, given the start and end nano times.
-
Constructor Details
-
TimingInfo
A private ctor to facilitate the deprecation of using millisecond and migration to using nanosecond for timing measurement.- Parameters:
startEpochTimeMilli- start time since epoch in millisecondstartTimeNano- start time in nanosecondendTimeNano- end time in nanosecond; or null if not known
-
-
Method Details
-
startTiming
Captures the current wall clock time (since epoch in millisecond) and the current time (in nanosecond) used for timing measurement. For more info, see: https://blogs.oracle.com/dholmes/entry/inside_the_hotspot_vm_clocks -
startTimingFullSupport
Captures the current wall clock time (since epoch in millisecond) and the current time (in nanosecond) used for timing measurement. For more info, see: https://blogs.oracle.com/dholmes/entry/inside_the_hotspot_vm_clocks -
startTimingFullSupport
Captures the given start time in nanosecond, ignoring the wall clock time.- Parameters:
startTimeNano- start time in nanosecond
-
newTimingInfoFullSupport
Returns aTimingInfoFullSupportbased on the given start and end time in nanosecond, ignoring the wall clock time.- Parameters:
startTimeNano- start time in nanosecondendTimeNano- end time in nanosecond
-
newTimingInfoFullSupport
public static TimingInfo newTimingInfoFullSupport(long startEpochTimeMilli, long startTimeNano, long endTimeNano) Returns aTimingInfoFullSupportbased on the given start time since epoch in millisecond, and the given start and end time in nanosecond.- Parameters:
startEpochTimeMilli- start time since epoch in millisecondstartTimeNano- start time in nanosecondendTimeNano- end time in nanosecond
-
unmodifiableTimingInfo
Returns an instance ofTimingInfothat is not modifiable, given the start and end nano times. -
unmodifiableTimingInfo
public static TimingInfo unmodifiableTimingInfo(long startEpochTimeMilli, long startTimeNano, Long endTimeNano) Returns an instance ofTimingInfothat is not modifiable.- Parameters:
startEpochTimeMilli- start time since epoch in millisecondstartTimeNano- start time in nanosecondendTimeNano- end time in nanosecond; or null if not known
-
getStartTime
Deprecated. -
getStartEpochTimeMilli
Deprecated. -
getStartEpochTimeMilliIfKnown
-
getStartTimeNano
public final long getStartTimeNano() -
getEndTime
Deprecated. -
getEndEpochTimeMilli
Deprecated. -
getEndEpochTimeMilliIfKnown
-
getEndTimeNano
public final long getEndTimeNano() -
getEndTimeNanoIfKnown
-
getTimeTakenMillis
Deprecated. -
getTimeTakenMillisIfKnown
-
durationMilliOf
public static double durationMilliOf(long startTimeNano, long endTimeNano) Returns the duration in milliseconds as double, preserving the decimal precision as necessary, for the given start and end time in nanoseconds. -
getElapsedTimeMillis
Deprecated. -
isEndTimeKnown
public final boolean isEndTimeKnown() -
isStartEpochTimeMilliKnown
public final boolean isStartEpochTimeMilliKnown() -
toString
-
setEndTime
Deprecated. -
setEndTimeNano
public void setEndTimeNano(long endTimeNano) -
endTiming
-
addSubMeasurement
-
getSubMeasurement
-
getSubMeasurement
-
getLastSubMeasurement
-
getAllSubMeasurements
-
getSubMeasurementsByName
-
getCounter
-
getAllCounters
-
setCounter
-
incrementCounter
-