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

Add /usage endpoint per object type #42560

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

rvolosatovs
Copy link
Contributor

@rvolosatovs rvolosatovs commented Jun 23, 2021

- What I did
Add /usage endpoint per object type

- How I did it

  • Expose some of the existing disk usage functionality for direct usage in the router
  • Introduce per-object disk usage computation methods
  • Introduce and use pkg/compute.Singleton, which ensures computations are simultaneously performed by at most one goroutine per object type and the results are propagated to all goroutines simultaneously calling the method. (i.e. if A() is called 20 simultaneously, only do the actual work once and return the computed value to all 20 callers)

- How to verify it
Call per-object methods, Singleton implementation is verified by unit test attached.

- Description for the changelog

Per-object (container, image, volume, build) endpoints are now available

- TODO

  • Document endpoints in Swagger
  • Update version history

@rvolosatovs rvolosatovs force-pushed the per_object_df branch 3 times, most recently from cd7fdb1 to de35fde Compare June 25, 2021 11:14
@rvolosatovs rvolosatovs changed the title Add /df endpoint per object type Add /usage endpoint per object type Jun 25, 2021
@rvolosatovs rvolosatovs force-pushed the per_object_df branch 6 times, most recently from 58a59ea to ceaf471 Compare June 28, 2021 10:24
@rvolosatovs rvolosatovs force-pushed the per_object_df branch 3 times, most recently from 2f53880 to a2abcb3 Compare July 5, 2021 11:33
@rvolosatovs rvolosatovs force-pushed the per_object_df branch 2 times, most recently from 2de0c0a to 4404a90 Compare August 2, 2021 20:26
Roman Volosatovs added 6 commits August 3, 2021 15:39
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Roman Volosatovs added 4 commits August 4, 2021 15:28
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
- Simplify existing implementation
- Introduce `rangeContainers` for greater flexibility

Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants