コード例 #1
0
 /**
  * End an event which was previously started. Once ended, log how much time the event took. It is
  * illegal to end an Event that was not started. It is good practice to endEvent in a finally
  * block. See Also startEvent.
  *
  * @param eventName - The name of the event to start
  */
 @Override
 public void endEvent(String eventName) {
   TimingInfo event = eventsBeingProfiled.get(eventName);
   /* Somebody tried to end an event that was not started. */
   if (event == null) {
     LogFactory.getLog(getClass())
         .warn("Trying to end an event which was never started: " + eventName);
     return;
   }
   event.endTiming();
   this.timingInfo.addSubMeasurement(
       eventName,
       TimingInfo.unmodifiableTimingInfo(event.getStartTimeNano(), event.getEndTimeNano()));
 }
コード例 #2
0
 /**
  * Start an event which will be timed. The startTime and endTime are added to timingInfo only
  * after endEvent is called. For every startEvent there should be a corresponding endEvent. If you
  * start the same event without ending it, this will overwrite the old event. i.e. There is no
  * support for recursive events yet. Having said that, if you start and end an event in that
  * sequence multiple times, all events are logged in timingInfo in that order.
  *
  * <p>This feature is enabled if the system property
  * "apphub.dep.amazonaws.sdk.enableRuntimeProfiling" is set, or if a {@link
  * RequestMetricCollector} is in use either at the request, web service client, or AWS SDK level.
  *
  * @param eventName - The name of the event to start
  * @see AwsSdkMetrics
  */
 @Override
 public void startEvent(String eventName) {
   /* This will overwrite past events */
   eventsBeingProfiled.put // ignoring the wall clock time
       (eventName, TimingInfo.startTimingFullSupport(System.nanoTime()));
 }
コード例 #3
0
 /**
  * This constructor should be used in the case when AWS SDK metrics collector is enabled.
  *
  * @see AWSRequestMetricsFullSupport
  */
 public AWSRequestMetricsFullSupport() {
   super(TimingInfo.startTimingFullSupport());
 }