-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: emit warn when labels and values are out of sync
- Loading branch information
1 parent
9149e4e
commit 35cbdbf
Showing
3 changed files
with
125 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
TAP version 14 | ||
# Subtest: Guard() - object type - should be MetricsGuard | ||
ok 1 - should be equal | ||
1..1 | ||
ok 1 - Guard() - object type - should be MetricsGuard # time=1.514ms | ||
|
||
# Subtest: Guard() - "metricsThreshold" argument is not valid - should throw | ||
1..1 | ||
ok 1 - expected to throw | ||
ok 2 - Guard() - "metricsThreshold" argument is not valid - should throw # time=2.47ms | ||
|
||
# Subtest: Guard() - "permutationThreshold" argument is not valid - should throw | ||
1..1 | ||
ok 1 - expected to throw | ||
ok 3 - Guard() - "permutationThreshold" argument is not valid - should throw # time=0.346ms | ||
|
||
# Subtest: Guard() - "enabled" argument is not valid - should throw | ||
1..1 | ||
ok 1 - expected to throw | ||
ok 4 - Guard() - "enabled" argument is not valid - should throw # time=0.418ms | ||
|
||
# Subtest: Guard() - "permutationThreshold" is at 6 - one metric exceed this - should drop the metric from the stream when exceeding the threshold | ||
ok 1 - should be equal | ||
ok 2 - should be equal | ||
ok 3 - should be equal | ||
ok 4 - should be equal | ||
ok 5 - should be equal | ||
ok 6 - should be equal | ||
1..6 | ||
ok 5 - Guard() - "permutationThreshold" is at 6 - one metric exceed this - should drop the metric from the stream when exceeding the threshold # time=3.59ms | ||
|
||
# Subtest: Guard() - "metricsThreshold" is at 4 - one metric exceed this - should emit warn event | ||
ok 1 - should be equal | ||
ok 2 - should be equal | ||
1..2 | ||
ok 6 - Guard() - "metricsThreshold" is at 4 - one metric exceed this - should emit warn event # time=0.445ms | ||
|
||
# Subtest: Guard() - "enabled" is "false" - metrics exceeds limits - should not interfere and should not store internal metrics | ||
ok 1 - should be equal | ||
ok 2 - should be equal | ||
ok 3 - should be equal | ||
1..3 | ||
ok 7 - Guard() - "enabled" is "false" - metrics exceeds limits - should not interfere and should not store internal metrics # time=0.595ms | ||
|
||
# Subtest: .getMetrics() - set metrics - call method - should return an Array with metric names without duplicates | ||
ok 1 - should be equal | ||
ok 2 - should be equal | ||
ok 3 - should be equal | ||
1..3 | ||
ok 8 - .getMetrics() - set metrics - call method - should return an Array with metric names without duplicates # time=0.496ms | ||
|
||
# Subtest: .getLabels() - set metrics - call method - should return an Array with metric names without duplicates | ||
ok 1 - should be equal | ||
ok 2 - should be equal | ||
ok 3 - should be equal | ||
ok 4 - should be equal | ||
ok 5 - should be equal | ||
ok 6 - should be equal | ||
1..6 | ||
ok 9 - .getLabels() - set metrics - call method - should return an Array with metric names without duplicates # time=1.978ms | ||
|
||
# Subtest: .reset() - set metrics - call method - should empty the guard registry | ||
ok 1 - should be equal | ||
ok 2 - should be equal | ||
ok 3 - should be equal | ||
ok 4 - should be equal | ||
ok 5 - should be equal | ||
1..5 | ||
ok 10 - .reset() - set metrics - call method - should empty the guard registry # time=0.64ms | ||
|
||
# Subtest: .pipe() - exceed the default, 10, number of max event listeners - should not cause the process to emit a MaxListenersExceededWarning | ||
ok 1 - should be equal | ||
1..1 | ||
ok 11 - .pipe() - exceed the default, 10, number of max event listeners - should not cause the process to emit a MaxListenersExceededWarning # time=0.924ms | ||
|
||
# Subtest: Guard() - do not add metric where label name / values are null and emit warning | ||
ok 1 - should be equal | ||
ok 2 - should match pattern | ||
ok 3 - should be equal | ||
1..3 | ||
ok 12 - Guard() - do not add metric where label name / values are null and emit warning # time=0.402ms | ||
|
||
1..12 |
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