• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 *  Copyright (c) 2022 The WebRTC project authors. All Rights Reserved.
3 *
4 *  Use of this source code is governed by a BSD-style license
5 *  that can be found in the LICENSE file in the root of the source
6 *  tree. An additional intellectual property rights grant can be found
7 *  in the file PATENTS.  All contributing project authors may
8 *  be found in the AUTHORS file in the root of the source tree.
9 */
10
11syntax = "proto3";
12
13package webrtc.test_metrics;
14
15// Root message of the proto file. Contains collection of all the metrics.
16message MetricsSet {
17  repeated Metric metrics = 1;
18}
19
20enum Unit {
21  // Default value that has to be defined.
22  UNDEFINED_UNIT = 0;
23  // General unitless value. Can be used either for dimensionless quantities
24  // (ex ratio) or for units not presented in this enum and too specific to add
25  // to this enum.
26  UNITLESS = 1;
27  MILLISECONDS = 2;
28  PERCENT = 3;
29  BYTES = 4;
30  KILOBITS_PER_SECOND = 5;
31  HERTZ = 6;
32  COUNT = 7;
33}
34
35enum ImprovementDirection {
36  // Default value that has to be defined.
37  UNDEFINED_IMPROVEMENT_DIRECTION = 0;
38  BIGGER_IS_BETTER = 1;
39  NEITHER_IS_BETTER = 2;
40  SMALLER_IS_BETTER = 3;
41}
42
43// Single performance metric with all related metadata.
44message Metric {
45  // Metric name, for example PSNR, SSIM, decode_time, etc.
46  string name = 1;
47  Unit unit = 2;
48  ImprovementDirection improvement_direction = 3;
49  // If the metric is generated by a test, this field can be used to specify
50  // this information.
51  string test_case = 4;
52  // Metadata associated with the whole metric.
53  map<string, string> metric_metadata = 5;
54
55  message TimeSeries {
56    message Sample {
57      // Timestamp in microseconds associated with a sample. For example,
58      // the timestamp when the sample was collected.
59      int64 timestamp_us = 1;
60      double value = 2;
61      // Metadata associated with this particular sample.
62      map<string, string> sample_metadata = 3;
63    }
64    // All samples collected for this metric. It can be empty if the Metric
65    // object only contains `stats`.
66    repeated Sample samples = 1;
67  }
68  // Contains all samples of the metric collected during test execution.
69  // It can be empty if the user only stores precomputed statistics into
70  // `stats`.
71  TimeSeries time_series = 6;
72
73  // Contains metric's precomputed statistics based on the `time_series` or if
74  // `time_series` is omitted (has 0 samples) contains precomputed statistics
75  // provided by the metric's calculator.
76  message Stats {
77    // Sample mean of the metric
78    // (https://en.wikipedia.org/wiki/Sample_mean_and_covariance).
79    optional double mean = 1;
80    // Standard deviation (https://en.wikipedia.org/wiki/Standard_deviation).
81    // Is undefined if `time_series` contains only a single sample.
82    optional double stddev = 2;
83    optional double min = 3;
84    optional double max = 4;
85  }
86  Stats stats = 7;
87}
88