-
Notifications
You must be signed in to change notification settings - Fork 243
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 new ListRepositoriesUsage rpc and messages #2951
Conversation
} | ||
|
||
message GetAllOrganizationsUsagesResponse { | ||
repeated RepositoryUsage repository_usages = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is repeated here? What is unique and what is not? All needs to be documented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The list of types usage for all repositories in all orgs on a single BSR instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't answer the original question - is this monthly? What does the list contain? What should I expect a valid list to include based on the timestamp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The list contains types usage info and counts for all repositories in all orgs on a single BSR instance, based on a snapshot single point in time within the requested time range where the aggregate types usage is at a maximum.
does this make more sense?
is this monthly?
no, it's for any point within the requested date range
What does the list contain?
repository information and types usage for all repositories on the instance
What should I expect a valid list to include based on the timestamp?
the types count for the point when types usage was at a maximum in the time range
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between the documentation of this method, and the documentation/name for RepositoryUsage, some things are very unclear
- How many items will be in this list? Do we need to have paging?
- What is the timeframe associated with each item? Is this configurable? Should it be?
- How do I map items in this list to a particular timeframe?
Other thought:
- If this method is really specialized toward returning max usage within some time horizon, maybe the names should more explicitly represent that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally, i think we should replace all instance of "amount" with "number"
} | ||
|
||
message GetAllOrganizationsUsagesResponse { | ||
repeated RepositoryUsage repository_usages = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The list of types usage for all repositories in all orgs on a single BSR instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also update the PR title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, please make sure to update the PR title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally we want our internal APIs to be as clearly named, designed, and documented as our external APIs. Please read through https://github.com/bufbuild/registry-proto to get a sense of what a good standard looks like moving forward, and to understand the patterns we have established (e.g. like how we do pagination). It would also be good to add validation rules to all fields as appropriate (lmk if there is a reason we haven't been doing that already).
@@ -142,6 +161,9 @@ service AdminService { | |||
// GetClusterUsage returns the summation of total message, enum and service types usage | |||
// for every repository in each organization within a single tenant BSR instance. | |||
rpc GetClusterUsage(GetClusterUsageRequest) returns (GetClusterUsageResponse); | |||
// ListRepositoriesUsage returns the usage metrics for all repositories within | |||
// a single tenant BSR instance highest point in time usage for a given time range. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sentence doesn't make sense to me, like there are some missing words or something
// Usage filter is an optional owner or repository id used to filter usage. | ||
oneof usage_filter { | ||
// The id of the owner. | ||
string owner_id = 3; | ||
// The id of the repository. | ||
string repository_id = 4; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why this is a oneof?
} | ||
|
||
message GetAllOrganizationsUsagesResponse { | ||
repeated RepositoryUsage repository_usages = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between the documentation of this method, and the documentation/name for RepositoryUsage, some things are very unclear
- How many items will be in this list? Do we need to have paging?
- What is the timeframe associated with each item? Is this configurable? Should it be?
- How do I map items in this list to a particular timeframe?
Other thought:
- If this method is really specialized toward returning max usage within some time horizon, maybe the names should more explicitly represent that.
Part 1 to: GRW-1804