go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/analysis/proto/v1/metrics.proto (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  syntax = "proto3";
    16  
    17  package luci.analysis.v1;
    18  
    19  option go_package = "go.chromium.org/luci/analysis/proto/v1;analysispb";
    20  
    21  // Provides information about metrics in LUCI Analysis.
    22  service Metrics {
    23      // ListForProject lists metrics in a given LUCI Project.
    24      // Designed to follow aip.dev/132.
    25      rpc ListForProject(ListProjectMetricsRequest) returns (ListProjectMetricsResponse) {};
    26  }
    27  
    28  // A request to list metrics in a given LUCI project.
    29  message ListProjectMetricsRequest {
    30      // The parent LUCI Project, which owns the collection of metrics.
    31      // Format: projects/{project}.
    32      string parent = 1;
    33  
    34      // Currently does not comply with aip.dev/132 as page_size and
    35      // page_token are missing. These should be added in future.
    36      // For now, the method is guaranteed to return all metrics.
    37  }
    38  
    39  // Lists the metrics available in a LUCI Project.
    40  // Designed to follow aip.dev/132.
    41  message ListProjectMetricsResponse {
    42      // The metrics available in the LUCI Project.
    43      repeated ProjectMetric metrics = 1;
    44  
    45      // TODO: Add next_page_token to comply with aip.dev/132.
    46  }
    47  
    48  // A metric with LUCI project-specific configuration attached.
    49  message ProjectMetric {
    50      // The resource name of the metric.
    51      // Format: projects/{project}/metrics/{metric_id}.
    52      // See aip.dev/122 for more.
    53      string name = 1;
    54  
    55      // The identifier of the metric.
    56      // Follows the pattern: ^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$.
    57      string metric_id = 2;
    58  
    59      // A human readable name for the metric. E.g.
    60      // "User CLs Failed Presubmit".
    61      string human_readable_name = 3;
    62  
    63      // A human readable description of the metric. Normally
    64      // this appears in a help popup near the metric.
    65      string description = 4;
    66  
    67      // Whether the metric should be shown by default in
    68      // the cluster listing and on cluster pages.
    69      bool is_default = 5;
    70  
    71      // SortPriority defines the order by which metrics are sorted by default.
    72      // The metric with the highest sort priority will define the
    73      // (default) primary sort order, followed by the metric with the
    74      // second highest sort priority, and so on.
    75      // Each metric is guaranteed to have a unique sort priority.
    76      int32 sort_priority = 6;
    77  
    78      // Next ID: 7.
    79  }