mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 05:16:53 +00:00
keep lettuce metrics; strip remote tags
This commit is contained in:
1 parent
eeea97e2fe
commit
17d48b95ac
2 files changed
+6
-15
No files matched your search
@@ -26,23 +26,18 @@ class MetricsUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void lettuceRejection() {
|
||||
void lettuceTagRejection() {
|
||||
MeterRegistry registry = new SimpleMeterRegistry();
|
||||
MetricsUtil.configureMeterFilters(registry.config());
|
||||
|
||||
registry.counter("lettuce.command.completion.count").increment();
|
||||
registry.counter("lettuce.command.firstresponse.max").increment();
|
||||
registry.counter("lettuce.test").increment();
|
||||
assertThat(registry.getMeters()).isEmpty();
|
||||
|
||||
// this lettuce statistic is allow-listed
|
||||
registry.counter("lettuce.command.completion.max", "command", "hello", "remote", "world").increment();
|
||||
registry.counter("lettuce.command.completion.max", "command", "hello", "remote", "world", "allowed", "!").increment();
|
||||
final List<Meter> meters = registry.getMeters();
|
||||
assertThat(meters).hasSize(1);
|
||||
|
||||
Meter meter = meters.get(0);
|
||||
assertThat(meter.getId().getName()).isEqualTo("chat.lettuce.command.completion.max");
|
||||
assertThat(meter.getId().getTag("command")).isNull();
|
||||
assertThat(meter.getId().getTag("remote")).isNotNull();
|
||||
assertThat(meter.getId().getTag("remote")).isNull();
|
||||
assertThat(meter.getId().getTag("allowed")).isNotNull();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user