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

access counts gql #4202

Closed
wants to merge 1 commit into from
Closed

access counts gql #4202

wants to merge 1 commit into from

Conversation

nl0
Copy link
Member

@nl0 nl0 commented Oct 24, 2024

Description

TODO

  • Unit tests
  • Automated tests (e.g. Preflight)
  • Confirm that this change meets security best practices and does not violate the security model
  • Documentation
    • run optipng on any new PNGs
    • Python: Run build.py for new docstrings
    • JavaScript: basic explanation and screenshot of new features
    • Markdown somewhere in docs/**/*.md that explains the feature to end users (said .md files should be linked from SUMMARY.md so they appear on https://docs.quiltdata.com)
    • Markdown docs for developers
  • Changelog entry (skip if change is not significant to end users, e.g. docs only)

@nl0 nl0 requested a review from sir-sigurd October 24, 2024 08:23
@@ -215,13 +215,24 @@ type User {
type AccessCountForDate {
date: Datetime!
value: Int!
sum: Int! # running sum
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure this is required, since it can be easily calculated on the consuming side, but it feels quite convenient to have this

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.69%. Comparing base (dc68d84) to head (994da13).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4202   +/-   ##
=======================================
  Coverage   37.69%   37.69%           
=======================================
  Files         768      768           
  Lines       35317    35317           
  Branches     5215     5215           
=======================================
  Hits        13313    13313           
  Misses      20769    20769           
  Partials     1235     1235           
Flag Coverage Δ
api-python 91.09% <ø> (ø)
catalog 12.08% <ø> (ø)
lambda 87.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}

type BucketAccessCounts {
byExt(groups: Int): AccessCountsGroup[]
Copy link
Member Author

Choose a reason for hiding this comment

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

don't merge / collapse the groups by default
(maybe we don't have to do that at all, just keep that logic on the front-end, not sure)

Copy link
Member

Choose a reason for hiding this comment

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

I'm not quite sure what you mean

Copy link
Member Author

Choose a reason for hiding this comment

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

catalog code "collapses" access counts into a finite number of "bands", so if there's too many extensions, less frequent ones are merged into a single "other" band.
this proposed api design assumes there's no such collapsing performed by default (when groups are null or zero)

@@ -556,6 +567,9 @@ type Query {
searchMorePackages(after: String!, size: Int = 30): PackagesSearchMoreResult!
subscription: SubscriptionState!

bucketAccessCounts(bucket: String!, window: Int!): BucketAccessCounts
objectAccessCounts(bucket: String!, key: String!, window: Int!): AccessCounts
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't have a proper "bucket" entry point currently, and i don't feel comfortable designing / adding that now, so let's just add separate queries.
tho feel free to add a simple container type to group this if you like

@sir-sigurd
Copy link
Member

I guess this can be closed now

@sir-sigurd sir-sigurd closed this Nov 19, 2024
@sir-sigurd sir-sigurd deleted the access-counts-gql branch November 19, 2024 14:12
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.

2 participants