Global requests per second calculation

499 views
Skip to first unread message

Ak Aurélien

unread,
Nov 27, 2013, 12:20:22 PM11/27/13
to gat...@googlegroups.com
Hi !
I need to parse the simulation.log and calculate statistics myself (min, max, mean etc etc)
I don't manage to recalculate the Global requests per second for each request, like it's done in the "Response time against the Global requests per second" graph.
What is the algorithm used ?

Thanks.
Regards.

Stéphane Landelle

unread,
Nov 27, 2013, 12:22:22 PM11/27/13
to gat...@googlegroups.com
What do you mean by "don't manage"? You don't get the same numbers, or you don't know how to proceed?


2013/11/27 Ak Aurélien <a...@kempiak.fr>

--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Stéphane Landelle

unread,
Nov 27, 2013, 12:26:45 PM11/27/13
to gat...@googlegroups.com
Basically, you get two time series, one for the response time and one for the number of requests per sec, and you then match them.


2013/11/27 Stéphane Landelle <slan...@excilys.com>

Ak Aurélien

unread,
Nov 27, 2013, 4:09:53 PM11/27/13
to gat...@googlegroups.com
Sorry, I replied to you directly by mail, not in this discussion, I'm new with Google groups usage :p

Stéphane Landelle

unread,
Nov 27, 2013, 4:12:34 PM11/27/13
to gat...@googlegroups.com
Times are rounded up in order not to display too many dots in the graph.


2013/11/27 Ak Aurélien <a...@kempiak.fr>
Sorry, I replied to you directly by mail, not in this discussion, I'm new with Google groups usage :p

--

Ak Aurélien

unread,
Nov 28, 2013, 8:49:00 AM11/28/13
to gat...@googlegroups.com
Désolé, je vais parler en français, ça ira plus vite :)
Ce que je n'arrive pas à faire, c'est trouver la formule mathématique, le bout de code qui, en parsant simulation.log, permet de calculer le hits per sec Global par requête. Avec un exemple ça ira mieux, voici 2 exemples de vaines tentatives (ce ne sont que deux exemples, j'en ai essayé d'autres avec le timestamp de fin de réponse) c'est en Python :

secavant = 0
secapres = 0

###tab2 est un tableau de tableaux contenant [timestamp_debut_requete,timestamp_fin_reponse,responsetime] de chaque requête.
###pour 3 requêtes ça donnerait ça => [[1385646024422, 1385646024553, 131], [1385646024417, 1385646024556, 139], [1385646024428, 1385646024556, 128]]

###test calcul 1
###je prends toutes les requêtes qui commencent 500ms avant ou après le timestamp de début de chaque requête pour calculer les hits/s global pour chacune d'elles
for x in tab2:
       for i in tab2:
               secavant = i[0] - 500
               secapres = i[0] + 500
               if secavant <= x[0] <= secapres:
                       hits+=1
       x.append(hits)
       hits=0

###test calcul 2
###je prends toutes les requêtes qui commencent 1 seconde avant le timestamp de début de chaque requête pour calculer les hits/s global pour chacune d'elles
for x in tab2:
       secavant = x[0] - 1000
       for i in tab2:
               if secavant <= i[0] <= x[0]:
                       hits+=1
       x.append(hits)
       hits=0

### tab2 contient maintenant [timestamp_debut_requete,timestamp_fin_reponse,responsetime,hits_per_sec_global] de chaque requête.
###pour 3 requêtes ça donnerait ça => [[1385646024422, 1385646024553, 131,5], [1385646024417, 1385646024556, 139,10], [1385646024428, 1385646024556, 128,5]]

Stéphane Landelle

unread,
Nov 28, 2013, 12:02:21 PM11/28/13
to gat...@googlegroups.com
As I said, we use buckets in order to limit the number of dots in the chart, so you don't get one dot per sec like you do.
You can have a look here (but good lick with that):


--
Reply all
Reply to author
Forward
0 new messages