Skip to content

Commit

Permalink
Change random function to exponential distribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
philwinder committed Nov 9, 2017
1 parent 04eef83 commit 85911b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def hello_world():
@IN_PROGRESS.track_inprogress()
def slow_request():
REQUESTS.labels(method='GET', endpoint="/slow").inc()
v = random.random()
v = random.expovariate(1.0 / 1.3)
time.sleep(v)
return render_template_string('<h1>Wow, that took {{v}} s!</h1>', v=v)

Expand Down

0 comments on commit 85911b1

Please sign in to comment.