|
1 |
| -import {check} from "k6"; |
| 1 | +import { check } from "k6"; |
2 | 2 | import http from "k6/http";
|
3 |
| -import {newSummaryHandler} from "../common.js"; |
| 3 | +import { newSummaryHandler } from "../common.js"; |
4 | 4 |
|
5 | 5 | const testid = "select-where";
|
6 | 6 | const agentSocket = __ENV.AGENT_SOCKET || "localhost:8100";
|
7 | 7 | const url = `http://${agentSocket}/query`;
|
8 | 8 | const data = {
|
9 |
| - collection : "Album", |
10 |
| - query : { |
11 |
| - fields : { |
12 |
| - id : {type : "column", column : "AlbumId", arguments : {}}, |
13 |
| - title : {type : "column", column : "Title", arguments : {}}, |
14 |
| - artist_id : {type : "column", column : "ArtistId", arguments : {}}, |
| 9 | + collection: "Album", |
| 10 | + query: { |
| 11 | + fields: { |
| 12 | + id: { type: "column", column: "AlbumId", arguments: {} }, |
| 13 | + title: { type: "column", column: "Title", arguments: {} }, |
| 14 | + artist_id: { type: "column", column: "ArtistId", arguments: {} }, |
15 | 15 | },
|
16 |
| - where : { |
17 |
| - type : "binary_comparison_operator", |
18 |
| - column : { |
19 |
| - type : "column", |
20 |
| - name : "Title", |
21 |
| - path : [], |
| 16 | + where: { |
| 17 | + type: "binary_comparison_operator", |
| 18 | + column: { |
| 19 | + type: "column", |
| 20 | + name: "Title", |
| 21 | + path: [], |
22 | 22 | },
|
23 |
| - operator : { |
24 |
| - type : "other", |
25 |
| - name : "_ilike", |
| 23 | + operator: { |
| 24 | + type: "other", |
| 25 | + name: "_ilike", |
26 | 26 | },
|
27 |
| - value : { |
28 |
| - type : "scalar", |
29 |
| - value : "%a%", |
| 27 | + value: { |
| 28 | + type: "scalar", |
| 29 | + value: "%a%", |
30 | 30 | },
|
31 | 31 | },
|
32 | 32 | },
|
33 |
| - arguments : {}, |
34 |
| - collection_relationships : {}, |
| 33 | + arguments: {}, |
| 34 | + collection_relationships: {}, |
35 | 35 | };
|
36 | 36 |
|
37 |
| -export default function() { |
| 37 | +export default function () { |
38 | 38 | const response = http.post(url, JSON.stringify(data), {
|
39 |
| - headers : { |
40 |
| - "Content-Type" : "application/json", |
| 39 | + headers: { |
| 40 | + "Content-Type": "application/json", |
41 | 41 | },
|
42 | 42 | });
|
43 | 43 |
|
44 | 44 | check(response, {
|
45 |
| - "status is 200" : (r) => r.status == 200, |
| 45 | + "status is 200": (r) => r.status == 200, |
46 | 46 | });
|
47 | 47 | }
|
48 | 48 |
|
49 | 49 | export const handleSummary = newSummaryHandler(testid);
|
50 | 50 |
|
51 | 51 | export const options = {
|
52 |
| - tags : { |
| 52 | + tags: { |
53 | 53 | testid,
|
54 | 54 | },
|
55 |
| - scenarios : { |
56 |
| - short_sustained : { |
57 |
| - executor : "constant-vus", |
58 |
| - vus : 100, |
59 |
| - duration : "10s", |
| 55 | + scenarios: { |
| 56 | + short_sustained: { |
| 57 | + executor: "constant-vus", |
| 58 | + vus: 100, |
| 59 | + duration: "10s", |
60 | 60 | },
|
61 | 61 | },
|
62 |
| - thresholds : { |
63 |
| - "checks" : [ |
| 62 | + thresholds: { |
| 63 | + checks: [ |
64 | 64 | {
|
65 |
| - threshold : "rate == 1", |
66 |
| - abortOnFail : true, |
| 65 | + threshold: "rate == 1", |
| 66 | + abortOnFail: true, |
67 | 67 | },
|
68 | 68 | ],
|
69 | 69 | },
|
|
0 commit comments