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 new ListRepositoriesUsage rpc and messages #2951

Closed
wants to merge 14 commits into from
Closed

Conversation

gilwong00
Copy link
Contributor

Part 1 to: GRW-1804

@gilwong00 gilwong00 requested a review from bufdev as a code owner May 6, 2024 17:02
@gilwong00 gilwong00 requested a review from cyinma May 6, 2024 17:02
}

message GetAllOrganizationsUsagesResponse {
repeated RepositoryUsage repository_usages = 1;
Copy link
Member

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

Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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.

Copy link
Member

@fyockm fyockm left a 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"

proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
}

message GetAllOrganizationsUsagesResponse {
repeated RepositoryUsage repository_usages = 1;
Copy link
Member

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.

@gilwong00 gilwong00 requested a review from cyinma May 6, 2024 19:12
@gilwong00 gilwong00 requested a review from bufdev May 7, 2024 19:25
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
@gilwong00 gilwong00 requested review from cyinma and fyockm May 7, 2024 20:40
Copy link
Member

@cyinma cyinma left a 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

proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
@gilwong00 gilwong00 requested a review from cyinma May 9, 2024 17:12
Copy link
Member

@cyinma cyinma left a 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

@gilwong00 gilwong00 changed the title Add new GetAllOrganizationsUsages rpc and messages Add new ListRepositoriesUsage rpc and messages May 9, 2024
Copy link
Member

@nicksnyder nicksnyder left a 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).

proto/buf/alpha/registry/v1alpha1/admin.proto Outdated Show resolved Hide resolved
@@ -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.
Copy link
Member

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

Comment on lines 284 to 290
// 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;
}
Copy link
Member

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;
Copy link
Member

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.

@gilwong00 gilwong00 marked this pull request as draft May 9, 2024 23:39
@gilwong00 gilwong00 closed this May 10, 2024
@gilwong00 gilwong00 deleted the gwong/GRW-1804 branch May 10, 2024 19:52
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.

None yet

5 participants