Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/src/jmh/java/com/uber/m3/tally/ScopeImplConcurrent.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void hotkeyLockContention(Blackhole bh, BenchmarkState state) {
for (int i = 0; i < 10000; i++) {

for (String key : KEYS) {
Scope scope = state.scope.computeSubscopeIfAbsent(key, common);
Scope scope = state.scope.computeSubscopeIfAbsent("prefix", key, common);
assert scope != null;
bh.consume(scope);
}
Expand All @@ -41,7 +41,7 @@ public void setup() {
.reportEvery(Duration.MAX_VALUE);

for (String key : KEYS) {
scope.computeSubscopeIfAbsent(key, new ImmutableMap.Builder<String, String>().build());
scope.computeSubscopeIfAbsent("prefix", key, new ImmutableMap.Builder<String, String>().build());
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/com/uber/m3/tally/ScopeImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,11 @@ private Scope subScopeHelper(String prefix, Map<String, String> tags) {

String key = keyForPrefixedStringMap(prefix, mergedTags);

return computeSubscopeIfAbsent(key, mergedTags);
return computeSubscopeIfAbsent(prefix, key, mergedTags);
}

// This method must only be called on unit tests or benchmarks
protected Scope computeSubscopeIfAbsent(String key, ImmutableMap<String, String> mergedTags) {
protected Scope computeSubscopeIfAbsent(String prefix, String key, ImmutableMap<String, String> mergedTags) {
Scope scope = registry.subscopes.get(key);
if (scope != null) {
return scope;
Expand Down