Skip to content

Commit

Permalink
Include the raw response times in output (#11)
Browse files Browse the repository at this point in the history
We really should be including raw response times instead of only the
summary mean/median stuff.
  • Loading branch information
briancurtin committed Apr 2, 2018
1 parent 2ae1ab1 commit 7d7ebe0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ Pine writes its results in JSON, either to stdout or the path you specified
in ``-o``. It looks like the following::

{"results": [
{"timeouts": 0, "failures": [], "name": "get_all_things",
{"times": [1.580882219500005, 1.8884545513215, 1.52546876846],
"timeouts": 0, "failures": [], "name": "get_all_things",
"description": "Get all of the things",
"mean": 1.668359371049998,
"median": 1.580882219500005,
"stdev": 0.0969358463985873},
{"timeouts": 0, "failures": [], "name": "get_one_thing",
{"times": [0.4894684654656654, 0.508042131499991, 1.054654684684],
"timeouts": 0, "failures": [], "name": "get_one_thing",
"description": "Get one thing",
"mean": 0.856881387399993,
"median": 0.508042131499991,
Expand Down
8 changes: 7 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ on each individual test, as follows.
::

{"results": [
{"timeouts": 0, "failures": [], "name": "get_all_things",
{"times": [1.580882219500005, 1.8884545513215, 1.52546876846],
"timeouts": 0, "failures": [], "name": "get_all_things",
"description": "Get all of the things",
"mean": 1.668359371049998,
"median": 1.580882219500005,
Expand All @@ -237,6 +238,11 @@ on each individual test, as follows.
you would still receive statistics about the 10 responses that
succeeded. How you use that information is up to you.

times
^^^^^

This is a list of the response times.

timeouts
^^^^^^^^

Expand Down
3 changes: 2 additions & 1 deletion source/_pine.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Test(Defaults):

@dataclass
class Result:
times: list
timeouts: int
failures: list
name: str = field(default="")
Expand Down Expand Up @@ -100,7 +101,7 @@ async def run_one_test(loop, test):
except asyncio.TimeoutError:
timeouts += 1

result = Result(timeouts, failures)
result = Result(times, timeouts, failures)
num_times = len(times)

# Need at least two runs to calculate any of this.
Expand Down

0 comments on commit 7d7ebe0

Please sign in to comment.