Quantcast
Channel: Grafana k6 - Grafana Labs Community Forums
Viewing all articles
Browse latest Browse all 329

Reading data from a shared Array

$
0
0

Hi,

I have one json file in the below format,

{
              "Product1" : [
                               {"model":"xxx","mof":yy},
                                {"model":"xxx", "mof":zz}
                               ]
              "Product2":[
                            {"model":"xxx","mof":yy},
                            {"model":"xxx", "mof":zz}
                        ]

}

In the K6 script, I am using SharedArray to read the above json file.

const data = new SharedArray('products', function(){
return JSON.parse(open('data.json'));
});

Query 1 : I was able to access Product1 details. How can I access Product2 details?

Query 2 : Is there any way to group user actions in the k6 browser script so that we will get browser_req_duration for each transaction ( for e.g. duration for submitting a form , searching for an item etc…) ? I have tried performance.mark method. Is there any other alternative?

Thanks

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 329

Trending Articles