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 Collector API datastore #1703

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

zakkak
Copy link
Contributor

@zakkak zakkak commented May 15, 2024

Fixes Issue

Closes #1109

Proposed Changes

This patch issues a request to the collector API to get all available data. To limit the size of returned data we require the use of a specific tag and imgName combination, while also limiting the date range.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.

Copy link
Member

@johnaohara johnaohara left a comment

Choose a reason for hiding this comment

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

One thing we need to think about is duplicated runs. As it currently works, the call to the collector api simply returns all the results for a given tag, each invocation will return all the data and will be uploaded into Horreum

So, we either need to be able to query the api to return a subset of the data, or we need to handle de-duplication in Horreum


HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(java.net.URI.create(jsonDatastoreConfig.url + "/api/v1/image-stats/tag/" + payload.get("tag").asText()));
Copy link
Member

Choose a reason for hiding this comment

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

should the url path be a separate config param, or part of the jsonDatastoreConfig.url, if the api changes (e.g. a version bump) then this hard-coded path will likely be no longer valid

@johnaohara
Copy link
Member

Ah, I now see this issue wrt filtering the api result: Karm/collector#34

@zakkak
Copy link
Contributor Author

zakkak commented Sep 13, 2024

Karm/collector#35 is now merged enabling filtering by tag, benchmark, and date range (not pushed to production yet though). So I will adapt the PR to use the new API.

@johnaohara
Copy link
Member

@zakkak excellent news.

@zakkak zakkak marked this pull request as ready for review October 1, 2024 12:51
@zakkak
Copy link
Contributor Author

zakkak commented Oct 1, 2024

@johnaohara this should now be ready for review.

@johnaohara johnaohara changed the title WIP: Add Collector API datastore Add Collector API datastore Oct 1, 2024
Copy link
Member

@johnaohara johnaohara left a comment

Choose a reason for hiding this comment

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

LGTM!

@johnaohara johnaohara merged commit 5f3917a into Hyperfoil:master Oct 3, 2024
2 checks passed
@johnaohara
Copy link
Member

@zakkak Many thanks for your contribution!

@zakkak zakkak deleted the collector-api-datastore branch October 4, 2024 06:09
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.

Feature: Datastore integration with Collector API
2 participants