From b60558bf694c55d3be618f4b71453d6d38c7b441 Mon Sep 17 00:00:00 2001 From: DGarbar Date: Thu, 22 Oct 2020 15:52:08 +0300 Subject: [PATCH] AdapterMetrics.java -> AdapterTypeMetrics.java new class is AdapterMetrics.java (corresponds .adapter.) I did this bc wanted to use explicit API. account().adapter().adapterFor() not account().adapterFor() `account...request_time` `account...bids_received` `account...requests.(gotbids|nobid)` TO `account..adapter..request_time` `account..adapter..bids_received` `account..adapter..requests.(gotbids|nobid)` --- docs/metrics.md | 6 +- .../prebid/server/metric/AccountMetrics.java | 10 +-- .../prebid/server/metric/AdapterMetrics.java | 56 +++----------- .../server/metric/AdapterTypeMetrics.java | 75 +++++++++++++++++++ .../org/prebid/server/metric/Metrics.java | 36 ++++----- .../org/prebid/server/metric/MetricsTest.java | 41 +++++----- 6 files changed, 135 insertions(+), 89 deletions(-) create mode 100644 src/main/java/org/prebid/server/metric/AdapterTypeMetrics.java diff --git a/docs/metrics.md b/docs/metrics.md index 86f8b1203fb..c14824cca63 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -59,9 +59,9 @@ Following metrics are collected and submitted if account is configured with `bas Following metrics are collected and submitted if account is configured with `detailed` verbosity: - `account..requests.type.(openrtb2-web,openrtb-app,amp,legacy)` - number of requests received from account with `` broken down by type of incoming request -- `account...request_time` - timer tracking how long did it take to make a request to `` when incoming request was from `` -- `account...bids_received` - number of bids received from `` when incoming request was from `` -- `account...requests.(gotbids|nobid)` - number of requests made to `` broken down by result status when incoming request was from `` +- `account..adapter..request_time` - timer tracking how long did it take to make a request to `` when incoming request was from `` +- `account..adapter..bids_received` - number of bids received from `` when incoming request was from `` +- `account..adapter..requests.(gotbids|nobid)` - number of requests made to `` broken down by result status when incoming request was from `` - `account..requests.rejected` - number of rejected requests caused by incorrect `accountId` ([UnauthorizedAccountException.java](https://github.com/rubicon-project/prebid-server-java/blob/master/src/main/java/org/prebid/server/exception/UnauthorizedAccountException.java)) ## General Prebid Cache metrics diff --git a/src/main/java/org/prebid/server/metric/AccountMetrics.java b/src/main/java/org/prebid/server/metric/AccountMetrics.java index 2dcfbba217a..ae77d1dbe2d 100644 --- a/src/main/java/org/prebid/server/metric/AccountMetrics.java +++ b/src/main/java/org/prebid/server/metric/AccountMetrics.java @@ -12,23 +12,21 @@ */ class AccountMetrics extends UpdatableMetrics { - private final Function adapterMetricsCreator; // not thread-safe maps are intentionally used here because it's harmless in this particular case - eventually // this all boils down to metrics lookup by underlying metric registry and that operation is guaranteed to be // thread-safe - private final Map adapterMetrics; private final Function requestTypeMetricsCreator; private final Map requestTypeMetrics; + private final AdapterMetrics adapterMetrics; private final RequestMetrics requestsMetrics; private final CacheMetrics cacheMetrics; AccountMetrics(MetricRegistry metricRegistry, CounterType counterType, String account) { super(Objects.requireNonNull(metricRegistry), Objects.requireNonNull(counterType), nameCreator(createPrefix(Objects.requireNonNull(account)))); - adapterMetricsCreator = adapterType -> new AdapterMetrics(metricRegistry, counterType, account, adapterType); - adapterMetrics = new HashMap<>(); requestTypeMetricsCreator = requestType -> new RequestTypeMetrics(metricRegistry, counterType, createPrefix(account), requestType); + adapterMetrics = new AdapterMetrics(metricRegistry, counterType, createPrefix(account)); requestTypeMetrics = new HashMap<>(); requestsMetrics = new RequestMetrics(metricRegistry, counterType, createPrefix(account)); cacheMetrics = new CacheMetrics(metricRegistry, counterType, createPrefix(account)); @@ -42,8 +40,8 @@ private static Function nameCreator(String prefix) { return metricName -> String.format("%s.%s", prefix, metricName.toString()); } - AdapterMetrics forAdapter(String adapterType) { - return adapterMetrics.computeIfAbsent(adapterType, adapterMetricsCreator); + AdapterMetrics adapter() { + return adapterMetrics; } RequestTypeMetrics requestType(MetricName requestType) { diff --git a/src/main/java/org/prebid/server/metric/AdapterMetrics.java b/src/main/java/org/prebid/server/metric/AdapterMetrics.java index 80b406ec94a..96c3621e431 100644 --- a/src/main/java/org/prebid/server/metric/AdapterMetrics.java +++ b/src/main/java/org/prebid/server/metric/AdapterMetrics.java @@ -12,61 +12,27 @@ */ class AdapterMetrics extends UpdatableMetrics { - private final Function requestTypeMetricsCreator; - private final Map requestTypeMetrics; - private final RequestMetrics requestMetrics; - private final Function bidTypeMetricsCreator; - private final Map bidTypeMetrics; + private final Function adapterMetricsCreator; + private final Map adapterMetrics; - AdapterMetrics(MetricRegistry metricRegistry, CounterType counterType, String adapterType) { + AdapterMetrics(MetricRegistry metricRegistry, CounterType counterType, String accountPrefix) { super(Objects.requireNonNull(metricRegistry), Objects.requireNonNull(counterType), - nameCreator(createAdapterPrefix(Objects.requireNonNull(adapterType)))); + nameCreator(createAdapterSuffix(Objects.requireNonNull(accountPrefix)))); - bidTypeMetricsCreator = bidType -> - new BidTypeMetrics(metricRegistry, counterType, createAdapterPrefix(adapterType), bidType); - requestTypeMetricsCreator = requestType -> - new RequestTypeMetrics(metricRegistry, counterType, createAdapterPrefix(adapterType), requestType); - requestTypeMetrics = new HashMap<>(); - requestMetrics = new RequestMetrics(metricRegistry, counterType, createAdapterPrefix(adapterType)); - bidTypeMetrics = new HashMap<>(); + adapterMetrics = new HashMap<>(); + adapterMetricsCreator = adapterType -> new AdapterTypeMetrics(metricRegistry, counterType, + createAdapterSuffix(Objects.requireNonNull(accountPrefix)), adapterType); } - AdapterMetrics(MetricRegistry metricRegistry, CounterType counterType, String account, String adapterType) { - super(Objects.requireNonNull(metricRegistry), Objects.requireNonNull(counterType), - nameCreator(createAccountAdapterPrefix(Objects.requireNonNull(account), - Objects.requireNonNull(adapterType)))); - - requestMetrics = new RequestMetrics(metricRegistry, counterType, - createAccountAdapterPrefix(account, adapterType)); - - // not used for account.adapter metrics - requestTypeMetricsCreator = null; - requestTypeMetrics = null; - bidTypeMetricsCreator = null; - bidTypeMetrics = null; - } - - private static String createAdapterPrefix(String adapterType) { - return String.format("adapter.%s", adapterType); - } - - private static String createAccountAdapterPrefix(String account, String adapterType) { - return String.format("account.%s.%s", account, adapterType); + private static String createAdapterSuffix(String prefix) { + return String.format("%s.adapter", prefix); } private static Function nameCreator(String prefix) { return metricName -> String.format("%s.%s", prefix, metricName.toString()); } - RequestTypeMetrics requestType(MetricName requestType) { - return requestTypeMetrics.computeIfAbsent(requestType, requestTypeMetricsCreator); - } - - RequestMetrics request() { - return requestMetrics; - } - - BidTypeMetrics forBidType(String bidType) { - return bidTypeMetrics.computeIfAbsent(bidType, bidTypeMetricsCreator); + AdapterTypeMetrics forAdapter(String adapterType) { + return adapterMetrics.computeIfAbsent(adapterType, adapterMetricsCreator); } } diff --git a/src/main/java/org/prebid/server/metric/AdapterTypeMetrics.java b/src/main/java/org/prebid/server/metric/AdapterTypeMetrics.java new file mode 100644 index 00000000000..728d3a7264f --- /dev/null +++ b/src/main/java/org/prebid/server/metric/AdapterTypeMetrics.java @@ -0,0 +1,75 @@ +package org.prebid.server.metric; + +import com.codahale.metrics.MetricRegistry; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; + +/** + * AdapterType metrics support. + */ +class AdapterTypeMetrics extends UpdatableMetrics { + + private final Function requestTypeMetricsCreator; + private final Map requestTypeMetrics; + private final RequestMetrics requestMetrics; + private final Function bidTypeMetricsCreator; + private final Map bidTypeMetrics; + + AdapterTypeMetrics(MetricRegistry metricRegistry, CounterType counterType, String adapterType) { + super(Objects.requireNonNull(metricRegistry), Objects.requireNonNull(counterType), + nameCreator(createAdapterPrefix(Objects.requireNonNull(adapterType)))); + + bidTypeMetricsCreator = bidType -> + new BidTypeMetrics(metricRegistry, counterType, createAdapterPrefix(adapterType), bidType); + requestTypeMetricsCreator = requestType -> + new RequestTypeMetrics(metricRegistry, counterType, createAdapterPrefix(adapterType), requestType); + requestTypeMetrics = new HashMap<>(); + requestMetrics = new RequestMetrics(metricRegistry, counterType, createAdapterPrefix(adapterType)); + bidTypeMetrics = new HashMap<>(); + } + + AdapterTypeMetrics(MetricRegistry metricRegistry, + CounterType counterType, + String accountAdapterPrefix, + String adapterType) { + super(Objects.requireNonNull(metricRegistry), Objects.requireNonNull(counterType), + nameCreator(createAdapterPrefix(Objects.requireNonNull(accountAdapterPrefix), + Objects.requireNonNull(adapterType)))); + + requestMetrics = new RequestMetrics(metricRegistry, counterType, + createAdapterPrefix(accountAdapterPrefix, adapterType)); + + // not used for account.adapter.adapters metrics + requestTypeMetricsCreator = null; + requestTypeMetrics = null; + bidTypeMetricsCreator = null; + bidTypeMetrics = null; + } + + private static String createAdapterPrefix(String adapterType) { + return String.format("adapter.%s", adapterType); + } + + private static String createAdapterPrefix(String adapterPrefix, String adapterType) { + return String.format("%s.%s", adapterPrefix, adapterType); + } + + private static Function nameCreator(String prefix) { + return metricName -> String.format("%s.%s", prefix, metricName.toString()); + } + + RequestTypeMetrics requestType(MetricName requestType) { + return requestTypeMetrics.computeIfAbsent(requestType, requestTypeMetricsCreator); + } + + RequestMetrics request() { + return requestMetrics; + } + + BidTypeMetrics forBidType(String bidType) { + return bidTypeMetrics.computeIfAbsent(bidType, bidTypeMetricsCreator); + } +} diff --git a/src/main/java/org/prebid/server/metric/Metrics.java b/src/main/java/org/prebid/server/metric/Metrics.java index f692ea4e169..d8f4a5eebcf 100644 --- a/src/main/java/org/prebid/server/metric/Metrics.java +++ b/src/main/java/org/prebid/server/metric/Metrics.java @@ -27,7 +27,7 @@ public class Metrics extends UpdatableMetrics { private final Function requestMetricsCreator; private final Function accountMetricsCreator; - private final Function adapterMetricsCreator; + private final Function adapterMetricsCreator; private final Function bidderCardinalityMetricsCreator; private final Function circuitBreakerMetricsCreator; // not thread-safe maps are intentionally used here because it's harmless in this particular case - eventually @@ -35,7 +35,7 @@ public class Metrics extends UpdatableMetrics { // thread-safe private final Map requestMetrics; private final Map accountMetrics; - private final Map adapterMetrics; + private final Map adapterMetrics; private final Map bidderCardinailtyMetrics; private final UserSyncMetrics userSyncMetrics; private final CookieSyncMetrics cookieSyncMetrics; @@ -52,7 +52,7 @@ public Metrics(MetricRegistry metricRegistry, CounterType counterType, AccountMe requestMetricsCreator = requestType -> new RequestStatusMetrics(metricRegistry, counterType, requestType); accountMetricsCreator = account -> new AccountMetrics(metricRegistry, counterType, account); - adapterMetricsCreator = adapterType -> new AdapterMetrics(metricRegistry, counterType, adapterType); + adapterMetricsCreator = adapterType -> new AdapterTypeMetrics(metricRegistry, counterType, adapterType); bidderCardinalityMetricsCreator = cardinality -> new BidderCardinalityMetrics( metricRegistry, counterType, cardinality); circuitBreakerMetricsCreator = id -> new CircuitBreakerMetrics(metricRegistry, counterType, id); @@ -79,7 +79,7 @@ AccountMetrics forAccount(String account) { return accountMetrics.computeIfAbsent(account, accountMetricsCreator); } - AdapterMetrics forAdapter(String adapterType) { + AdapterTypeMetrics forAdapter(String adapterType) { return adapterMetrics.computeIfAbsent(adapterType, adapterMetricsCreator); } @@ -203,22 +203,23 @@ public void updateAccountRequestRejectedMetrics(String accountId) { } public void updateAdapterRequestTypeAndNoCookieMetrics(String bidder, MetricName requestType, boolean noCookie) { - final AdapterMetrics adapterMetrics = forAdapter(resolveMetricsBidderName(bidder)); + final AdapterTypeMetrics adapterTypeMetrics = forAdapter(resolveMetricsBidderName(bidder)); - adapterMetrics.requestType(requestType).incCounter(MetricName.requests); + adapterTypeMetrics.requestType(requestType).incCounter(MetricName.requests); if (noCookie) { - adapterMetrics.incCounter(MetricName.no_cookie_requests); + adapterTypeMetrics.incCounter(MetricName.no_cookie_requests); } } public void updateAdapterResponseTime(String bidder, String accountId, int responseTime) { final String metricsBidderName = resolveMetricsBidderName(bidder); - final AdapterMetrics adapterMetrics = forAdapter(metricsBidderName); - adapterMetrics.updateTimer(MetricName.request_time, responseTime); + final AdapterTypeMetrics adapterTypeMetrics = forAdapter(metricsBidderName); + adapterTypeMetrics.updateTimer(MetricName.request_time, responseTime); if (accountMetricsVerbosity.forAccount(accountId).isAtLeast(AccountMetricsVerbosityLevel.detailed)) { - final AdapterMetrics accountAdapterMetrics = forAccount(accountId).forAdapter(metricsBidderName); + final AdapterTypeMetrics accountAdapterMetrics = + forAccount(accountId).adapter().forAdapter(metricsBidderName); accountAdapterMetrics.updateTimer(MetricName.request_time, responseTime); } } @@ -227,7 +228,7 @@ public void updateAdapterRequestNobidMetrics(String bidder, String accountId) { final String metricsBidderName = resolveMetricsBidderName(bidder); forAdapter(metricsBidderName).request().incCounter(MetricName.nobid); if (accountMetricsVerbosity.forAccount(accountId).isAtLeast(AccountMetricsVerbosityLevel.detailed)) { - forAccount(accountId).forAdapter(metricsBidderName).request().incCounter(MetricName.nobid); + forAccount(accountId).adapter().forAdapter(metricsBidderName).request().incCounter(MetricName.nobid); } } @@ -235,20 +236,21 @@ public void updateAdapterRequestGotbidsMetrics(String bidder, String accountId) final String metricsBidderName = resolveMetricsBidderName(bidder); forAdapter(metricsBidderName).request().incCounter(MetricName.gotbids); if (accountMetricsVerbosity.forAccount(accountId).isAtLeast(AccountMetricsVerbosityLevel.detailed)) { - forAccount(accountId).forAdapter(metricsBidderName).request().incCounter(MetricName.gotbids); + forAccount(accountId).adapter().forAdapter(metricsBidderName).request().incCounter(MetricName.gotbids); } } public void updateAdapterBidMetrics(String bidder, String accountId, long cpm, boolean isAdm, String bidType) { final String metricsBidderName = resolveMetricsBidderName(bidder); - final AdapterMetrics adapterMetrics = forAdapter(metricsBidderName); - adapterMetrics.updateHistogram(MetricName.prices, cpm); - adapterMetrics.incCounter(MetricName.bids_received); - adapterMetrics.forBidType(bidType) + final AdapterTypeMetrics adapterTypeMetrics = forAdapter(metricsBidderName); + adapterTypeMetrics.updateHistogram(MetricName.prices, cpm); + adapterTypeMetrics.incCounter(MetricName.bids_received); + adapterTypeMetrics.forBidType(bidType) .incCounter(isAdm ? MetricName.adm_bids_received : MetricName.nurl_bids_received); if (accountMetricsVerbosity.forAccount(accountId).isAtLeast(AccountMetricsVerbosityLevel.detailed)) { - final AdapterMetrics accountAdapterMetrics = forAccount(accountId).forAdapter(metricsBidderName); + final AdapterTypeMetrics accountAdapterMetrics = + forAccount(accountId).adapter().forAdapter(metricsBidderName); accountAdapterMetrics.updateHistogram(MetricName.prices, cpm); accountAdapterMetrics.incCounter(MetricName.bids_received); } diff --git a/src/test/java/org/prebid/server/metric/MetricsTest.java b/src/test/java/org/prebid/server/metric/MetricsTest.java index 26d96af0762..88d4a70b4f6 100644 --- a/src/test/java/org/prebid/server/metric/MetricsTest.java +++ b/src/test/java/org/prebid/server/metric/MetricsTest.java @@ -153,14 +153,15 @@ public void shouldReturnAdapterRequestMetricsConfiguredWithAdapterType() { @Test public void shouldReturnSameAccountAdapterMetricsOnSuccessiveCalls() { - assertThat(metrics.forAccount(ACCOUNT_ID).forAdapter(RUBICON)) - .isSameAs(metrics.forAccount(ACCOUNT_ID).forAdapter(RUBICON)); + assertThat(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON)) + .isSameAs(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON)); } @Test public void shouldReturnAccountAdapterMetricsConfiguredWithCounterType() { verifyCreatesConfiguredCounterType(metrics -> metrics .forAccount(ACCOUNT_ID) + .adapter() .forAdapter(RUBICON) .incCounter(MetricName.bids_received)); } @@ -168,22 +169,23 @@ public void shouldReturnAccountAdapterMetricsConfiguredWithCounterType() { @Test public void shouldReturnAccountAdapterMetricsConfiguredWithAccountAndAdapterType() { // when - metrics.forAccount(ACCOUNT_ID).forAdapter(RUBICON).incCounter(MetricName.bids_received); + metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON).incCounter(MetricName.bids_received); // then - assertThat(metricRegistry.counter("account.accountId.rubicon.bids_received").getCount()).isEqualTo(1); + assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.bids_received").getCount()).isEqualTo(1); } @Test public void shouldReturnSameAccountAdapterRequestMetricsOnSuccessiveCalls() { - assertThat(metrics.forAccount(ACCOUNT_ID).forAdapter(RUBICON).request()) - .isSameAs(metrics.forAccount(ACCOUNT_ID).forAdapter(RUBICON).request()); + assertThat(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON).request()) + .isSameAs(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON).request()); } @Test public void shouldReturnAccountAdapterRequestMetricsConfiguredWithCounterType() { verifyCreatesConfiguredCounterType(metrics -> metrics .forAccount(ACCOUNT_ID) + .adapter() .forAdapter(RUBICON) .request() .incCounter(MetricName.gotbids)); @@ -192,10 +194,11 @@ public void shouldReturnAccountAdapterRequestMetricsConfiguredWithCounterType() @Test public void shouldReturnAccountAdapterRequestMetricsConfiguredWithAccountAndAdapterType() { // when - metrics.forAccount(ACCOUNT_ID).forAdapter(RUBICON).request().incCounter(MetricName.gotbids); + metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON).request().incCounter(MetricName.gotbids); // then - assertThat(metricRegistry.counter("account.accountId.rubicon.requests.gotbids").getCount()).isEqualTo(1); + assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.gotbids").getCount()) + .isEqualTo(1); } @Test @@ -499,9 +502,9 @@ public void updateAdapterResponseTimeShouldUpdateMetrics() { // then assertThat(metricRegistry.timer("adapter.rubicon.request_time").getCount()).isEqualTo(1); - assertThat(metricRegistry.timer("account.accountId.rubicon.request_time").getCount()).isEqualTo(1); + assertThat(metricRegistry.timer("account.accountId.adapter.rubicon.request_time").getCount()).isEqualTo(1); assertThat(metricRegistry.timer("adapter.UNKNOWN.request_time").getCount()).isEqualTo(2); - assertThat(metricRegistry.timer("account.accountId.UNKNOWN.request_time").getCount()).isEqualTo(2); + assertThat(metricRegistry.timer("account.accountId.adapter.UNKNOWN.request_time").getCount()).isEqualTo(2); } @Test @@ -516,9 +519,9 @@ public void updateAdapterRequestNobidMetricsShouldIncrementMetrics() { // then assertThat(metricRegistry.counter("adapter.rubicon.requests.nobid").getCount()).isEqualTo(1); - assertThat(metricRegistry.counter("account.accountId.rubicon.requests.nobid").getCount()).isEqualTo(1); + assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.nobid").getCount()).isEqualTo(1); assertThat(metricRegistry.counter("adapter.UNKNOWN.requests.nobid").getCount()).isEqualTo(2); - assertThat(metricRegistry.counter("account.accountId.UNKNOWN.requests.nobid").getCount()).isEqualTo(2); + assertThat(metricRegistry.counter("account.accountId.adapter.UNKNOWN.requests.nobid").getCount()).isEqualTo(2); } @Test @@ -533,9 +536,11 @@ public void updateAdapterRequestGotbidsMetricsShouldIncrementMetrics() { // then assertThat(metricRegistry.counter("adapter.rubicon.requests.gotbids").getCount()).isEqualTo(1); - assertThat(metricRegistry.counter("account.accountId.rubicon.requests.gotbids").getCount()).isEqualTo(1); + assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.gotbids").getCount()) + .isEqualTo(1); assertThat(metricRegistry.counter("adapter.UNKNOWN.requests.gotbids").getCount()).isEqualTo(2); - assertThat(metricRegistry.counter("account.accountId.UNKNOWN.requests.gotbids").getCount()).isEqualTo(2); + assertThat(metricRegistry.counter("account.accountId.adapter.UNKNOWN.requests.gotbids").getCount()) + .isEqualTo(2); } @Test @@ -551,15 +556,15 @@ public void updateAdapterBidMetricsShouldUpdateMetrics() { // then assertThat(metricRegistry.histogram("adapter.rubicon.prices").getCount()).isEqualTo(2); - assertThat(metricRegistry.histogram("account.accountId.rubicon.prices").getCount()).isEqualTo(2); + assertThat(metricRegistry.histogram("account.accountId.adapter.rubicon.prices").getCount()).isEqualTo(2); assertThat(metricRegistry.counter("adapter.rubicon.bids_received").getCount()).isEqualTo(2); - assertThat(metricRegistry.counter("account.accountId.rubicon.bids_received").getCount()).isEqualTo(2); + assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.bids_received").getCount()).isEqualTo(2); assertThat(metricRegistry.counter("adapter.rubicon.banner.adm_bids_received").getCount()).isEqualTo(1); assertThat(metricRegistry.counter("adapter.rubicon.video.nurl_bids_received").getCount()).isEqualTo(1); assertThat(metricRegistry.histogram("adapter.UNKNOWN.prices").getCount()).isEqualTo(2); - assertThat(metricRegistry.histogram("account.accountId.UNKNOWN.prices").getCount()).isEqualTo(2); + assertThat(metricRegistry.histogram("account.accountId.adapter.UNKNOWN.prices").getCount()).isEqualTo(2); assertThat(metricRegistry.counter("adapter.UNKNOWN.bids_received").getCount()).isEqualTo(2); - assertThat(metricRegistry.counter("account.accountId.UNKNOWN.bids_received").getCount()).isEqualTo(2); + assertThat(metricRegistry.counter("account.accountId.adapter.UNKNOWN.bids_received").getCount()).isEqualTo(2); assertThat(metricRegistry.counter("adapter.UNKNOWN.banner.nurl_bids_received").getCount()).isEqualTo(2); }