-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integration: properly parse output metrics and assert more things about them #44
Open
nadiamoe
wants to merge
7
commits into
main
Choose a base branch
from
integration-prometheus
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+202
−59
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f1041ab
integration: embed test script, check for binary existence
nadiamoe db13d81
integration: parse prometheus output and assert against it
nadiamoe 80516fc
integration: remove unused outer loops
nadiamoe de7fda9
integration: check for presence of more metrics `probe_checks_total`
nadiamoe 52ff8e0
integration: add test for unwanted metrics
nadiamoe 934c665
integration: check for non-presence of more labels
nadiamoe 7b04031
integration: add text for presence of certain labels in certain metrics
nadiamoe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,41 @@ | ||
import { check } from 'k6'; | ||
import http from 'k6/http'; | ||
import { Trend, Counter, Gauge } from 'k6/metrics'; | ||
|
||
const testHost = __ENV.TEST_HOST ? __ENV.TEST_HOST : "test-api.k6.io"; | ||
|
||
const myTrend = new Trend('waiting_time'); | ||
const myCounter = new Counter('my_counter'); | ||
const myGauge = new Gauge('my_gauge'); | ||
|
||
export const options = { | ||
iterations: 1, | ||
}; | ||
|
||
export default function () { | ||
myTrend.add(0.5); | ||
myTrend.add(0.6); | ||
myTrend.add(0.7); | ||
|
||
myGauge.add(5); | ||
myGauge.add(6); // Discards previous value. | ||
|
||
myCounter.add(1); | ||
myCounter.add(2); | ||
|
||
check({}, { | ||
'something': () => false, | ||
} | ||
); | ||
check({}, { | ||
'something': () => false, | ||
} | ||
); | ||
|
||
http.get(`http://${testHost}`); // non-https. | ||
http.get(`https://${testHost}/public/crocodiles/`); | ||
http.get(`https://${testHost}/public/crocodiles2/`); // 404 | ||
http.get(`https://${testHost}/public/crocodiles3/`); // 404 | ||
http.get(`https://${testHost}/public/crocodiles4/`); // 404 | ||
http.get(`http://fail.internal/public/crocodiles4/`); // failed | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to create two subtests, one for metrics and then one for each script we run. As it turns out, we only test for metrics and we only run that script, so I removed these two subtests entirely and decreased indentation a bunch. Git does not do a good job displaying this indentation change.
Feel free to switch to the single commit view for a less noisy diff.