-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bidder cardinality metric (#953)
- Loading branch information
Showing
6 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/org/prebid/server/metric/BidderCardinalityMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.prebid.server.metric; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
|
||
import java.util.Objects; | ||
import java.util.function.Function; | ||
|
||
public class BidderCardinalityMetrics extends UpdatableMetrics { | ||
|
||
BidderCardinalityMetrics(MetricRegistry metricRegistry, CounterType counterType, Integer cardinality) { | ||
super(metricRegistry, counterType, nameCreator(Objects.requireNonNull(cardinality))); | ||
} | ||
|
||
private static Function<MetricName, String> nameCreator(Integer cardinality) { | ||
return metricName -> String.format("bidder-cardinality.%d.%s", cardinality, metricName.toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters