Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow users to enable profiling via a setting #1546

Merged
merged 2 commits into from Apr 12, 2013

Conversation

Projects
None yet
4 participants
Contributor

cprice404 commented Mar 22, 2013

Prior to this commit, there is no way for an end user to enable
the new profiling features other than by patching their source
code or passing an extra query parameter to a web request,
which requires them to know the precise URL / query params / POST
body of the request that they want to profile, as well as passing
all of the necessary SSL-related flags to curl (et al) so that
their request can be authenticated.

This commit simply adds a boolean setting called 'enable_profiling'
which can be used to turn on this functionality for all requests.

We should provide more precise ways for users to control this, but
this at least gives them a simple option until we have something
better.

CLA Signed by cprice-puppet on 2012-02-14 21:00:00 -0800

Contributor

zaphod42 commented Mar 27, 2013

@cprice-puppet Can you add a test for this?

Chris Price added some commits Mar 22, 2013

Chris Price Allow users to enable profiling via a setting
Prior to this commit, there is no way for an end user to enable
the new profiling features other than by patching their source
code or passing an extra query parameter to a web request,
which requires them to know the precise URL / query params / POST
body of the request that they want to profile, as well as passing
all of the necessary SSL-related flags to `curl` (et al) so that
their request can be authenticated.

This commit simply adds a boolean setting called 'enable_profiling'
which can be used to turn on this functionality for all requests.

We should provide more precise ways for users to control this, but
this at least gives them a simple option until we have something
better.
736c870
Chris Price Add support for enabling profiling via HTTP header
This commit changes the new setting for enabling profiling from
"enable_profiling" to simply "profile", so that it's easy to
use it from the command line.

It also changes the mechanism for enabling profiling in an HTTP
request; previously, profiling would be enabled via a special
query parameter; now it is enabled via a header (X-Puppet-Profiling).

This allows it to work easily for any type of HTTP request
(GET/POST/HEAD/etc.) without having to worry about the means for
adding a query parameter.

The commit also adds a check for the `profile` setting during
outgoing indirector REST requests, and adds the header if the setting
is enabled.  This means that the profiling flag will work from
the client as well as on the server.
f854a1a
Contributor

cprice404 commented Apr 5, 2013

@zaphod42 This has been modified as per our discussions.

Member

adrienthebo commented Apr 12, 2013

@cprice-puppet sorry for the delayed response on this; it looks like the recent changes have caused test failures in travis-ci. Do you have the time to look into this?

@zaphod42 zaphod42 added a commit that referenced this pull request Apr 12, 2013

@zaphod42 zaphod42 Merge pull request #1546 from cprice-puppet/feature/master/add-settin…
…g-to-enable-profiling

Allow users to enable profiling via a setting
d4f0e48

@zaphod42 zaphod42 merged commit f854a1a into puppetlabs:master Apr 12, 2013

1 check failed

default The Travis build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment