Skip to content
Snippets Groups Projects
Commit 11406a37 authored by ms.evilhat's avatar ms.evilhat
Browse files

feat: add host arg to k6 script and set default value to localhost

parent f95a15cc
No related branches found
No related tags found
1 merge request!1414sbroad import
import tarantool from "k6/x/tarantool";
import { updateSuccessRate } from '../metrics.js';
let host = "localhost";
if (__ENV.HOST) {
host = __ENV.HOST;
}
const clients = [
tarantool.connect(["localhost:3301"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect([host + ":3301"], {"user": "admin", pass: "app-cluster-cookie"}),
]
const pattern = `SELECT "a0"+"a1"+"a2", "a1", "a1"+"a2", "a3", "a4", "a5" + "a1", "a1"+"a6", "a7"*"a9", "a8", "a9"
const pattern = `SELECT "a0"+"a1"+"a2", "a1", "a1"+"a2", "a3", "a4", "a5" + "a1", "a1"+"a6", "a7"*"a9", "a8", "a9"
FROM "t"
GROUP BY "a1", "a3", "a4", "a0"+"a1"+"a2", "a5" + "a1", "a1"+"a2", "a8", "a9", "a1"+"a6", "a7"*"a9"
`
......
......@@ -2,11 +2,16 @@ import tarantool from "k6/x/tarantool";
import {uuidv4} from 'https://jslib.k6.io/k6-utils/1.1.0/index.js';
import { updateSuccessRate } from '../metrics.js';
let host = "localhost";
if (__ENV.HOST) {
host = __ENV.HOST;
}
const clients = [
tarantool.connect(["localhost:3301"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect(["localhost:3306"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect(["localhost:3307"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect(["localhost:3308"], {"user": "admin", pass: "app-cluster-cookie"})
tarantool.connect([host + ":3301"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect([host + ":3306"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect([host + ":3307"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect([host + ":3308"], {"user": "admin", pass: "app-cluster-cookie"})
]
export let current_server = 0
......
......@@ -2,7 +2,12 @@ import tarantool from "k6/x/tarantool";
import {randomItem} from 'https://jslib.k6.io/k6-utils/1.1.0/index.js';
import { updateSuccessRate } from '../metrics.js';
const client = tarantool.connect(["localhost:3301"], {"user": "admin", pass: "app-cluster-cookie"})
let host = "localhost";
if (__ENV.HOST) {
host = __ENV.HOST;
}
const client = tarantool.connect([host + ":3301"], {"user": "admin", pass: "app-cluster-cookie"})
let ids = Array.from(
{
......@@ -26,4 +31,4 @@ let pattern = `SELECT *
export default () => {
var resp = tarantool.call(client, "sbroad.execute", [pattern, [randomItem(ids)]]);
updateSuccessRate(resp);
}
\ No newline at end of file
}
......@@ -2,11 +2,16 @@ import tarantool from "k6/x/tarantool";
import {randomItem} from 'https://jslib.k6.io/k6-utils/1.1.0/index.js';
import { updateSuccessRate } from '../metrics.js';
let host = "localhost";
if (__ENV.HOST) {
host = __ENV.HOST;
}
const clients = [
tarantool.connect(["localhost:3301"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect(["localhost:3306"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect(["localhost:3307"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect(["localhost:3308"], {"user": "admin", pass: "app-cluster-cookie"})
tarantool.connect([host + ":3301"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect([host + ":3306"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect([host + ":3307"], {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect([host + ":3308"], {"user": "admin", pass: "app-cluster-cookie"})
]
export let current_server = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment