python - Using Jmeter OS Process Sampler to collect script data -


is possible collect output of python script using "os process sampler"?

my python script database query , returns "r1=123 r2=456 r3=789" there way collect r1, r2, r3 values , graph them?

you can use regular expression extractor values os process sampler follows:

  1. add regular expression extractor child of os process sampler
  2. configure follows:

    • reference name: variable name of choice, i.e. r
    • regular expression: r1=(\d+) r2=(\d+) r3=(\d+)
    • template: $1$$2$$3$

it result in following variables:

r=123456789 r_g=3 r_g0=r1=123 r2=456 r3=789 r_g1=123 r_g2=456 r_g3=789 

you can "tell" jmeter store these values .jtl results file adding following line user.properties file (it located in /bin folder of jmeter installation)

sample_variables=r_g1,r_g2,r_g3 

variables stored in .jtl file along other test result information like

1434196234292,251,os process sampler,0,ok,thread group 1-1,text,true,21,1,1,0,123,456,789 

(scroll right of line values may hidden)

see apache jmeter properties customization guide learn more jmeter properties , ways of setting/overriding them.

once store results should able graph values can use microsoft excel, libre office or equivalent.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -