Addendum for YARN-4218. Metric for resource*time that was preempted.

This commit is contained in:
Varun Saxena 2017-04-26 11:29:12 +05:30
parent 1072232741
commit ebcb575a12
3 changed files with 11 additions and 1 deletions

View File

@ -144,6 +144,10 @@ public class TimelineServiceV1Publisher extends AbstractSystemMetricsPublisher {
appMetrics.getVcoreSeconds()); appMetrics.getVcoreSeconds());
entity.addOtherInfo(ApplicationMetricsConstants.APP_MEM_METRICS, entity.addOtherInfo(ApplicationMetricsConstants.APP_MEM_METRICS,
appMetrics.getMemorySeconds()); appMetrics.getMemorySeconds());
entity.addOtherInfo(ApplicationMetricsConstants.APP_MEM_PREEMPT_METRICS,
appMetrics.getPreemptedMemorySeconds());
entity.addOtherInfo(ApplicationMetricsConstants.APP_CPU_PREEMPT_METRICS,
appMetrics.getPreemptedVcoreSeconds());
tEvent.setEventInfo(eventInfo); tEvent.setEventInfo(eventInfo);
entity.addEvent(tEvent); entity.addEvent(tEvent);

View File

@ -195,6 +195,12 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher {
entityMetrics.add(getTimelineMetric( entityMetrics.add(getTimelineMetric(
ApplicationMetricsConstants.APP_MEM_METRICS, timestamp, ApplicationMetricsConstants.APP_MEM_METRICS, timestamp,
appMetrics.getMemorySeconds())); appMetrics.getMemorySeconds()));
entityMetrics.add(getTimelineMetric(
ApplicationMetricsConstants.APP_MEM_PREEMPT_METRICS, timestamp,
appMetrics.getPreemptedMemorySeconds()));
entityMetrics.add(getTimelineMetric(
ApplicationMetricsConstants.APP_CPU_PREEMPT_METRICS, timestamp,
appMetrics.getPreemptedVcoreSeconds()));
entityMetrics.add(getTimelineMetric( entityMetrics.add(getTimelineMetric(
ApplicationMetricsConstants.APP_RESOURCE_PREEMPTED_CPU, timestamp, ApplicationMetricsConstants.APP_RESOURCE_PREEMPTED_CPU, timestamp,
appMetrics.getResourcePreempted().getVirtualCores())); appMetrics.getResourcePreempted().getVirtualCores()));

View File

@ -213,7 +213,7 @@ public class TestSystemMetricsPublisherForV2 {
File appFile = new File(outputDirApp, timelineServiceFileName); File appFile = new File(outputDirApp, timelineServiceFileName);
Assert.assertTrue(appFile.exists()); Assert.assertTrue(appFile.exists());
verifyEntity( verifyEntity(
appFile, 3, ApplicationMetricsConstants.CREATED_EVENT_TYPE, 6, 0); appFile, 3, ApplicationMetricsConstants.CREATED_EVENT_TYPE, 8, 0);
} }
@Test(timeout = 10000) @Test(timeout = 10000)