Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/k6-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: k6-op
description: k6 chart for k8s
version: 0.2.1
version: 0.2.2
appVersion: "1.16.0"
dependencies:
- name: k6-operator
Expand Down
1 change: 0 additions & 1 deletion charts/k6-operator/staging-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ k6-operator:
limits:
cpu: 1000m
memory: 1Gi

14 changes: 12 additions & 2 deletions charts/k6-operator/templates/k6-probe-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,18 @@ data:
value: http://graph-proxy.graph-proxy.svc.cluster.local:80/graphql
- name: GRAPH_WS_URL
value: ws://graph-proxy.graph-proxy.svc.cluster.local:80/graphql/ws
- name: OTEL_ENDPOINT
value: https://otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4318
- name: K6_OTEL_SERVICE_NAME
value: workflows-k6-synthetic-probe
- name: K6_OTEL_METRIC_PREFIX
value: k6_
- name: K6_OTEL_EXPORTER_PROTOCOL
value: grpc
- name: K6_OTEL_GRPC_EXPORTER_ENDPOINT
value: otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4317
- name: K6_OTEL_GRPC_EXPORTER_INSECURE
value: "true"
- name: K6_OTEL_EXPORT_INTERVAL
value: 5s
resources:
limits:
cpu: 1000m
Expand Down
17 changes: 15 additions & 2 deletions charts/k6-operator/templates/k6-testrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
namespace: {{ .Release.Namespace}}
spec:
parallelism: 4
arguments: "--out opentelemetry --tag probe=ping-graph --tag synthetic=true"
script:
configMap:
name: k6-configmap
Expand All @@ -29,10 +30,22 @@ spec:
{{- else if eq .Values.cluster "argus"}}
value: https://identity.diamond.ac.uk/realms/dls/protocol/openid-connect/token
{{- end}}
- name: OTEL_ENDPOINT
value: https://otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4318
- name: GRAPH_URL
value: http://graph-proxy.graph-proxy.svc.cluster.local:80/graphql
- name: K6_OTEL_SERVICE_NAME
value: k6
- name: K6_OTEL_METRIC_PREFIX
value: k6_
- name: K6_OTEL_FLUSH_INTERVAL
value: 1s
- name: K6_OTEL_EXPORTER_PROTOCOL
value: grpc
- name: K6_OTEL_GRPC_EXPORTER_ENDPOINT
value: otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4317
- name: K6_OTEL_GRPC_EXPORTER_INSECURE
value: "true"
- name: K6_OTEL_EXPORT_INTERVAL
value: 5s
resources:
limits:
cpu: 1000m
Expand Down
17 changes: 15 additions & 2 deletions charts/k6-operator/templates/k6-ws-subscription-testrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
namespace: {{ .Release.Namespace}}
spec:
parallelism: 1
arguments: "--out opentelemetry --tag probe=ws-subscription --tag synthetic=true"
script:
configMap:
name: k6-configmap
Expand All @@ -33,8 +34,20 @@ spec:
value: http://graph-proxy.graph-proxy.svc.cluster.local:80/graphql
- name: GRAPH_WS_URL
value: ws://graph-proxy.graph-proxy.svc.cluster.local:80/graphql/ws
- name: OTEL_ENDPOINT
value: https://otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4318
- name: K6_OTEL_SERVICE_NAME
value: k6
- name: K6_OTEL_METRIC_PREFIX
value: k6_
- name: K6_OTEL_FLUSH_INTERVAL
value: 1s
- name: K6_OTEL_EXPORTER_PROTOCOL
value: grpc
- name: K6_OTEL_GRPC_EXPORTER_ENDPOINT
value: otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4317
- name: K6_OTEL_GRPC_EXPORTER_INSECURE
value: "true"
- name: K6_OTEL_EXPORT_INTERVAL
value: 5s
resources:
limits:
cpu: 1000m
Expand Down
53 changes: 53 additions & 0 deletions charts/k6-operator/tests/spam-workflows.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import http from 'k6/http';
import { Options } from 'k6/options';

export { setup } from './common.ts';

const graphUrl = __ENV.GRAPH_URL

interface VisitInput {
proposalCode: string;
proposalNumber: number;
number: number;
}


const submitMutation = `mutation K6WsSubmit($templateName: String!, $visit: VisitInput!, $parameters: JSON!) { submitWorkflowTemplate(name: $templateName, visit: $visit, parameters: $parameters) { name } }`;

export const options: Options = {
vus: 1,
iterations: 10
}

export default function(data: { token: string }): void {
const visit: VisitInput = {
proposalCode: "ks",
proposalNumber: 10000,
number: 1
}
const templateName = "example-template"

console.log(`submitting workflow template=${templateName} visit=${JSON.stringify(visit)} graphUrl=${graphUrl}`);
http.post(
graphUrl,
JSON.stringify({
query: submitMutation,
variables: {
templateName,
visit,
},
}),
{
headers: {
Authorization: `Bearer ${data.token}`,
},
tags: {
endpoint: "graphql",
operation: "submit_workflow_template",
scenario: "graphql_ws_subscription",
},
},
);


}
4 changes: 4 additions & 0 deletions charts/k6-operator/tests/ws-subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import { check, fail } from 'k6';
import { Options } from 'k6/options';
import * as ws from 'k6/ws';
export { setup } from './common.ts';
import { Rate } from 'k6/metrics';

const graphUrl = __ENV.GRAPH_URL;
const graphWsUrl = __ENV.GRAPH_WS_URL;
const timeoutSeconds = 1800;

const probeSuccess = new Rate('synthetic_probe_success')

interface VisitInput {
proposalCode: string;
proposalNumber: number;
Expand Down Expand Up @@ -147,6 +150,7 @@ export default function(data: { token: string }): void {
nextCount += 1;
terminalStatus = frame.payload?.data?.workflow?.status?.__typename || null;
console.log(`websocket next count=${nextCount} terminalStatus=${terminalStatus}`);
probeSuccess.add(terminalStatus === 'WorkflowSucceededStatus', {probe: ws-subscription});
if (
terminalStatus === 'WorkflowSucceededStatus' ||
terminalStatus === 'WorkflowFailedStatus' ||
Expand Down
2 changes: 1 addition & 1 deletion charts/workflows-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: workflows-cluster
description: A virtual cluster for Data Analysis workflows
type: application

version: 0.13.4
version: 0.13.5
dependencies:
- name: common
version: 2.23.0
Expand Down
Loading