public Double getMetric ( PlatformResourceType type , String name , ID metricToCollect ) { switch ( type ) { case OPERATING_SYSTEM : { return getOperatingSystemMetric ( metricToCollect ) ; } case MEMORY : { return getMemoryMetric ( metricToCollect ) ; } case FILE_STORE : { return getFileStoreMetric ( name , metricToCollect ) ; } case PROCESSOR : { return getProcessorMetric ( name , metricToCollect ) ; } case POWER_SOURCE : { return getPowerSourceMetric ( name , metricToCollect ) ; } default : { throw new IllegalArgumentException ( "Platform resource [" + type + "][" + name + "] does not have metrics" ) ; } } }
Given a platform resource type a name and a metric name this will return that metric s value or null if there is no resource that can be identified by the name and type .