use of com.palantir.tritium.metrics.registry.MetricName in project atlasdb by palantir.
the class InstrumentationUtilsTest method untaggedAndTaggedMetricRegistryFailureMetricsHaveDifferentNames.
@Test
public void untaggedAndTaggedMetricRegistryFailureMetricsHaveDifferentNames() {
MetricName legacyFailureMetricName = MetricName.builder().safeName(InstrumentationUtils.TAGGED_FAILURES_METRIC_NAME.safeName()).build();
assertThat(InstrumentationUtils.TAGGED_FAILURES_METRIC_NAME).isNotEqualTo(legacyFailureMetricName);
}
use of com.palantir.tritium.metrics.registry.MetricName in project atlasdb by palantir.
the class TransactionOutcomeMetricsAssert method checkPresentAndCheckCount.
private void checkPresentAndCheckCount(TransactionOutcome outcome, long count, TableReference tableReference) {
MetricName metricName = actual.getMetricName(outcome, getTableReferenceTags(tableReference));
checkPresentAndCheckCount(metricName, count);
}
use of com.palantir.tritium.metrics.registry.MetricName in project atlasdb by palantir.
the class TransactionOutcomeMetricsAssert method hasPlaceholderWriteWriteConflictsSatisfying.
public TransactionOutcomeMetricsAssert hasPlaceholderWriteWriteConflictsSatisfying(LongConsumer assertion) {
MetricName metricName = actual.getMetricName(TransactionOutcome.WRITE_WRITE_CONFLICT, getTableReferenceTags(LoggingArgs.PLACEHOLDER_TABLE_REFERENCE));
assertion.accept(taggedMetricRegistry.meter(metricName).getCount());
return this;
}
use of com.palantir.tritium.metrics.registry.MetricName in project atlasdb by palantir.
the class ToplistDeltaFilteringTableLevelMetricsControllerTest method operatesCorrectlyWithSharedContexts.
@Test
public void operatesCorrectlyWithSharedContexts() {
MetricsManager otherManager = MetricsManagers.createAlwaysSafeAndFilteringForTests();
ToplistDeltaFilteringTableLevelMetricsController otherController = new ToplistDeltaFilteringTableLevelMetricsController(context, otherManager, mockClock);
Map<Integer, Counter> counters = KeyedStream.of(ImmutableList.of(1, 2, 4)).map(value -> controller.createAndRegisterCounter(Class.class, "metricName", TableReference.create(Namespace.create("namespace"), "table" + value))).collectToMap();
counters.forEach((value, counter) -> counter.inc(value));
Counter otherControllersCounter = otherController.createAndRegisterCounter(Class.class, "metricName", TableReference.create(Namespace.create("namespace"), "table3"));
otherControllersCounter.inc(3);
assertThat(metricsManager.getPublishableMetrics().getMetrics()).containsOnlyKeys(getMetricName("table2"), getMetricName("table4"));
assertThat(otherManager.getPublishableMetrics().getMetrics()).containsOnlyKeys(getMetricName("table3"));
}
use of com.palantir.tritium.metrics.registry.MetricName in project atlasdb by palantir.
the class MetricsManager method registerOrGetTaggedHistogram.
public Histogram registerOrGetTaggedHistogram(Class<?> clazz, String metricName, Map<String, String> tags) {
MetricName name = getTaggedMetricName(clazz, metricName, tags);
Histogram histogram = taggedMetricRegistry.histogram(name);
registerTaggedMetricName(name);
return histogram;
}
Aggregations