-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Run time relative to start when using LoadTestShape #1581
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
import traceback | ||
import warnings | ||
from uuid import uuid4 | ||
from time import time | ||
from time import time, monotonic | ||
|
||
import gevent | ||
import greenlet | ||
|
@@ -352,6 +352,7 @@ def start_shape(self): | |
self.update_state(STATE_INIT) | ||
self.shape_greenlet = self.greenlet.spawn(self.shape_worker) | ||
self.shape_greenlet.link_exception(greenlet_exception_handler) | ||
self.environment.shape_class.start_time = monotonic() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you not just call |
||
|
||
def shape_worker(self): | ||
logger.info("Shape worker starting") | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -7,7 +7,8 @@ class LoadTestShape(object): | |||
during a load test. | ||||
""" | ||||
|
||||
start_time = time.monotonic() | ||||
def __init__(self): | ||||
self.start_time = time.monotonic() | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is ever called? Because the class is never instantiated, it's just declared eg, so There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it instantiated here: Line 93 in 08d5173
shape_class variable name a bit of a misnomer...)
(but maybe that is a mistake) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes, you are right. I wrote that, I should know! |
||||
|
||||
def reset_time(self): | ||||
""" | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like it 👍