-
-
Notifications
You must be signed in to change notification settings - Fork 632
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
[pantsd] Add RunTracker stats. #5374
Conversation
2995776
to
b8ada86
Compare
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.
Looks good! :)
@@ -80,8 +80,6 @@ def __init__(self, options, run_tracker, target_roots, | |||
self._workspace = workspace or (ScmWorkspace(self._scm) if self._scm else None) | |||
self._replace_targets(target_roots) | |||
self._invalidation_report = invalidation_report | |||
# TODO(#4769): This should not be exposed to anyone. | |||
# Note that the Context created in unit tests by BaseTest uses a different codepath. |
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.
This note is probably still useful...
(I think @stuhood had plans to unify them? :))
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.
that work should already be tracked in #4401 fwict
src/python/pants/goal/context.py
Outdated
@@ -144,6 +142,11 @@ def scm(self): | |||
""" | |||
return self._scm | |||
|
|||
@property | |||
def scheduler(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.
@ity FYI, this may be useful :)
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.
If possible, it would be good not to expose this as a public-seeming API, and continue to access the private field (or to expose a method that closes over the entire "get the graph len and record it in the runtracker" operation). The goal of #4769 is to give Tasks the ability to request that things run in the scheduler in a declarative way. Having imperative access is supposed to just be a stopgap.
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.
sgtm - fixed.
self.resident_graph_size = None | ||
self.resulting_graph_size = None | ||
|
||
def set_resident_graph_size(self, size): |
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.
s/resident/already_resident/?
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.
renamed to preceding_graph_size
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.
Thanks Kris.
src/python/pants/goal/context.py
Outdated
@@ -144,6 +142,11 @@ def scm(self): | |||
""" | |||
return self._scm | |||
|
|||
@property | |||
def scheduler(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.
If possible, it would be good not to expose this as a public-seeming API, and continue to access the private field (or to expose a method that closes over the entire "get the graph len and record it in the runtracker" operation). The goal of #4769 is to give Tasks the ability to request that things run in the scheduler in a declarative way. Having imperative access is supposed to just be a stopgap.
[omerta pants (kwlzn/pantsd_stats)]$ ./pants -q list : --run-tracker-stats-local-json-file=test.json >/dev/null; cat test.json | jq '.pantsd_stats' { "resident_graph_size": -1, "resulting_graph_size": 81 } [omerta pants (kwlzn/pantsd_stats)]$ PANTS_ENABLE_PANTSD=True ./pants -q list : --run-tracker-stats-local-json-file=test.json >/dev/null; cat test.json | jq '.pantsd_stats' { "resident_graph_size": 0, "resulting_graph_size": 81 } [omerta pants (kwlzn/pantsd_stats)]$ PANTS_ENABLE_PANTSD=True ./pants -q list : --run-tracker-stats-local-json-file=test.json >/dev/null; cat test.json | jq '.pantsd_stats' { "resident_graph_size": 15, "resulting_graph_size": 81 } [omerta pants (kwlzn/pantsd_stats)]$ PANTS_ENABLE_PANTSD=True ./pants -q list :: --run-tracker-stats-local-json-file=test.json >/dev/null; cat test.json | jq '.pantsd_stats' { "resident_graph_size": 15, "resulting_graph_size": 14634 } [omerta pants (kwlzn/pantsd_stats)]$ PANTS_ENABLE_PANTSD=True ./pants -q list :: --run-tracker-stats-local-json-file=test.json >/dev/null; cat test.json | jq '.pantsd_stats' { "resident_graph_size": 6198, "resulting_graph_size": 14634 } Fixes #4644
Leaving a note here for posterity: in order to cherry-pick this one, I needed to cherry-pick #5239 as well. |
Fixes #4644