go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/analysis/proto/v1/metrics.pb.go (about) 1 // Copyright 2022 The LUCI Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Code generated by protoc-gen-go. DO NOT EDIT. 16 // versions: 17 // protoc-gen-go v1.32.0 18 // protoc v3.21.7 19 // source: go.chromium.org/luci/analysis/proto/v1/metrics.proto 20 21 package analysispb 22 23 import prpc "go.chromium.org/luci/grpc/prpc" 24 25 import ( 26 context "context" 27 grpc "google.golang.org/grpc" 28 codes "google.golang.org/grpc/codes" 29 status "google.golang.org/grpc/status" 30 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 31 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 32 reflect "reflect" 33 sync "sync" 34 ) 35 36 const ( 37 // Verify that this generated code is sufficiently up-to-date. 38 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 39 // Verify that runtime/protoimpl is sufficiently up-to-date. 40 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 41 ) 42 43 // A request to list metrics in a given LUCI project. 44 type ListProjectMetricsRequest struct { 45 state protoimpl.MessageState 46 sizeCache protoimpl.SizeCache 47 unknownFields protoimpl.UnknownFields 48 49 // The parent LUCI Project, which owns the collection of metrics. 50 // Format: projects/{project}. 51 Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` 52 } 53 54 func (x *ListProjectMetricsRequest) Reset() { 55 *x = ListProjectMetricsRequest{} 56 if protoimpl.UnsafeEnabled { 57 mi := &file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes[0] 58 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 59 ms.StoreMessageInfo(mi) 60 } 61 } 62 63 func (x *ListProjectMetricsRequest) String() string { 64 return protoimpl.X.MessageStringOf(x) 65 } 66 67 func (*ListProjectMetricsRequest) ProtoMessage() {} 68 69 func (x *ListProjectMetricsRequest) ProtoReflect() protoreflect.Message { 70 mi := &file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes[0] 71 if protoimpl.UnsafeEnabled && x != nil { 72 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 73 if ms.LoadMessageInfo() == nil { 74 ms.StoreMessageInfo(mi) 75 } 76 return ms 77 } 78 return mi.MessageOf(x) 79 } 80 81 // Deprecated: Use ListProjectMetricsRequest.ProtoReflect.Descriptor instead. 82 func (*ListProjectMetricsRequest) Descriptor() ([]byte, []int) { 83 return file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{0} 84 } 85 86 func (x *ListProjectMetricsRequest) GetParent() string { 87 if x != nil { 88 return x.Parent 89 } 90 return "" 91 } 92 93 // Lists the metrics available in a LUCI Project. 94 // Designed to follow aip.dev/132. 95 type ListProjectMetricsResponse struct { 96 state protoimpl.MessageState 97 sizeCache protoimpl.SizeCache 98 unknownFields protoimpl.UnknownFields 99 100 // The metrics available in the LUCI Project. 101 Metrics []*ProjectMetric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"` 102 } 103 104 func (x *ListProjectMetricsResponse) Reset() { 105 *x = ListProjectMetricsResponse{} 106 if protoimpl.UnsafeEnabled { 107 mi := &file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes[1] 108 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 109 ms.StoreMessageInfo(mi) 110 } 111 } 112 113 func (x *ListProjectMetricsResponse) String() string { 114 return protoimpl.X.MessageStringOf(x) 115 } 116 117 func (*ListProjectMetricsResponse) ProtoMessage() {} 118 119 func (x *ListProjectMetricsResponse) ProtoReflect() protoreflect.Message { 120 mi := &file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes[1] 121 if protoimpl.UnsafeEnabled && x != nil { 122 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 123 if ms.LoadMessageInfo() == nil { 124 ms.StoreMessageInfo(mi) 125 } 126 return ms 127 } 128 return mi.MessageOf(x) 129 } 130 131 // Deprecated: Use ListProjectMetricsResponse.ProtoReflect.Descriptor instead. 132 func (*ListProjectMetricsResponse) Descriptor() ([]byte, []int) { 133 return file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{1} 134 } 135 136 func (x *ListProjectMetricsResponse) GetMetrics() []*ProjectMetric { 137 if x != nil { 138 return x.Metrics 139 } 140 return nil 141 } 142 143 // A metric with LUCI project-specific configuration attached. 144 type ProjectMetric struct { 145 state protoimpl.MessageState 146 sizeCache protoimpl.SizeCache 147 unknownFields protoimpl.UnknownFields 148 149 // The resource name of the metric. 150 // Format: projects/{project}/metrics/{metric_id}. 151 // See aip.dev/122 for more. 152 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 153 // The identifier of the metric. 154 // Follows the pattern: ^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$. 155 MetricId string `protobuf:"bytes,2,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty"` 156 // A human readable name for the metric. E.g. 157 // "User CLs Failed Presubmit". 158 HumanReadableName string `protobuf:"bytes,3,opt,name=human_readable_name,json=humanReadableName,proto3" json:"human_readable_name,omitempty"` 159 // A human readable description of the metric. Normally 160 // this appears in a help popup near the metric. 161 Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` 162 // Whether the metric should be shown by default in 163 // the cluster listing and on cluster pages. 164 IsDefault bool `protobuf:"varint,5,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` 165 // SortPriority defines the order by which metrics are sorted by default. 166 // The metric with the highest sort priority will define the 167 // (default) primary sort order, followed by the metric with the 168 // second highest sort priority, and so on. 169 // Each metric is guaranteed to have a unique sort priority. 170 SortPriority int32 `protobuf:"varint,6,opt,name=sort_priority,json=sortPriority,proto3" json:"sort_priority,omitempty"` 171 } 172 173 func (x *ProjectMetric) Reset() { 174 *x = ProjectMetric{} 175 if protoimpl.UnsafeEnabled { 176 mi := &file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes[2] 177 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 178 ms.StoreMessageInfo(mi) 179 } 180 } 181 182 func (x *ProjectMetric) String() string { 183 return protoimpl.X.MessageStringOf(x) 184 } 185 186 func (*ProjectMetric) ProtoMessage() {} 187 188 func (x *ProjectMetric) ProtoReflect() protoreflect.Message { 189 mi := &file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes[2] 190 if protoimpl.UnsafeEnabled && x != nil { 191 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 192 if ms.LoadMessageInfo() == nil { 193 ms.StoreMessageInfo(mi) 194 } 195 return ms 196 } 197 return mi.MessageOf(x) 198 } 199 200 // Deprecated: Use ProjectMetric.ProtoReflect.Descriptor instead. 201 func (*ProjectMetric) Descriptor() ([]byte, []int) { 202 return file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP(), []int{2} 203 } 204 205 func (x *ProjectMetric) GetName() string { 206 if x != nil { 207 return x.Name 208 } 209 return "" 210 } 211 212 func (x *ProjectMetric) GetMetricId() string { 213 if x != nil { 214 return x.MetricId 215 } 216 return "" 217 } 218 219 func (x *ProjectMetric) GetHumanReadableName() string { 220 if x != nil { 221 return x.HumanReadableName 222 } 223 return "" 224 } 225 226 func (x *ProjectMetric) GetDescription() string { 227 if x != nil { 228 return x.Description 229 } 230 return "" 231 } 232 233 func (x *ProjectMetric) GetIsDefault() bool { 234 if x != nil { 235 return x.IsDefault 236 } 237 return false 238 } 239 240 func (x *ProjectMetric) GetSortPriority() int32 { 241 if x != nil { 242 return x.SortPriority 243 } 244 return 0 245 } 246 247 var File_go_chromium_org_luci_analysis_proto_v1_metrics_proto protoreflect.FileDescriptor 248 249 var file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDesc = []byte{ 250 0x0a, 0x34, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 251 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x2f, 252 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 253 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6c, 0x75, 0x63, 0x69, 0x2e, 0x61, 0x6e, 0x61, 254 0x6c, 0x79, 0x73, 0x69, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x33, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 255 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 256 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 257 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x22, 0x57, 0x0a, 258 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x72, 259 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x6d, 260 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 261 0x75, 0x63, 0x69, 0x2e, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x2e, 0x76, 0x31, 0x2e, 262 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x07, 0x6d, 263 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0xd6, 0x01, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x6a, 0x65, 264 0x63, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 265 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 266 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 267 0x08, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x68, 0x75, 0x6d, 268 0x61, 0x6e, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 269 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x52, 0x65, 0x61, 270 0x64, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 271 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 272 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 273 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 274 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, 275 0x72, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 276 0x05, 0x52, 0x0c, 0x73, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x32, 277 0x78, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x6d, 0x0a, 0x0e, 0x4c, 0x69, 278 0x73, 0x74, 0x46, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2b, 0x2e, 0x6c, 279 0x75, 0x63, 0x69, 0x2e, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x2e, 0x76, 0x31, 0x2e, 280 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 281 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6c, 0x75, 0x63, 0x69, 282 0x2e, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 283 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 284 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x6f, 0x2e, 285 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, 286 0x69, 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 287 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x70, 0x62, 0x62, 0x06, 288 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 289 } 290 291 var ( 292 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescOnce sync.Once 293 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescData = file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDesc 294 ) 295 296 func file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescGZIP() []byte { 297 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescOnce.Do(func() { 298 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescData) 299 }) 300 return file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDescData 301 } 302 303 var file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes = make([]protoimpl.MessageInfo, 3) 304 var file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_goTypes = []interface{}{ 305 (*ListProjectMetricsRequest)(nil), // 0: luci.analysis.v1.ListProjectMetricsRequest 306 (*ListProjectMetricsResponse)(nil), // 1: luci.analysis.v1.ListProjectMetricsResponse 307 (*ProjectMetric)(nil), // 2: luci.analysis.v1.ProjectMetric 308 } 309 var file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_depIdxs = []int32{ 310 2, // 0: luci.analysis.v1.ListProjectMetricsResponse.metrics:type_name -> luci.analysis.v1.ProjectMetric 311 0, // 1: luci.analysis.v1.Metrics.ListForProject:input_type -> luci.analysis.v1.ListProjectMetricsRequest 312 1, // 2: luci.analysis.v1.Metrics.ListForProject:output_type -> luci.analysis.v1.ListProjectMetricsResponse 313 2, // [2:3] is the sub-list for method output_type 314 1, // [1:2] is the sub-list for method input_type 315 1, // [1:1] is the sub-list for extension type_name 316 1, // [1:1] is the sub-list for extension extendee 317 0, // [0:1] is the sub-list for field type_name 318 } 319 320 func init() { file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_init() } 321 func file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_init() { 322 if File_go_chromium_org_luci_analysis_proto_v1_metrics_proto != nil { 323 return 324 } 325 if !protoimpl.UnsafeEnabled { 326 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 327 switch v := v.(*ListProjectMetricsRequest); i { 328 case 0: 329 return &v.state 330 case 1: 331 return &v.sizeCache 332 case 2: 333 return &v.unknownFields 334 default: 335 return nil 336 } 337 } 338 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 339 switch v := v.(*ListProjectMetricsResponse); i { 340 case 0: 341 return &v.state 342 case 1: 343 return &v.sizeCache 344 case 2: 345 return &v.unknownFields 346 default: 347 return nil 348 } 349 } 350 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 351 switch v := v.(*ProjectMetric); i { 352 case 0: 353 return &v.state 354 case 1: 355 return &v.sizeCache 356 case 2: 357 return &v.unknownFields 358 default: 359 return nil 360 } 361 } 362 } 363 type x struct{} 364 out := protoimpl.TypeBuilder{ 365 File: protoimpl.DescBuilder{ 366 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 367 RawDescriptor: file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDesc, 368 NumEnums: 0, 369 NumMessages: 3, 370 NumExtensions: 0, 371 NumServices: 1, 372 }, 373 GoTypes: file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_goTypes, 374 DependencyIndexes: file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_depIdxs, 375 MessageInfos: file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_msgTypes, 376 }.Build() 377 File_go_chromium_org_luci_analysis_proto_v1_metrics_proto = out.File 378 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_rawDesc = nil 379 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_goTypes = nil 380 file_go_chromium_org_luci_analysis_proto_v1_metrics_proto_depIdxs = nil 381 } 382 383 // Reference imports to suppress errors if they are not otherwise used. 384 var _ context.Context 385 var _ grpc.ClientConnInterface 386 387 // This is a compile-time assertion to ensure that this generated file 388 // is compatible with the grpc package it is being compiled against. 389 const _ = grpc.SupportPackageIsVersion6 390 391 // MetricsClient is the client API for Metrics service. 392 // 393 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 394 type MetricsClient interface { 395 // ListForProject lists metrics in a given LUCI Project. 396 // Designed to follow aip.dev/132. 397 ListForProject(ctx context.Context, in *ListProjectMetricsRequest, opts ...grpc.CallOption) (*ListProjectMetricsResponse, error) 398 } 399 type metricsPRPCClient struct { 400 client *prpc.Client 401 } 402 403 func NewMetricsPRPCClient(client *prpc.Client) MetricsClient { 404 return &metricsPRPCClient{client} 405 } 406 407 func (c *metricsPRPCClient) ListForProject(ctx context.Context, in *ListProjectMetricsRequest, opts ...grpc.CallOption) (*ListProjectMetricsResponse, error) { 408 out := new(ListProjectMetricsResponse) 409 err := c.client.Call(ctx, "luci.analysis.v1.Metrics", "ListForProject", in, out, opts...) 410 if err != nil { 411 return nil, err 412 } 413 return out, nil 414 } 415 416 type metricsClient struct { 417 cc grpc.ClientConnInterface 418 } 419 420 func NewMetricsClient(cc grpc.ClientConnInterface) MetricsClient { 421 return &metricsClient{cc} 422 } 423 424 func (c *metricsClient) ListForProject(ctx context.Context, in *ListProjectMetricsRequest, opts ...grpc.CallOption) (*ListProjectMetricsResponse, error) { 425 out := new(ListProjectMetricsResponse) 426 err := c.cc.Invoke(ctx, "/luci.analysis.v1.Metrics/ListForProject", in, out, opts...) 427 if err != nil { 428 return nil, err 429 } 430 return out, nil 431 } 432 433 // MetricsServer is the server API for Metrics service. 434 type MetricsServer interface { 435 // ListForProject lists metrics in a given LUCI Project. 436 // Designed to follow aip.dev/132. 437 ListForProject(context.Context, *ListProjectMetricsRequest) (*ListProjectMetricsResponse, error) 438 } 439 440 // UnimplementedMetricsServer can be embedded to have forward compatible implementations. 441 type UnimplementedMetricsServer struct { 442 } 443 444 func (*UnimplementedMetricsServer) ListForProject(context.Context, *ListProjectMetricsRequest) (*ListProjectMetricsResponse, error) { 445 return nil, status.Errorf(codes.Unimplemented, "method ListForProject not implemented") 446 } 447 448 func RegisterMetricsServer(s prpc.Registrar, srv MetricsServer) { 449 s.RegisterService(&_Metrics_serviceDesc, srv) 450 } 451 452 func _Metrics_ListForProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 453 in := new(ListProjectMetricsRequest) 454 if err := dec(in); err != nil { 455 return nil, err 456 } 457 if interceptor == nil { 458 return srv.(MetricsServer).ListForProject(ctx, in) 459 } 460 info := &grpc.UnaryServerInfo{ 461 Server: srv, 462 FullMethod: "/luci.analysis.v1.Metrics/ListForProject", 463 } 464 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 465 return srv.(MetricsServer).ListForProject(ctx, req.(*ListProjectMetricsRequest)) 466 } 467 return interceptor(ctx, in, info, handler) 468 } 469 470 var _Metrics_serviceDesc = grpc.ServiceDesc{ 471 ServiceName: "luci.analysis.v1.Metrics", 472 HandlerType: (*MetricsServer)(nil), 473 Methods: []grpc.MethodDesc{ 474 { 475 MethodName: "ListForProject", 476 Handler: _Metrics_ListForProject_Handler, 477 }, 478 }, 479 Streams: []grpc.StreamDesc{}, 480 Metadata: "go.chromium.org/luci/analysis/proto/v1/metrics.proto", 481 }