-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel González Lopes <[email protected]>
- Loading branch information
Showing
1,169 changed files
with
1,364 additions
and
566,700 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.env | ||
k6 |
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 was deleted.
Oops, something went wrong.
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,64 @@ | ||
import { check, sleep } from 'k6'; | ||
import remote from 'k6/x/remotewrite'; | ||
|
||
export let options = { | ||
scenarios: { | ||
sendBatch: { | ||
executor: 'constant-vus', | ||
exec: 'sendBatch', | ||
vus: 10, | ||
duration: '1m', | ||
}, | ||
increaseCounter: { | ||
executor: 'constant-vus', | ||
exec: 'increaseCounter', | ||
vus: 1, | ||
duration: '1m', | ||
}, | ||
} | ||
}; | ||
|
||
const client = new remote.Client({ | ||
url: "<your-remote-write-url>", | ||
}); | ||
|
||
export function increaseCounter() { | ||
let res = client.store([{ | ||
"labels": [ | ||
{ "name": "__name__", "value": `my_happy_metric_total` }, | ||
], | ||
"samples": [ | ||
{ "value": __ITER, } | ||
] | ||
}, | ||
]); | ||
check(res, { | ||
'is status 200': (r) => r.status_code === 200, | ||
}); | ||
sleep(10); | ||
} | ||
export function sendBatch() { | ||
let res = client.store([{ | ||
"labels": [ | ||
{ "name": "__name__", "value": `my_cool_metric_${__VU}` }, | ||
{ "name": "service", "value": "bar" } | ||
], | ||
"samples": [ | ||
{ "value": Math.random() * 100, } | ||
] | ||
}, | ||
{ | ||
"labels": [ | ||
{ "name": "__name__", "value": `my_fancy_metric_${__VU}` }, | ||
], | ||
"samples": [ | ||
{ "value": Math.random() * 100 }, | ||
{ "value": Math.random() * 100 } | ||
] | ||
} | ||
]); | ||
check(res, { | ||
'is status 200': (r) => r.status_code === 200, | ||
}); | ||
sleep(1) | ||
} |
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,27 @@ | ||
import { check, sleep } from 'k6'; | ||
import remote from 'k6/x/remotewrite'; | ||
|
||
export let options = { | ||
vus: 10, | ||
duration: '10s', | ||
}; | ||
|
||
const client = new remote.Client({ | ||
url: "<your-remote-write-url>" | ||
}); | ||
|
||
export default function () { | ||
let res = client.store([{ | ||
"labels": [ | ||
{ "name": "__name__", "value": `my_cool_metric_${__VU}` }, | ||
{ "name": "service", "value": "bar" } | ||
], | ||
"samples": [ | ||
{ "value": Math.random() * 100, } | ||
] | ||
}]); | ||
check(res, { | ||
'is status 200': (r) => r.status_code === 200, | ||
}); | ||
sleep(1) | ||
} |
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
Oops, something went wrong.