com.amazonaws.util
Class TimingInfo

java.lang.Object
  extended by com.amazonaws.util.TimingInfo

@NotThreadSafe
public class TimingInfo
extends java.lang.Object

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.


Method Summary
 void addSubMeasurement(java.lang.String subMeasurementName, TimingInfo timingInfo)
           
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.
 TimingInfo endTiming()
           
 java.util.Map<java.lang.String,java.lang.Number> getAllCounters()
           
 java.util.List<TimingInfo> getAllSubMeasurements(java.lang.String subMeasurementName)
           
 java.lang.Number getCounter(java.lang.String key)
           
 long getElapsedTimeMillis()
          Deprecated. 
 long getEndEpochTimeMilli()
          Deprecated. 
 java.lang.Long getEndEpochTimeMilliIfKnown()
           
 long getEndTime()
          Deprecated. 
 long getEndTimeNano()
           
 java.lang.Long getEndTimeNanoIfKnown()
           
 TimingInfo getLastSubMeasurement(java.lang.String subMeasurementName)
           
 long getStartEpochTimeMilli()
          Deprecated. 
 java.lang.Long getStartEpochTimeMilliIfKnown()
           
 long getStartTime()
          Deprecated. 
 long getStartTimeNano()
           
 TimingInfo getSubMeasurement(java.lang.String subMeasurementName)
           
 TimingInfo getSubMeasurement(java.lang.String subMesurementName, int index)
           
 java.util.Map<java.lang.String,java.util.List<TimingInfo>> getSubMeasurementsByName()
           
 double getTimeTakenMillis()
          Deprecated. 
 java.lang.Double getTimeTakenMillisIfKnown()
           
 void incrementCounter(java.lang.String key)
           
 boolean isEndTimeKnown()
           
 boolean isStartEpochTimeMilliKnown()
           
static TimingInfo newTimingInfoFullSupport(long startTimeNano, long endTimeNano)
          Returns a TimingInfoFullSupport based on the given start and end time in nanosecond, ignoring the wall clock time.
static TimingInfo newTimingInfoFullSupport(long startEpochTimeMilli, long startTimeNano, long endTimeNano)
          Returns a TimingInfoFullSupport based on the given start time since epoch in millisecond, and the given start and end time in nanosecond.
 void setCounter(java.lang.String key, long count)
           
 void setEndTime(long endTimeMilli)
          Deprecated. 
 void setEndTimeNano(long endTimeNano)
           
static TimingInfo startTiming()
          Captures the current wall clock time (since epoch in millisecond) and the current time (in nanosecond) used for timing measurement.
static TimingInfo startTimingFullSupport()
          Captures the current wall clock time (since epoch in millisecond) and the current time (in nanosecond) used for timing measurement.
static TimingInfo startTimingFullSupport(long startTimeNano)
          Captures the given start time in nanosecond, ignoring the wall clock time.
 java.lang.String toString()
           
static TimingInfo unmodifiableTimingInfo(long startTimeNano, java.lang.Long endTimeNano)
          Returns an instance of TimingInfo that is not modifiable, given the start and end nano times.
static TimingInfo unmodifiableTimingInfo(long startEpochTimeMilli, long startTimeNano, java.lang.Long endTimeNano)
          Returns an instance of TimingInfo that is not modifiable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

startTiming

public static TimingInfo 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

public static TimingInfo 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

public static TimingInfo startTimingFullSupport(long startTimeNano)
Captures the given start time in nanosecond, ignoring the wall clock time.

Parameters:
startTimeNano - start time in nanosecond

newTimingInfoFullSupport

public static TimingInfo newTimingInfoFullSupport(long startTimeNano,
                                                  long endTimeNano)
Returns a TimingInfoFullSupport based on the given start and end time in nanosecond, ignoring the wall clock time.

Parameters:
startTimeNano - start time in nanosecond
endTimeNano - end time in nanosecond

newTimingInfoFullSupport

public static TimingInfo newTimingInfoFullSupport(long startEpochTimeMilli,
                                                  long startTimeNano,
                                                  long endTimeNano)
Returns a TimingInfoFullSupport based 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 millisecond
startTimeNano - start time in nanosecond
endTimeNano - end time in nanosecond

unmodifiableTimingInfo

public static TimingInfo unmodifiableTimingInfo(long startTimeNano,
                                                java.lang.Long endTimeNano)
Returns an instance of TimingInfo that is not modifiable, given the start and end nano times.


unmodifiableTimingInfo

public static TimingInfo unmodifiableTimingInfo(long startEpochTimeMilli,
                                                long startTimeNano,
                                                java.lang.Long endTimeNano)
Returns an instance of TimingInfo that is not modifiable.

Parameters:
startEpochTimeMilli - start time since epoch in millisecond
startTimeNano - start time in nanosecond
endTimeNano - end time in nanosecond; or null if not known

getStartTime

@Deprecated
public final long getStartTime()
Deprecated. 


getStartEpochTimeMilli

@Deprecated
public final long getStartEpochTimeMilli()
Deprecated. 


getStartEpochTimeMilliIfKnown

public final java.lang.Long getStartEpochTimeMilliIfKnown()

getStartTimeNano

public final long getStartTimeNano()

getEndTime

@Deprecated
public final long getEndTime()
Deprecated. 


getEndEpochTimeMilli

@Deprecated
public final long getEndEpochTimeMilli()
Deprecated. 


getEndEpochTimeMilliIfKnown

public final java.lang.Long getEndEpochTimeMilliIfKnown()

getEndTimeNano

public final long getEndTimeNano()

getEndTimeNanoIfKnown

public final java.lang.Long getEndTimeNanoIfKnown()

getTimeTakenMillis

@Deprecated
public final double getTimeTakenMillis()
Deprecated. 


getTimeTakenMillisIfKnown

public final java.lang.Double 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
public final long getElapsedTimeMillis()
Deprecated. 


isEndTimeKnown

public final boolean isEndTimeKnown()

isStartEpochTimeMilliKnown

public final boolean isStartEpochTimeMilliKnown()

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

setEndTime

@Deprecated
public void setEndTime(long endTimeMilli)
Deprecated. 


setEndTimeNano

public void setEndTimeNano(long endTimeNano)

endTiming

public TimingInfo endTiming()

addSubMeasurement

public void addSubMeasurement(java.lang.String subMeasurementName,
                              TimingInfo timingInfo)

getSubMeasurement

public TimingInfo getSubMeasurement(java.lang.String subMeasurementName)

getSubMeasurement

public TimingInfo getSubMeasurement(java.lang.String subMesurementName,
                                    int index)

getLastSubMeasurement

public TimingInfo getLastSubMeasurement(java.lang.String subMeasurementName)

getAllSubMeasurements

public java.util.List<TimingInfo> getAllSubMeasurements(java.lang.String subMeasurementName)

getSubMeasurementsByName

public java.util.Map<java.lang.String,java.util.List<TimingInfo>> getSubMeasurementsByName()

getCounter

public java.lang.Number getCounter(java.lang.String key)

getAllCounters

public java.util.Map<java.lang.String,java.lang.Number> getAllCounters()

setCounter

public void setCounter(java.lang.String key,
                       long count)

incrementCounter

public void incrementCounter(java.lang.String key)


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.