tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

metric.proto (2964B)


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