MetricsStats implements Stats { @Override public void recordResourceDemanded(String resource, long demanded) { resourceDemandedHistogram(resource).update(demanded); } MetricsStats(SemanticMetricRegistry registry, Time time); @Override void registerActiveStatesMetric(RunState.State state, String triggerName,
                                         Gauge<Long> activeStatesCount); @Override void registerWorkflowCountMetric(String status, Gauge<Long> workflowCount); @Override void registerSubmissionRateLimitMetric(Gauge<Double> submissionRateLimit); @Override void recordStorageOperation(String operation, long durationMillis, String status); @Override void recordDockerOperation(String operation, long durationMillis, String status); @Override void recordDockerOperationError(String operation, String type); @Override void recordSubmission(String executionId); @Override void recordRunning(String executionId); @Override void recordExitCode(int exitCode); @Override void recordPullImageError(); @Override void recordNaturalTrigger(); @Override void recordTerminationLogMissing(); @Override void recordTerminationLogInvalid(); @Override void recordExitCodeMismatch(); @Override void recordResourceConfigured(String resource, long configured); @Override void recordResourceUsed(String resource, long used); @Override void recordResourceDemanded(String resource, long demanded); @Override void recordEventConsumer(SequenceEvent event); @Override void recordEventConsumerError(SequenceEvent event); @Override void recordWorkflowConsumer(String action); @Override void recordWorkflowConsumerError(); @Override void recordPublishing(String type, String state); @Override void recordPublishingError(String type, String state); @Override void recordTickDuration(String type, long duration); @Override void recordDatastoreEntityReads(String kind, int n); @Override void recordDatastoreEntityWrites(String kind, int n); @Override void recordDatastoreEntityDeletes(String kind, int n); @Override void recordDatastoreQueries(String kind, int n); @Override void recordCounterCacheHit(); @Override void recordCounterCacheMiss(); @Override void recordServiceAccountCleanup(); @Override void recordKubernetesOperation(String operation, long durationMillis, String status); @Override void recordKubernetesOperationError(String operation, String type, int code);  }
@Test public void shouldRecordResourceDemanded() { String resource = "resource"; when(registry.getOrAdd(RESOURCE_DEMANDED.tagged("resource", resource), HISTOGRAM)).thenReturn(histogram); stats.recordResourceDemanded(resource, 17); verify(histogram).update(17L); }