use of org.hyperledger.besu.plugin.services.metrics.LabelledMetric in project besu by hyperledger.
the class AbstractEthTaskTest method shouldHaveSpecificMetricsLabels.
@Test
public void shouldHaveSpecificMetricsLabels() {
// seed with a failing value so that a no-op also trips the failure.
final String[] lastLabelNames = { "AbstractEthTask" };
final MetricsSystem instrumentedLabeler = new NoOpMetricsSystem() {
@Override
public LabelledMetric<OperationTimer> createLabelledTimer(final MetricCategory category, final String name, final String help, final String... labelNames) {
return names -> {
lastLabelNames[0] = names[0];
return null;
};
}
};
new AbstractEthTask<>(instrumentedLabeler) {
@Override
protected void executeTask() {
// no-op
}
};
assertThat(lastLabelNames[0]).isNotEqualTo("AbstractEthTask");
}
Aggregations