/** * This constructor should be used in the case when AWS SDK metrics * collector is enabled. * * @see AWSRequestMetricsFullSupport */ public AWSRequestMetricsFullSupport() { super(TimingInfo.startTimingFullSupport()); }
/** * 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. * * This feature is enabled if the system property * "com.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 (eventName, TimingInfo.startTimingFullSupport(System.currentTimeMillis(), System.nanoTime())); }
/** * This constructor should be used in the case when AWS SDK metrics * collector is enabled. * * @see AWSRequestMetricsFullSupport */ public AWSRequestMetricsFullSupport() { super(TimingInfo.startTimingFullSupport()); }
/** * This constructor should be used in the case when AWS SDK metrics * collector is enabled. * * @see AWSRequestMetricsFullSupport */ public AWSRequestMetricsFullSupport() { super(TimingInfo.startTimingFullSupport()); }
/** * 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. This feature is enabled if the system property * "com.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 */ // ignoring the wall clock time eventsBeingProfiled.put(eventName, TimingInfo.startTimingFullSupport(System.nanoTime())); }
/** * 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. * * This feature is enabled if the system property * "com.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 (eventName, TimingInfo.startTimingFullSupport(System.currentTimeMillis(), System.nanoTime())); }
@Test public void subEventsEnabled() { TimingInfo ti = TimingInfo.startTimingFullSupport(); ti.addSubMeasurement("m1", TimingInfo.startTimingFullSupport()); assertNotNull(ti.getAllSubMeasurements("m1")); ti.incrementCounter("c1"); assertTrue(ti.getAllCounters().size() == 1); ti.setCounter("c2", 0); assertTrue(ti.getAllCounters().size() == 2); }
/** * This constructor should be used in the case when AWS SDK metrics * collector is enabled. * * @see AWSRequestMetricsFullSupport */ public AWSRequestMetricsFullSupport() { super(TimingInfo.startTimingFullSupport()); }
/** * This constructor should be used in the case when AWS SDK metrics * collector is enabled. * * @see AWSRequestMetricsFullSupport */ public AWSRequestMetricsFullSupport() { super(TimingInfo.startTimingFullSupport()); }
/** * This constructor should be used in the case when AWS SDK metrics * collector is enabled. * * @see AWSRequestMetricsFullSupport */ public AWSRequestMetricsFullSupport() { super(TimingInfo.startTimingFullSupport()); }
/** * 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. This feature is enabled if the system property * "com.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 */ // ignoring the wall clock time eventsBeingProfiled.put(eventName, TimingInfo.startTimingFullSupport(System.nanoTime())); }
/** * 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. This feature is enabled if the system property * "com.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 */ // ignoring the wall clock time eventsBeingProfiled.put(eventName, TimingInfo.startTimingFullSupport(System.nanoTime())); }
@Test public void startEndTimingIfKnown() { // Start timing final long startTimeNano = System.nanoTime(); final long startTimeMilli = System.currentTimeMillis(); TimingInfo ti = TimingInfo.startTimingFullSupport(); assertTrue(ti.isStartEpochTimeMilliKnown()); assertTrue(ti.getStartTimeNano() >= startTimeNano); assertTrue(ti.getStartEpochTimeMilliIfKnown().longValue() >= startTimeMilli); // End time is not known assertFalse(ti.isEndTimeKnown()); assertNull(ti.getEndTimeNanoIfKnown()); assertNull(ti.getEndEpochTimeMilliIfKnown()); assertNull(ti.getTimeTakenMillisIfKnown()); // End timing ti.endTiming(); assertTrue(ti.isEndTimeKnown()); assertTrue(ti.getEndTimeNanoIfKnown().longValue() >= startTimeNano); assertTrue(ti.getEndEpochTimeMilliIfKnown().longValue() >= startTimeMilli); assertTrue(ti.getEndEpochTimeMilli() == ti.getEndEpochTimeMilliIfKnown().longValue()); assertTrue(ti.getTimeTakenMillisIfKnown().longValue() >= 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. * * This feature is enabled if the system property * "com.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())); }
@Test public void startEndTiming() { // Start timing final long startTimeNano = System.nanoTime(); final long startTimeMilli = System.currentTimeMillis(); TimingInfo[] tis = { TimingInfo.startTimingFullSupport(), TimingInfo.startTiming() }; for (TimingInfo ti : tis) { assertTrue(ti.isStartEpochTimeMilliKnown()); assertTrue(ti.getStartTimeNano() >= startTimeNano); assertTrue(ti.getStartEpochTimeMilli() >= startTimeMilli); // End time is not known assertFalse(ti.isEndTimeKnown()); assertTrue(ti.getEndTimeNano() == UNKNOWN); assertTrue(ti.getEndEpochTimeMilli() == UNKNOWN); assertTrue(ti.getEndTime() == ti.getEndEpochTimeMilli()); assertTrue(ti.getTimeTakenMillis() == UNKNOWN); assertTrue(ti.getElapsedTimeMillis() == UNKNOWN); // End timing ti.endTiming(); assertTrue(ti.isEndTimeKnown()); assertTrue(ti.getEndTimeNano() >= startTimeNano); assertTrue(ti.getEndEpochTimeMilli() >= startTimeMilli); assertTrue(ti.getEndTime() == ti.getEndEpochTimeMilli()); assertTrue(ti.getTimeTakenMillis() >= 0); assertTrue(ti.getElapsedTimeMillis() >= 0); } }