From bed1cdda9a8057e04075c53b0dd5e76bceda714d Mon Sep 17 00:00:00 2001 From: Pierrick HYMBERT Date: Sat, 9 Mar 2024 08:58:22 +0100 Subject: [PATCH] server: bench: change gauge custom metrics to trend --- examples/server/bench/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/server/bench/script.js b/examples/server/bench/script.js index fb942d6ab..d076b8c34 100644 --- a/examples/server/bench/script.js +++ b/examples/server/bench/script.js @@ -1,7 +1,7 @@ import http from 'k6/http' import {check, sleep} from 'k6' import {SharedArray} from 'k6/data' -import {Counter, Gauge, Rate} from 'k6/metrics' +import {Counter, Rate, Trend} from 'k6/metrics' // Server chat completions prefix const server_url = __ENV.SERVER_BENCH_URL ? __ENV.SERVER_BENCH_URL : 'http://localhost:8080/v1' @@ -32,8 +32,8 @@ const data = new SharedArray('conversations', function () { .slice(0, n_prompt) }) -const llamacpp_prompt_tokens = new Gauge('llamacpp_prompt_tokens') -const llamacpp_completion_tokens = new Gauge('llamacpp_completion_tokens') +const llamacpp_prompt_tokens = new Trend('llamacpp_prompt_tokens') +const llamacpp_completion_tokens = new Trend('llamacpp_completion_tokens') const llamacpp_prompt_tokens_total_counter = new Counter('llamacpp_prompt_tokens_total_counter') const llamacpp_completion_tokens_total_counter = new Counter('llamacpp_completion_tokens_total_counter')