Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Fixes #1939: Enable cProfile of tasks #2882

Merged
merged 1 commit into from Dec 7, 2016
Merged

Conversation

ehelms
Copy link
Contributor

@ehelms ehelms commented Dec 7, 2016

Adds the ability to turn on cProfiles of individual Pulp tasks
and dumping of the tasks into a directory. This can have an impact
on performance. The trade off is that users could investigate
individual tasks or provide these cProfiles to developers to help
detect anomalies or systematic issues.

@mention-bot
Copy link

@ehelms, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bmbouter, @dkliban and @jortel to be potential reviewers.

@ehelms
Copy link
Contributor Author

ehelms commented Dec 7, 2016

I'm not entirely sure how to add tests for this particular case, but if you feel they would be useful and point me in the right direction I am more than happy to add.

@pulpbot
Copy link
Member

pulpbot commented Dec 7, 2016

Can one of the admins verify this patch?

# writeable and readable by Pulp.

[profiling]
# enable: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should default to off yes?


if config.get('profiling', 'enabled') is True:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we unguard this import statement and move it up with the other standard imports? We can import it 100 percent of the time I think.

@bmbouter
Copy link
Member

bmbouter commented Dec 7, 2016

@ehelms Thank you for submitting this PR! Can a release note be added. I think you'll have to make this file, but another PR already has one so maybe just make something similar and the first one to merge wins.

@bmbouter
Copy link
Member

bmbouter commented Dec 7, 2016

Also can the following be added to the commit so that Redmine associates it correctly:

https://pulp.plan.io/issues/1939
closes #1939

@bmbouter
Copy link
Member

bmbouter commented Dec 7, 2016

Also Travis is saying there are flake8 errors which need to be fixed. I think I saw just one. Click details in the 'failing checks' area at the bottom of this PR to look at the travis report.

@bmbouter
Copy link
Member

bmbouter commented Dec 7, 2016

How do you feel about updating the debugging docs? I imagine it would be a section at the top of the above link^. It would briefly explain the behavior of the feature. Beyond that, you can mostly just point them at the server.conf details instead of duplicating that text.

Copy link
Member

@bmbouter bmbouter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this PR! This is a great feature. I left several comments with changes requested. I would really like to see all of them, but if there are ones you don't want to do please let me know and we can handle that as followup work.

Thank you @ehelms!

@bmbouter
Copy link
Member

bmbouter commented Dec 7, 2016

ok test

@bmbouter
Copy link
Member

bmbouter commented Dec 7, 2016

@ehelms regarding tests, I don't think you need to add any. I think ensuring all existing tests pass is important. I just kicked off a test runner. If you did really want to add tests you would put them in this module here.

@ehelms
Copy link
Contributor Author

ehelms commented Dec 7, 2016

To be honest, I don't understand the flake8 output.

@ehelms
Copy link
Contributor Author

ehelms commented Dec 7, 2016

I have updated the following:

  • updated debugging docs
  • updated comments on in line code
  • added release note

@bmbouter
Copy link
Member

bmbouter commented Dec 7, 2016

@ehelms I looked at the flake8 output and actually flake8 is confused. It's reporting a python flake8 issue on a .conf file. Please ignore the flake8 issue.

@@ -0,0 +1,11 @@
=======================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 line needs to be added to the index file that indexes these release notes. Otherwise sphinx won't discover this file.

@@ -25,6 +26,7 @@
from pulp.server.managers.repo import _common as common_utils
from pulp.server.managers import factory as managers
from pulp.server.managers.schedule import utils
from pulp.server import config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be moved above all pulp.server imports. That would put it just after the last pulp.common import.

@ehelms
Copy link
Contributor Author

ehelms commented Dec 7, 2016

Updated

@@ -136,6 +136,10 @@ def _load_config(self):
'download_interval': '30',
'download_concurrency': '5'
},
'profiling': {
'enabled': False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the tests are failing because this is False but it expects 'false'. Crazy I know. Looking earlier in the file is the only reason I know. Please push a new version and I can kick off the tests again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find, updated!

@ehelms ehelms force-pushed the fix-1939 branch 2 times, most recently from d171870 to ab368c1 Compare December 7, 2016 20:53
@bmbouter
Copy link
Member

bmbouter commented Dec 7, 2016

The good news is that the test failures now look sane. The bad news is there are 104 test failures. I think those 104 test failures are due to the mock objects which mock the config loading stuff at test time is not robust.

Adds the ability to turn on cProfiles of individual Pulp tasks
and dumping of the tasks into a directory. This can have an impact
on performance. The trade off is that users could investigate
individual tasks or provide these cProfiles to developers to help
detect anomalies or systematic issues.

https://pulp.plan.io/issues/1939
@ehelms
Copy link
Contributor Author

ehelms commented Dec 7, 2016

Woot! Tests are passing, stupid flak8

Copy link
Member

@bmbouter bmbouter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ehelms you diiiiiiiiiiiiiiiid it! Great job all around. I think this is good to go. I'm going to ask one other core dev to approve prior to merging, but I'm approving mine now.

Thank you so much for this. Would you want to demo this at a sprint demo on Jan 5th or would you want someone else to do that?

@bmbouter
Copy link
Member

bmbouter commented Dec 7, 2016

Merging! Thanks @ehelms and @dkliban.

@bmbouter bmbouter merged commit 7e5d817 into pulp:master Dec 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants