mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: doesExceedThreshold greater than logic (#408)
This commit is contained in:
parent
4176710570
commit
884938a2f4
3 changed files with 10 additions and 3 deletions
5
.changeset/late-teachers-greet.md
Normal file
5
.changeset/late-teachers-greet.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hyperdx/api': patch
|
||||
---
|
||||
|
||||
fix: doesExceedThreshold greater than logic
|
||||
|
|
@ -84,9 +84,11 @@ describe('checkAlerts', () => {
|
|||
|
||||
it('doesExceedThreshold', () => {
|
||||
expect(doesExceedThreshold(true, 10, 11)).toBe(true);
|
||||
expect(doesExceedThreshold(true, 10, 10)).toBe(true);
|
||||
expect(doesExceedThreshold(false, 10, 9)).toBe(true);
|
||||
expect(doesExceedThreshold(true, 10, 10)).toBe(false);
|
||||
expect(doesExceedThreshold(true, 10, 9)).toBe(false);
|
||||
expect(doesExceedThreshold(false, 10, 11)).toBe(false);
|
||||
expect(doesExceedThreshold(false, 10, 10)).toBe(false);
|
||||
expect(doesExceedThreshold(false, 10, 9)).toBe(true);
|
||||
});
|
||||
|
||||
it('expandToNestedObject', () => {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ export const doesExceedThreshold = (
|
|||
threshold: number,
|
||||
value: number,
|
||||
) => {
|
||||
if (isThresholdTypeAbove && value >= threshold) {
|
||||
if (isThresholdTypeAbove && value > threshold) {
|
||||
return true;
|
||||
} else if (!isThresholdTypeAbove && value < threshold) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue