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

feat: output wrk results to a csv #6

Merged
merged 1 commit into from
Apr 12, 2017
Merged

Conversation

joyeecheung
Copy link
Contributor

@joyeecheung joyeecheung commented Apr 12, 2017

Using the scripting feature of wrk, write the output to stats.csv for further processing (e.g. plotting).

Example output:

name,latency_min,latency_max,latency_mean,latency_stdev,duration,requests,bytes,req_per_sec,byte_per_sec
"koa hello",165.00,63084.00,2743.13,1576.05,10102308,180171,28467018,17834.64,2817872.71
"toa hello",168.00,64731.00,2911.40,2722.47,10103856,193770,34297290,19177.83,3394475.34
"egg hello",350.00,79461.00,4315.68,2272.80,10009102,113815,40062885,11371.15,4002645.29
"egg hello (Async Await)",259.00,31136.00,4018.37,1466.82,10100621,120584,42445568,11938.28,4202273.11
"koa view",168.00,105806.00,4354.07,3645.24,10101945,118982,311851822,11778.13,30870473.16
"toa view",268.00,91469.00,4875.81,4120.25,10014497,112771,297715440,11260.78,29728446.67
"egg nunjucks view",505.00,140960.00,7712.66,5459.70,10023077,66291,187206013,6613.84,18677499.24
"egg ejs view",342.00,64918.00,6455.52,3241.16,10102688,76587,217890072,7580.85,21567534.50
"egg nunjucks view (Async Await)",795.00,49536.00,7074.10,3623.01,10014379,70171,198584087,7007.02,19829895.29
"egg ejs view (Async Await)",408.00,35333.00,6497.54,2952.90,10023491,75555,215407364,7537.79,21490253.65
"egg passport",581.00,73491.00,4329.88,2349.59,10009915,113975,39891254,11386.21,3985174.10
"egg passport (Async Await)",268.00,55971.00,4076.90,1674.84,10101572,119299,42231846,11809.94,4180720.19

Using csv as the output format because it doesn't require additional encoding in a lua script. This can be easily converted to a JSON format too, e.g.

JSON example
[
  {
    "name": "koa hello",
    "latency_min": 165,
    "latency_max": 63084,
    "latency_mean": 2743.13,
    "latency_stdev": 1576.05,
    "duration": 10102308,
    "requests": 180171,
    "bytes": 28467018,
    "req_per_sec": 17834.64,
    "byte_per_sec": 2817872.71
  },
  {
    "name": "toa hello",
    "latency_min": 168,
    "latency_max": 64731,
    "latency_mean": 2911.4,
    "latency_stdev": 2722.47,
    "duration": 10103856,
    "requests": 193770,
    "bytes": 34297290,
    "req_per_sec": 19177.83,
    "byte_per_sec": 3394475.34
  },
  {
    "name": "egg hello",
    "latency_min": 350,
    "latency_max": 79461,
    "latency_mean": 4315.68,
    "latency_stdev": 2272.8,
    "duration": 10009102,
    "requests": 113815,
    "bytes": 40062885,
    "req_per_sec": 11371.15,
    "byte_per_sec": 4002645.29
  },
  {
    "name": "egg hello (Async Await)",
    "latency_min": 259,
    "latency_max": 31136,
    "latency_mean": 4018.37,
    "latency_stdev": 1466.82,
    "duration": 10100621,
    "requests": 120584,
    "bytes": 42445568,
    "req_per_sec": 11938.28,
    "byte_per_sec": 4202273.11
  },
  {
    "name": "koa view",
    "latency_min": 168,
    "latency_max": 105806,
    "latency_mean": 4354.07,
    "latency_stdev": 3645.24,
    "duration": 10101945,
    "requests": 118982,
    "bytes": 311851822,
    "req_per_sec": 11778.13,
    "byte_per_sec": 30870473.16
  },
  {
    "name": "toa view",
    "latency_min": 268,
    "latency_max": 91469,
    "latency_mean": 4875.81,
    "latency_stdev": 4120.25,
    "duration": 10014497,
    "requests": 112771,
    "bytes": 297715440,
    "req_per_sec": 11260.78,
    "byte_per_sec": 29728446.67
  },
  {
    "name": "egg nunjucks view",
    "latency_min": 505,
    "latency_max": 140960,
    "latency_mean": 7712.66,
    "latency_stdev": 5459.7,
    "duration": 10023077,
    "requests": 66291,
    "bytes": 187206013,
    "req_per_sec": 6613.84,
    "byte_per_sec": 18677499.24
  },
  {
    "name": "egg ejs view",
    "latency_min": 342,
    "latency_max": 64918,
    "latency_mean": 6455.52,
    "latency_stdev": 3241.16,
    "duration": 10102688,
    "requests": 76587,
    "bytes": 217890072,
    "req_per_sec": 7580.85,
    "byte_per_sec": 21567534.5
  },
  {
    "name": "egg nunjucks view (Async Await)",
    "latency_min": 795,
    "latency_max": 49536,
    "latency_mean": 7074.1,
    "latency_stdev": 3623.01,
    "duration": 10014379,
    "requests": 70171,
    "bytes": 198584087,
    "req_per_sec": 7007.02,
    "byte_per_sec": 19829895.29
  },
  {
    "name": "egg ejs view (Async Await)",
    "latency_min": 408,
    "latency_max": 35333,
    "latency_mean": 6497.54,
    "latency_stdev": 2952.9,
    "duration": 10023491,
    "requests": 75555,
    "bytes": 215407364,
    "req_per_sec": 7537.79,
    "byte_per_sec": 21490253.65
  },
  {
    "name": "egg passport",
    "latency_min": 581,
    "latency_max": 73491,
    "latency_mean": 4329.88,
    "latency_stdev": 2349.59,
    "duration": 10009915,
    "requests": 113975,
    "bytes": 39891254,
    "req_per_sec": 11386.21,
    "byte_per_sec": 3985174.1
  },
  {
    "name": "egg passport (Async Await)",
    "latency_min": 268,
    "latency_max": 55971,
    "latency_mean": 4076.9,
    "latency_stdev": 1674.84,
    "duration": 10101572,
    "requests": 119299,
    "bytes": 42231846,
    "req_per_sec": 11809.94,
    "byte_per_sec": 4180720.19
  }
]

@mention-bot
Copy link

@joyeecheung, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fengmk2 and @popomore to be potential reviewers.

@fengmk2 fengmk2 merged commit 63d315a into eggjs:master Apr 12, 2017
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

Successfully merging this pull request may close these issues.

3 participants