-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit ensures that impacted commands (run, archive, cloud) validate thresholds before running.
- Loading branch information
Showing
6 changed files
with
150 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const options = { | ||
thresholds: { | ||
// non existing is neither registered, nor a builtin metric. | ||
// k6 should catch that. | ||
"non existing": ["rate>0"], | ||
}, | ||
}; | ||
|
||
export default function () { | ||
console.log( | ||
"asserting that a threshold over a non-existing metric fails with exit code 104 (Invalid config)" | ||
); | ||
} |
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,13 @@ | ||
export const options = { | ||
thresholds: { | ||
// http_reqs being a builtin metric has no foo:bar | ||
// tag definition. As such k6 should detect it and | ||
"http_reqs{foo:bar}": ["count>0"], | ||
}, | ||
}; | ||
|
||
export default function () { | ||
console.log( | ||
"asserting that a threshold applying a method over a metric not supporting it fails with exit code 104 (Invalid config)" | ||
); | ||
} |
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,15 @@ | ||
export const options = { | ||
thresholds: { | ||
// http_reqs is a Counter metric. As such, it supports | ||
// only the 'count' and 'rate' operations. Thus, 'value' | ||
// being a Gauge's metric aggregation method, the threshold | ||
// configuration evaluation should fail. | ||
http_reqs: ["value>0"], | ||
}, | ||
}; | ||
|
||
export default function () { | ||
console.log( | ||
"asserting that a threshold applying a method over a metric not supporting it fails with exit code 104 (Invalid config)" | ||
); | ||
} |