by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    ChappieG
    @ChappieG

    Hello,

    I am after some advice on measuring latency on a chain of requests.

    Our system will upload a json payload to an S3 bucket, this will trigger an AWS event to invoke a Lambda and start up a state machine. The first Lambda will get the contents of the json from the S3 and then send it off to an API and wait for a response.

    My test has been to upload a json file to the S3 bucket in a beforeScenario and then invoke the first lambda function using a plugin for Artillery. However, my tests only seem to return the response from the lambda and I seem to get the latency percentiles back from the lambda but not the API it fires off. Is there a way to measure the Lambda API calls after invoking the lambda function?

    Many Thanks

    tarun0909
    @tarun0909
    Hello, Is there any way I can automate generation of OAuth 2.0 token via javascript code and use it in the artillery scripts.
    dhiraj
    @dhirajshinde121083

    Hello every one i am new to artillery just struggling with some issue, maybe simple but not able to fix after spending hours on this following is code i dont see any message is emitted from loop written in artillery yaml file -------------server.js-----------------------------
    var io = require('socket.io')(3000);
    io.on('connection', function (socket) {
    socket.on('chat', function (data) {
    console.log(data);
    });
    });
    ------------artillery yml file ---------------------
    config:
    target: 'http://abcxyz.com:3000'
    phases:

    - duration: 10
      arrivalCount: 2

    payload:
    path: "./final_vehicle2.csv"
    fields:

              - "vehicle"
              - "id"
      order: "sequence"

    processor: "./random.js"
    scenarios:

    • engine: socketio
      flow:
      • function: "setMsg"
      • loop:
        • emit:
          channel: 'chat'
          data: " {{ vehicle }} have {{ id }} look {{ $loopCount }}"
          over: resultsss
          -------------------processor---------------------------------------
          'use strict';
          const pg = require('pg');
          var pool = new pg.Pool({ user:'postgres',database:'postgres',password:'xxxx',port: 5432});

    module.exports = { setMsg : setMsg };
    function setMsg(context,ee,done){
    var allPos = [];
    pool.connect((err,client,done)=>{
    if(err){
    console.log(err);
    }
    else{
    var vehicle_id = context.vars.id;
    pool.query("select latitude,longitude,datetime,speed from tracklog_history where vehicle_id="+ vehicle_id + " limit 500" ).then(res => {
    res.rows.forEach(function(item){
    let eachPos = { 'latitude' : item.latitude ,'longitude' : item.latitude ,'datetime' : item.latitude ,'speed' : item.latitude };
    allPos.push(eachPos);
    });
    context.vars['resultsss'] = [...allPos];
    return done();
    });
    }
    });
    return done();
    }
    --------------------final_vehicle2.csv file---------------------------------------------------
    MH01CV1213,380
    MH01CV1214,270

    dhiraj
    @dhirajshinde121083
    how do i set context.var.results as an array of elements in my processor and pass it to artillery yaml file to loop over
    dhiraj
    @dhirajshinde121083
    @whitehorse0

    @whitehorse0 hi maybe you can help me to get rid of this issue i am having as i have seen same issue resolved earlier by you in above case ------------server.js-----------------------------
    var io = require('socket.io')(3000);
    io.on('connection', function (socket) {
    socket.on('chat', function (data) {
    console.log(data);
    });
    });
    ------------artillery yml file ---------------------
    config:
    target: 'http://abcxyz.com:3000'
    phases:

    • duration: 10
      arrivalCount: 2

    payload:
    path: "./final_vehicle2.csv"
    fields:

          - "vehicle"
          - "id"

    order: "sequence"

    processor: "./random.js"
    scenarios:

    engine: socketio
    flow:
        function: "setMsg"
        loop:
            emit:
            channel: 'chat'
            data: " {{ vehicle }} have {{ id }} look {{ $loopCount }}"
            over: resultsss
            -------------------processor---------------------------------------
            'use strict';
            const pg = require('pg');
            var pool = new pg.Pool({ user:'postgres',database:'postgres',password:'xxxx',port: 5432});

    module.exports = { setMsg : setMsg };
    function setMsg(context,ee,done){
    var allPos = [];
    pool.connect((err,client,done)=>{
    if(err){
    console.log(err);
    }
    else{
    var vehicle_id = context.vars.id;
    pool.query("select latitude,longitude,datetime,speed from tracklog_history where vehicle_id="+ vehicle_id + " limit 500" ).then(res => {
    res.rows.forEach(function(item){
    let eachPos = { 'latitude' : item.latitude ,'longitude' : item.latitude ,'datetime' : item.latitude ,'speed' : item.latitude };
    allPos.push(eachPos);
    });
    context.vars['resultsss'] = [...allPos];
    return done();
    });
    }
    });
    return done();
    }
    --------------------final_vehicle2.csv file---------------------------------------------------
    MH01CV1213,380
    MH01CV1214,270

    eka-putra
    @whitehorse0

    @dhirajshinde121083
    Similarly, a scenario definition can have a beforeScenario/afterScenario attribute, which will make the functions specified run for every request in the scenario. The function signature is the same as for function hooks https://artillery.io/docs/http-reference/#function-steps-in-a-flow

    And for this case, have you tried "beforeRequest:" hooks, to tells Artillery to run the setMsg function before the request is made ???

    Hasitha_Waruna
    @hasithawaruna
    Hi all,
    Is there a way to attach a JPG/PNG file to request body payload? I need to attach a jpg file to the below 'photo' parameter. without this param, I couldn't get any valid response. Please suggest if there is any proper way to do this. Thank you.
    EX:
    scenarios:
    flow:
    post: url: "/users/uploadPhoto" json: token: "sampleEmail" password: "samplePassword photo: "Sample JPG file"
    manoj nn
    @nnmanu_twitter
    If there is a loop for one api out of many inside scenario and flow then not reading the data serially from the csv file.It stops after reading first value.Can someone give me the solution for the same
    ChappieG
    @ChappieG
    I am involving a Lambda function using Artillery - I was hoping from the Invoke I could obtain the json response to use in a further request. Is this possible on an invoke? My example below doesn't capture anything, the expects plugin also doesn't work even though I get response codes. I am using the "artillery-engine-lambda" plugin to invoke but it doesn't
    mention anything about capturing responses. My config is set in a separate file.
    scenarios:
      - name: "Invoke Request"
        engine: "lambda"
        flow:
          - invoke:
              invocationType: "RequestResponse"
              payload:
                json:
                  s3Ref: "{{ s3Ref }}"
                  urn: "{{ urn }}"
                  key: "{{ key }}"
              logType: "Tail"
              capture:
                json: "$.data"
                as: "data"
              expect:
                - statusCode: 200
    michyliao
    @michyliao_twitter
    hi all, for ws engine, is there a way to receive since in my scenarios - it depends on a value that is given back during the workflow? TIA
    michyliao
    @michyliao_twitter
    or is there a way to fail a ws scenario if the data that was sent is wrong?
    ChappieG
    @ChappieG
    Hello, Is it possible to upload a file to s3 using the file upload plugin
    Lillypot
    @Lillypot

    Hi -- Can you help me get the url within the setJSONBody please -- I have tried below authentication but this code seems to pickup my second target details such as the Api Key. how do I get the url recognised as part of the json post?

    function setJSONBody(requestParams, context, ee, next) {
    requestParams.uri = 'https://joobo.co.com/taccess/v1/authenticate';
    requestParams.json = {
    userName: 'Catt',
    password: 'frustrated'
    }
    return next()
    }
    function getToken (requestParams, response, context, ee, next) {
    // This extracts the token
    console.log(response body : ${JSON.stringify(response.body)})
    var token = response.body['id-token'];
    context.vars['authToken'] = token;
    console.log('authToken:', token);
    return next()
    }

    michyliao
    @michyliao_twitter
    has anyone worked with authenticated ws? not sure how to do this since there is no response options
    michyliao
    @michyliao_twitter

    has anyone worked with authenticated ws? not sure how to do this since there is no response options

    \ how does one keep 1 ws request for the vu to go through the scenario instead of opening up separate requests for each flow

    eka-putra
    @whitehorse0

    repost

    🔊🔊🔊 FYI for all those who might have come across this channel recently -- Artillery's Gitter channel has been retired. Please join the Artillery community on Spectrum - https://spectrum.chat/artillery-io
    Lillypot
    @Lillypot
    @anupash Hi did you manage to resolve your onetime authentication and if so how... I have the same problem and I don't know how to do one time auth.
    1 reply
    DBiles
    @DBiles
    Using this as a starter for some loading testing and continuing to get this error Plugin aws-sigv4 specified but module artillery-plugin-aws-sigv4 could not be found (MODULE_NOT_FOUND)
    {
        "config": {
            "plugins": {
                "aws-sigv4": {
                    "serviceName": "execute-api"
                }
            },
            "target": "some-site.com",
            "phases": [{
                "duration": 120,
                "arrivalRate": 5
            }],
            "defaults": {
                "headers": {
                    "Content-Type": "application/json"
                }
            }
        },
        "scenarios":[{
            "flow": [{
                "get": {
                    "url": "/"
                }
            }]
        }]
    }
    Can any shed some light
    Malys
    @malys
    Hi, is it possible to define an artillery script to detect performance limit on a api ? ( any example?)
    sreedevi-1991
    @sreedevi-1991
    how to do CI integration with artillery .Please provide steps.
    how to know where the request is breaking from latency graph?
    If we have third party url also in request then where can we specify that url apart from target attribute? multiple server names
    Philippe Sabourin
    @pip8786
    Is there a way to wait for a message before proceeding to the next part of the scenario for socket.io testing?
    umakalyani17
    @umakalyani17

    how to capture HTML response in artillery Ex: my webpage response looks like this <html>

    <script type="text/javascript">
    // Popup window code
    function newPopup(url, type) {
    var betType ;
    var strUser ;

    }
    </script>

    <body>

    Success Response :::T71tqex6sffrq5k
    umakalyani17
    @umakalyani17
    how to capture success response from this
    umakalyani17
    @umakalyani17
    i have mixture of HTTP and web sockets.
    Application have token based authentication web socket my target is like below, here i have two issues
    1..if i give as below HTTP calls are not working properly 2.unexpected sever respone error is thrown
    umakalyani17
    @umakalyani17
    Can we use HTTP and WS in the same file ?
    umakalyani17
    @umakalyani17
    just starting to explore artillery. Is there a way to mix http requests and web sockets?
    skamineni
    @skamineni
    how can I capture xml response ?
    𝖌𝖆𝖗𝖇𝖆𝖌𝖊 𝖊𝖑𝖊𝖒𝖊𝖓𝖙𝖆𝖑
    @catkinscript_twitter
    Screen Shot 2020-03-31 at 12.14.48 PM.png
    Anyone know if it's normal to see null values in metrics between phases?
    Som Shankar Bhattacharyya
    @bhattacharyyasom
    I need a help guys. Is there a way to use a environment variable as a http header for a scneario. Basically something like this , defaults:
    headers:
    accept: 'text/html'
    accept-language: 'en-US,en;q=0.8'
    accept-encoding: 'gzip, deflate'
    user-agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'
    "{{ $processEnvironment.PERF_TEST_HEADER }}": 'Orockz!'
    Max Coplan
    @vegerot
    Is there a way to make the payload update on each loop that requests the payload instead of for each virtual user?
    Max Coplan
    @vegerot
    Is this Gitter dead? Looks like there are only people asking questions. I don't see any responses here lol
    mindnervestech
    @mindnervestech
    how do get data row wise from csv file in artillery
    th3impal3r
    @th3impal3r
    hello
    I am having issues with getting ifTrue to work as expected
        ifTrue: not "{{ $environment }}" == "localdev"
    or
        ifTrue: not $environment == "localdev"
    i have tried every variation i can think of but can't seem to get this ifTrue to work for anything other than localdev. or make it skip if env = localdev
    2nd question: i randomly see my scenario run twice in parallel (arrival and duration both set to 1). it happens randomly and causes issues. i am expect the flow to run once and only once. is there something i am missing
    dee
    @dayafigueroa
    im looking to to call a function js function and pass parameters that i've captured on the payload section from a csv file, is that doable?
    dee
    @dayafigueroa
    Nevermind...i found the answer
    sahiljaidka224
    @sahiljaidka224
    Hi,
    How do I test graphql queries written in c#
    using yml
    SriDivya52
    @SriDivya52
    How can i post the XML request in the artlillery
    1 reply
    Dhirendra
    @Dhirendra24
    Is there a way to specify different phases to scenarios in a single file ?
    1 reply