summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2023-12-25 23:10:53 +0100
committerValery Piashchynski <[email protected]>2023-12-25 23:10:53 +0100
commitea6bb1494c2072c36ca340f956a63a2738e27d94 (patch)
tree7613a4ce5f98cd48e49d94db720765037605d63d
parent75a0320706dd18fed3479d661b9d4cba9f76037c (diff)
feature: prepare simple benchmark script for k6
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r--benchmarks/simple.js63
-rw-r--r--go.sum2
2 files changed, 65 insertions, 0 deletions
diff --git a/benchmarks/simple.js b/benchmarks/simple.js
new file mode 100644
index 00000000..3f0ebfe6
--- /dev/null
+++ b/benchmarks/simple.js
@@ -0,0 +1,63 @@
+import http from 'k6/http';
+import { sleep } from 'k6';
+
+export const options = {
+ // A number specifying the number of VUs to run concurrently.
+ vus: 2000,
+ // A string specifying the total duration of the test run.
+ duration: '30s',
+
+ // The following section contains configuration options for execution of this
+ // test script in Grafana Cloud.
+ //
+ // See https://grafana.com/docs/grafana-cloud/k6/get-started/run-cloud-tests-from-the-cli/
+ // to learn about authoring and running k6 test scripts in Grafana k6 Cloud.
+ //
+ // ext: {
+ // loadimpact: {
+ // // The ID of the project to which the test is assigned in the k6 Cloud UI.
+ // // By default tests are executed in default project.
+ // projectID: "",
+ // // The name of the test in the k6 Cloud UI.
+ // // Test runs with the same name will be grouped.
+ // name: "script.js"
+ // }
+ // },
+
+ // Uncomment this section to enable the use of Browser API in your tests.
+ //
+ // See https://grafana.com/docs/k6/latest/using-k6-browser/running-browser-tests/ to learn more
+ // about using Browser API in your test scripts.
+ //
+ // scenarios: {
+ // // The scenario name appears in the result summary, tags, and so on.
+ // // You can give the scenario any name, as long as each name in the script is unique.
+ // ui: {
+ // // Executor is a mandatory parameter for browser-based tests.
+ // // Shared iterations in this case tells k6 to reuse VUs to execute iterations.
+ // //
+ // // See https://grafana.com/docs/k6/latest/using-k6/scenarios/executors/ for other executor types.
+ // executor: 'shared-iterations',
+ // options: {
+ // browser: {
+ // // This is a mandatory parameter that instructs k6 to launch and
+ // // connect to a chromium-based browser, and use it to run UI-based
+ // // tests.
+ // type: 'chromium',
+ // },
+ // },
+ // },
+ // }
+};
+
+// The function that defines VU logic.
+//
+// See https://grafana.com/docs/k6/latest/examples/get-started-with-k6/ to learn more
+// about authoring k6 scripts.
+//
+let params = {
+ timeout: '120s'
+};
+export default function() {
+ http.get('http://127.0.0.1:15389', params);
+}
diff --git a/go.sum b/go.sum
index ea2815c3..d4539e64 100644
--- a/go.sum
+++ b/go.sum
@@ -71,6 +71,7 @@ github.com/caddyserver/certmagic v0.20.0/go.mod h1:N4sXgpICQUskEWpj7zVzvWD41p3NY
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
@@ -236,6 +237,7 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg=
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k=
github.com/mholt/acmez v1.2.0 h1:1hhLxSgY5FvH5HCnGUuwbKY2VQVo8IU7rxXKSnZ7F30=