Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Use pprof profile for tracking state instances. #6959
Conversation
|
Report now looks like this:
|
| @@ -549,7 +553,7 @@ func newState( | ||
| st.policy = newPolicy(st) | ||
| } | ||
| // Record this State instance with the global tracker. | ||
| - GlobalTracker.Add(st) | ||
| + profileTracker.Add(st, 1) |
babbageclunk
Feb 9, 2017
Member
I guess we aren't worried about the fact that this keeps a reference to the state? If the state isn't closed the worker goroutines will keep it alive anyway.
| @@ -1,157 +0,0 @@ | ||
| -// Copyright 2017 Canonical Ltd. |
| @@ -82,7 +82,7 @@ juju-statepool-report () { | ||
| } | ||
| juju-statetracker-report () { | ||
| - jujuMachineOrUnit statetracker/ $@ | ||
| + jujuMachineOrUnit debug/pprof/juju/state/tracker?debug=1 $@ |
|
Do we want to hide this behind the developer flag? Would be good to do a check to see whether there's any perf impact. |
|
I don't want it behind a developer flag because I want to be able to get access to it from other production environments. $$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit c22c012
into
juju:2.1
Feb 10, 2017
howbazaar
deleted the
howbazaar:2.1-state-tracker
branch
Feb 10, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
howbazaar commentedFeb 9, 2017
Unfortunately using the runtime finalizers didn't work as expected as if there is a cycle in the structures, as there is in the state object and the workers, the finalizers are not run even thought the objects are garbage collected.
The tracker now removes the references when the state instances are closed. Now that we were doing that, it made no sense to write our own tracking code when pprof does that perfectly well.
QA steps
juju bootstrap
juju ssh 0
juju-statetracker-report