how to report the custom statistics data to ngrinder from the non worker thread

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to report the custom statistics data to ngrinder from the non worker thread

randall
Currently i am using ngrinder to perform test on application which is based on websocket connection. In my script i have a websocket client to send message, and the client have a onMessage method to receive the reponse asynchronize in another thread. i calc the latency from the message send to message receive in the websocket client and want to send it to ngrinder using follow statement:

grinder.statistics.registerSummaryExpression('Publish time delay', 'userLong0')
grinder.statstics.forCurrentTest.setLong('userLong0', 1234)

There is exception "Statistics interface is only supported for worker threads." throw out from ScriptStatisticsImplementation, because the thread to set statistics is not a worker thread and cannot get the threadcontext, is there any solution to fix this?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: how to report the custom statistics data to ngrinder from the non worker thread

randall
Grinder script gallery mention that all customized statistics should send from the worker thread. so they have sample to use queue to handle the async data.

refer to below:
http://grinder.sourceforge.net/g3/script-gallery.html