Replies: 1 comment
-
hi @astavria4 👋 there's a couple of ways: you can generate mission ids on the fly, or load them from a CSV file. To generate them on the fly, use a https://artillery.io/docs/guides/guides/http-reference.html#Writing-custom-logic-in-Javascript There's an example here you can adapt: And to use a CSV file: https://artillery.io/docs/guides/guides/test-script-reference.html#Payload-Files And here's an example for using CSVs: https://github.com/artilleryio/artillery-examples/tree/main/using-data-from-csv |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using EasyGraphQL load tester in conjunction with Artillery to load test my graphql server. Im in the POC stage so I am going against the space x open source graphql server.
this is my index.js file:
'use strict'
const EasyGraphQLLoadTester = require('easygraphql-load-tester')
var fs = require('fs')
var path = require('path')
var schema = fs.readFileSync(path.join(__dirname, 'test', 'missionSchema.graphql'), 'utf8')
const args = {
mission: {
id: '9D1B7E0'
}
}
var loadTester = new EasyGraphQLLoadTester(schema, args)
const options = {
selectedQueries: ['mission'],
}
var testCases = loadTester.artillery(options)
module.exports = {
testCases
}
This is my config file:
config:
target: "http://localhost:8080/v1/graphql"
phases:
- duration: 5
arrivalRate: 1
processor: "./index.js"
scenarios:
- name: "GraphQL Query load test"
flow:
- function: "testCases"
- loop:
- post:
url: "/"
json:
query: '{{ $loopElement.query }}'
variables: '{{ $loopElement.variables }}'
- log: "----------------------------------"
- log: "Sent a request to the Query: {{ $loopElement.name }}"
- log: 'And variables {{ $loopElement.variables }}'
over: cases
Is it possible to set up Artillery to have each virtual user created to use a different misionId that is from a list of missionIds?
For example, I have this as my custom arg:
const args = {
mission: {
id: '9D1B7E0'
}
}
Its passing in a hardcoded value as the id and each virtual user created uses this id. If I were to add another mission query to the args with an id of lets say 4. When running the tests, only 4 will be passed for each virtual user. Not 9D1B7E0 and 4.
Beta Was this translation helpful? Give feedback.
All reactions