-
Notifications
You must be signed in to change notification settings - Fork 1.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
in_monitor_agent: enable to select instance variables of plugins #1393
in_monitor_agent: enable to select instance variables of plugins #1393
Conversation
|
||
data(:with_config_and_retry_yes => [true, true, false, "?with_config=yes&with_retry"], | ||
:with_config_and_retry_no => [false, false, false, "?with_config=no&with_retry=no"], | ||
:with_ivars_given => [false, false, true, "?with_config=no&with_retry=no&with_ivars=id,num_errors"]) |
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.
Please separate tests.
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.
@repeatedly OK.
elsif ivars = opts[:ivars] | ||
iv = {} | ||
ivars.each {|name| | ||
iname = :"@#{name}" |
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.
"@#{name}"
should work.
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.
@repeatedly I chose symbol literal instead of string because reduce garbage. Is this too careful?
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.
What does 'garbage' mean?
:"@#{name}"
is dynamic symbol genaration via string, not static literal.
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.
@repeatedly Sorry, I had misunderstood. I will update patch, so please wait.
@repeatedly Thanks for review and merge! But, I need this feature for v0.12.x also. |
@autopp Yeah. This is good > for v0.12 |
@repeatedly OK, please wait... |
I created pull request #1402 to port this feature. |
I often use
in_monitor_agent
with/api/plugins.json&debug=1
for more complexity plugin monitoring and inspecting.In this case, only some instance variables of a specific plugin is needed.
Unfortunary,
&debug=1
makes responce size too large. (Also, pretty printing is not needed...)To reduce size of response, this PR add query parameter
with_ivars
for/api/plugins.json
.with_ivars
should be a names sepalated by comma.When
with_ivars
is given, the response hasinstance_variables
that contains only specified instance variables for each plugin(This is the same as '&debug=1').E.g.
If
with_ivars
is not good name, please give me other idea. (E.g.with_instance_variables
)