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

doc: introduces a REST use-cases section #471

Merged
1 commit merged into from
Nov 10, 2017

Conversation

sileht
Copy link
Member

@sileht sileht commented Nov 8, 2017

We should list all REST API use-case that people is asking for, to
not get issue opened for new feature when it's already possible to get
the data.

It's not always clear what API call I need to do to get all informations
I need for a use-cases.

This change starts a new section and add one example.

Related #465.

chungg
chungg previously requested changes Nov 8, 2017
Copy link
Member

@chungg chungg left a comment

Choose a reason for hiding this comment

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

i added an examples section under aggregates endpoint

maybe we should move that here?

Use-cases examples
==================

1. I want the top N instances for project_id "BD3A1E52-1C62-44CB-BF04-660BD88CD74D" that consume the most cpu last hour.
Copy link
Member

Choose a reason for hiding this comment

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

s/I want/List/

@@ -931,6 +931,22 @@ reporting values such as the number of new |measures| to process for each

{{ scenarios['get-status']['doc'] }}

Use-cases examples
Copy link
Member

Choose a reason for hiding this comment

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

s/Use-cases/Use case/


To do so, I will use the :ref:`Dynamic aggregates API <aggregates>`. I will use
|start|, |stop|, |granularity| and |groupby| parameters. The entire query will
looke like:
Copy link
Member

Choose a reason for hiding this comment

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

i imagine everything will probably go through aggregates endpoint so maybe drop this intro.


{{ scenarios['use-case1-top-cpuutil-per-instances']['doc'] }}

I have ensured that |stop| - |start| = |granularity| to get only one point per
Copy link
Member

Choose a reason for hiding this comment

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

The following is configured so that |stop| - |start| = |granularity| will get only one point per instance.

instances.

This will give all informations we need to order by cpu.util timeseries and
pick only the N we are interrested in.
Copy link
Member

Choose a reason for hiding this comment

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

This will give all information needed to order by cpu.util timeseries which can be filtered down to N results.

@sileht sileht self-assigned this Nov 9, 2017
@sileht sileht force-pushed the sileht/doc-use-cases branch from 6ca14b4 to 6ac38f8 Compare November 9, 2017 07:36
@sileht
Copy link
Member Author

sileht commented Nov 9, 2017

Pull-request updated, HEAD is now 6ac38f8

Copy link
Member

@chungg chungg left a comment

Choose a reason for hiding this comment

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

oh, i was thinking of moving all examples to your original location so it's more visible but this works. :)

only one point per instance.

This will give all information needed to order by cpu.util timeseries which can
be filtered down to N results..
Copy link
Member

Choose a reason for hiding this comment

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

s/.././

we can maybe move the example REST below the text but it's not important.

@sileht sileht force-pushed the sileht/doc-use-cases branch from 6ac38f8 to 7d5755d Compare November 9, 2017 15:21
@sileht
Copy link
Member Author

sileht commented Nov 9, 2017

Pull-request updated, HEAD is now 7d5755d

jd
jd previously requested changes Nov 9, 2017
Copy link
Member

@jd jd left a comment

Choose a reason for hiding this comment

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

@chungg will confirm my change :D

@@ -838,6 +838,17 @@ Operations between metrics can also be done, such as:

{{ scenarios['get-aggregates-between-metrics']['doc'] }}

List top N instances for that consume the most cpu last hour
Copy link
Member

Choose a reason for hiding this comment

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

List the top N resources that consume the most CPU during last hour

Copy link
Member

Choose a reason for hiding this comment

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

s/during last/during the last/

The following is configured so that `stop` - `start` = `granularity` will get
only one point per instance.

This will give all information needed to order by cpu.util timeseries which can
Copy link
Member

Choose a reason for hiding this comment

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

the information

cpu.util

Copy link
Member

Choose a reason for hiding this comment

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

with or without 'the' works. i guess with 'the' is more correct.

We should list all REST API use-case that people is asking for, to
not get issue opened for new feature when it's already possible to get
the data.

It's not always clear what API call I need to do to get all informations
I need for a use-cases.

This change starts a new section and add one example.

Related gnocchixyz#465.
@sileht sileht force-pushed the sileht/doc-use-cases branch from 7d5755d to 380e355 Compare November 10, 2017 07:51
@sileht
Copy link
Member Author

sileht commented Nov 10, 2017

Pull-request updated, HEAD is now 380e355

@ghost ghost merged commit a3c81e0 into gnocchixyz:master Nov 10, 2017
@sileht sileht deleted the sileht/doc-use-cases branch November 16, 2017 16:26
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants