-
Notifications
You must be signed in to change notification settings - Fork 205
Add a definition of function for the deployment frequency graph #1179
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
Changes from all commits
2765192
174d9a8
4bd4505
117bd27
fae84f5
566976b
e1084a5
4cf59c7
d501d70
b87b50b
b24c7a4
d2c5d9d
e6b4ba3
dab071c
26663a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ option go_package = "github.com/pipe-cd/pipe/pkg/app/api/service/webservice"; | |
|
|
||
| import "validate/validate.proto"; | ||
| import "pkg/model/common.proto"; | ||
| import "pkg/model/insight.proto"; | ||
| import "pkg/model/application.proto"; | ||
| import "pkg/model/application_live_state.proto"; | ||
| import "pkg/model/command.proto"; | ||
|
|
@@ -85,6 +86,9 @@ service WebService { | |
| rpc GenerateAPIKey(GenerateAPIKeyRequest) returns (GenerateAPIKeyResponse) {} | ||
| rpc DisableAPIKey(DisableAPIKeyRequest) returns (DisableAPIKeyResponse) {} | ||
| rpc ListAPIKeys(ListAPIKeysRequest) returns (ListAPIKeysResponse) {} | ||
|
|
||
| // Insights | ||
| rpc GetInsightData(GetInsightDataRequest) returns (GetInsightDataResponse) {} | ||
| } | ||
|
|
||
| message AddEnvironmentResponse { | ||
|
|
@@ -401,3 +405,16 @@ message ListAPIKeysRequest { | |
| message ListAPIKeysResponse { | ||
| repeated model.APIKey keys = 1; | ||
| } | ||
|
|
||
| message GetInsightDataRequest { | ||
| pipe.model.InsightMetricsKind metrics_kind = 1 [(validate.rules).enum.defined_only = true]; | ||
| pipe.model.InsightStep step = 2 [(validate.rules).enum.defined_only = true]; | ||
| int64 range_from = 3 [(validate.rules).int64.gt = 0]; | ||
| int64 range_to = 4 [(validate.rules).int64.gt = 0]; | ||
| string application_id = 5; | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add the validation for those fields.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we reorder the fields by their stability/importance. I mean the |
||
|
|
||
| message GetInsightDataResponse { | ||
| int64 updated_at = 1; | ||
| repeated pipe.model.InsightDataPoint data_points = 2; | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can abstract the models/definitions around this The web client sends a request that includes:
and the response will contain either a list of data points or an error. Here are suggestions:
message InsightDataPoint {
int64 timestamp
float value
}
enum InsightMetricsKind {
DEPLOYMENT_FREQUENCY
CHANGE_FAILURE_RATE
...
}
enum InsightStep {
DAILY
WEEKLY
...
}
rpc GetInsightData()...
message GetInsightDataRequest{
InsightMetricsKind metrics_kind;
...
}
message GetInsightDataResponse {
int64 updated_at;
repeated InsightDataPoint data_points;
}
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good. Some metrics kind may not be able to be represented by only timestamp and value alone, but then let's reconsider it at that time.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good :) |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Copyright 2020 The PipeCD Authors. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| syntax = "proto3"; | ||
|
|
||
| package pipe.model; | ||
| option go_package = "github.com/pipe-cd/pipe/pkg/model"; | ||
|
|
||
| import "validate/validate.proto"; | ||
|
|
||
| message InsightDataPoint { | ||
| int64 timestamp = 1 [(validate.rules).int64.gt = 0]; | ||
| float value = 2 [(validate.rules).float.gt = 0]; | ||
| } | ||
|
|
||
| enum InsightMetricsKind { | ||
| DEPLOYMENT_FREQUENCY = 0; | ||
| CHANGE_FAILURE_RATE = 1; | ||
| MTTR = 2; | ||
| LEAD_TIME = 3; | ||
| } | ||
|
|
||
| enum InsightStep { | ||
| DAILY = 0; | ||
| WEEKLY = 1; | ||
| MONTHLY = 2; | ||
| YEARLY = 3; | ||
| } |
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.
nit: