Skip to content
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

JSON Output #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

JSON Output #32

wants to merge 2 commits into from

Conversation

delanne
Copy link

@delanne delanne commented Aug 27, 2014

This commits adds 2 things:

  • Returns a JSON object if the json parameter is defined in the URL (example: http://:/?json,
    http://:/processes?node=localhost&json)
    • 'page' and 'is_xhr' are not return in the JSON object (not needed)
    • I added the field 'timestamp' to the JSON object (it contains the timestamp of the response).
  • Add http://:/process//all, it returns a JSON object which contains all sections (Overview,
    Environment, Threads, Open files, Connections, Memory maps, Children, Limits)

I added the JSON output, because I plan to use psdash to monitor some hosts. Some python scripts will send HTTP requests to psdash. The data will be keept and plot (like mrtg).
In order to not make several HTTP Requests to get the process info, I added http://:/process//all

 - Returns a JSON object if the json parameter is defined in the URL (example: http://<ip>:<port>/?json,
   http://<ip>:<port>/processes?node=localhost&json)
    - 'page' and 'is_xhr' are not return in the JSON object (not needed)
    - I added the field 'timestamp' to the JSON object (it contains the timestamp of the response).
 - Add http://<ip>:<port>/process/<pid>/all, it returns a JSON object which contains all sections (Overview,
   Environment, Threads, Open files, Connections, Memory maps, Children, Limits)
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6b81394 on delanne:jsonOutput into * on Jahaja:master*.

@Jahaja
Copy link
Owner

Jahaja commented Aug 27, 2014

Hi, thanks for the PR. You know that I've recently added support for multiple nodes right? I guess you're looking to extend on the current functionality to be able to plot graphs using your own script or similar?

I'm still evaluating whether to continue using zerorpc (may be good performance and network-wise with a lot of nodes, but probably not really significant) or just switch to letting agents return json instead. If I do that, the return as json functionality will be added as a result.

This could be a good use-case for adding some kind of plugin support. Could you explain what you want to do?

Nevermind the failed build btw, there's currently a race condition when starting multiple instances of padash and registering one of them to the other in the unittests.

@delanne
Copy link
Author

delanne commented Aug 27, 2014

Yes, I noticed that you add support for multiple nodes, that's an interesting feature !

what I want to do is:

  • In a context of performance testing of a product, I need to monitor the host and a specific list of process.
  • The monitoring info will be saved and plotted on demand.
    (a kind of nagios).

@Jahaja
Copy link
Owner

Jahaja commented Aug 28, 2014

Alright, thanks.

If this is added I would likely add it as an additional endpoint rather than as a part of the process endpoint. Also, I'm not sure if the change to using a bitmask for checking section is really needed as there's currently no support for multiple sections anyways apart from the ALL_SECTIONS special case that could be moved to it's own endpoint.

@delanne
Copy link
Author

delanne commented Aug 28, 2014

I agree, it makes sense.

2014-08-28 9:43 GMT+02:00 Joakim Hamrén [email protected]:

Alright, thanks.

If this is added I would likely add it as an additional endpoint rather
than as a part of the process endpoint. Also, I'm not sure if the change
to using a bitmask for checking section is really needed as there's
currently no support for multiple sections anyways apart from the
ALL_SECTIONS special case that could be moved to it's own endpoint.


Reply to this email directly or view it on GitHub
#32 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants