NodeManagerMetrics { public JvmMetrics getJvmMetrics() { return jvmMetrics; } private  NodeManagerMetrics(JvmMetrics jvmMetrics); static NodeManagerMetrics create(); JvmMetrics getJvmMetrics(); void launchedContainer(); void completedContainer(); void rollbackContainerOnFailure(); void failedContainer(); void killedContainer(); void initingContainer(); void endInitingContainer(); void runningContainer(); void endRunningContainer(); void reInitingContainer(); void endReInitingContainer(); void allocateContainer(Resource res); void releaseContainer(Resource res); void changeContainer(Resource before, Resource now); void startOpportunisticContainer(Resource res); void completeOpportunisticContainer(Resource res); void addResource(Resource res); void addContainerLaunchDuration(long value); void setBadLocalDirs(int badLocalDirs); void setBadLogDirs(int badLogDirs); void setGoodLocalDirsDiskUtilizationPerc(
      int goodLocalDirsDiskUtilizationPerc); void setGoodLogDirsDiskUtilizationPerc(
      int goodLogDirsDiskUtilizationPerc); void setCacheSizeBeforeClean(long cacheSizeBeforeClean); void setTotalBytesDeleted(long totalBytesDeleted); void setPublicBytesDeleted(long publicBytesDeleted); void setPrivateBytesDeleted(long privateBytesDeleted); int getRunningContainers(); @VisibleForTesting int getKilledContainers(); @VisibleForTesting int getFailedContainers(); @VisibleForTesting int getCompletedContainers(); @VisibleForTesting int getBadLogDirs(); @VisibleForTesting int getBadLocalDirs(); @VisibleForTesting int getGoodLogDirsDiskUtilizationPerc(); @VisibleForTesting int getGoodLocalDirsDiskUtilizationPerc(); @VisibleForTesting int getReInitializingContainer(); @VisibleForTesting int getContainersRolledbackOnFailure(); long getAllocatedOpportunisticGB(); int getAllocatedOpportunisticVCores(); int getRunningOpportunisticContainers(); long getCacheSizeBeforeClean(); long getTotalBytesDeleted(); long getPublicBytesDeleted(); long getPrivateBytesDeleted(); void setContainerUsedMemGB(long usedMem); int getContainerUsedMemGB(); void setContainerUsedVMemGB(long usedVMem); int getContainerUsedVMemGB(); void setContainerCpuUtilization(float cpuUtilization); float getContainerCpuUtilization(); void setNodeUsedMemGB(long totalUsedMemGB); int getNodeUsedMemGB(); void setNodeUsedVMemGB(long totalUsedVMemGB); int getNodeUsedVMemGB(); float getNodeCpuUtilization(); void setNodeCpuUtilization(float cpuUtilization); @Metric("Local cache size (and private) before clean (Bytes)") MutableGaugeLong cacheSizeBeforeClean; @Metric("# of total bytes deleted from the and private local cache") MutableGaugeLong totalBytesDeleted; @Metric("# of bytes deleted from the local cache") MutableGaugeLong publicBytesDeleted; }
@Test public void testReferenceOfSingletonJvmMetrics() { JvmMetrics jvmMetrics = JvmMetrics.initSingleton("NodeManagerModule", null); Assert.assertEquals("NodeManagerMetrics should reference the singleton" + " JvmMetrics instance", jvmMetrics, metrics.getJvmMetrics()); }