Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How does responses works? #9

Open
gen4sp opened this issue Feb 7, 2014 · 7 comments
Open

Question: How does responses works? #9

gen4sp opened this issue Feb 7, 2014 · 7 comments

Comments

@gen4sp
Copy link

gen4sp commented Feb 7, 2014

i have workflow: several queries one by one. Once i got responce from 1st query, i want fire next one.
So i try to play with "response" section and with no success (

so my 1st request:

{
"command":"auth",
"udid":"${udid}"
}

and i got response:

{"response":"auth","data":{"player":{"__v":0,"nick":"Player_58423","_id":"52f4a76a7f83343908e93a30","invites_sent":[],"invites_recived":[],"blackList":[],"friends":[],"games":[],"play_units":10,"rating":1000,"date_created":"2014-02-07T09:29:14.577Z","lang":"ru","udid":["pseudo_udid_489405"]},"is_new":true}}
  1. How does pattern looks?
    so i expect, the pattern i looking for is "auth" - should works great, right?
  2. how response section (i read the documentation, but still dont get it)
    what i should to do - place this pattern to 1st sampler, or 2nd, or maybe both?
  3. now i waiting trigger from server, which came after random time, like this
{"response":"opponentFound",
"_id":"XXXX"}

and i going to answer him "ok, i take this opponent"
how? Should i create 3th sampler with big response-timeout and place "opponentFound" in response-section, and then create 4th sampler with answer-request, right?

@fshutdown
Copy link
Owner

You are right your approach should work

  1. Response pattern is a regular expression but in you case you could just use this:
"response":"auth"
  1. This is sequantial workflow so the same sampler which sends a authenticationrequest should capture a auth response
  2. Take opponent would be a second sampler; you can set a long response timeout and let the sampler wait for a server response. The response pattern could look like this
"response":"opponentFound"

...and 3rd sampler will respond to opponentFound.

And thanks for sharing your problems, I will keep this in mind when developing the plugin further.

@gen4sp
Copy link
Author

gen4sp commented Feb 7, 2014

Great, thank you for your (quite fast!) answer!

@gen4sp
Copy link
Author

gen4sp commented Feb 7, 2014

Response doesnt work for me (
1st sampler: http://take.ms/JCROS
answer - http://take.ms/1K3Lb
finding works fine, but sampler wait whole response time before fire next sampler, does not fire immediately on response as i expect.

@fshutdown
Copy link
Owner

Have a look at the View Results Tree -> Sampler Result there should be a detaild breakdown of all actions and how long did it take for the response to arrive.

@gen4sp
Copy link
Author

gen4sp commented Feb 7, 2014

response from the server come immediately, but sampler took all 5sec (or more, depends on response-timeout-section)
looks like it doesn't recognise the pattern.

Now i have one more strange behavior! If i have some samplers, and set in 1st response-pattern this:

"response"

and leave other blank (!), all samplers fired immediately as recived a response from server.

Whats going on?)

@gen4sp
Copy link
Author

gen4sp commented Feb 7, 2014

same behaviour when i leave first sampler blank

@fshutdown
Copy link
Owner

Could be something to do with regular expression processing. Maybe escaping special characters with \ would help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants