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:
- add regular expression extractor child of os process sampler
configure follows:
- reference name: variable name of choice, i.e.
r
- regular expression:
r1=(\d+) r2=(\d+) r3=(\d+)
- template:
$1$$2$$3$
- reference name: variable name of choice, i.e.
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
Post a Comment