blob: 3c30f36f49b09c2fc518d528e184a69067f7a204 [file] [log] [blame]
Artem Titovc898c822022-09-14 11:14:021/*
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#include "api/test/metrics/metric.h"
11
12#include <string>
13
14namespace webrtc {
15namespace test {
16
17absl::string_view ToString(Unit unit) {
18 switch (unit) {
Artem Titov539c1da2022-09-20 19:16:1119 case Unit::kMilliseconds:
20 return "Milliseconds";
Artem Titovc898c822022-09-14 11:14:0221 case Unit::kPercent:
22 return "Percent";
Artem Titov539c1da2022-09-20 19:16:1123 case Unit::kBytes:
24 return "Bytes";
Artem Titovc898c822022-09-14 11:14:0225 case Unit::kKilobitsPerSecond:
26 return "KilobitsPerSecond";
27 case Unit::kHertz:
28 return "Hertz";
29 case Unit::kUnitless:
30 return "Unitless";
31 case Unit::kCount:
32 return "Count";
33 }
34}
35
36absl::string_view ToString(ImprovementDirection direction) {
37 switch (direction) {
38 case ImprovementDirection::kBiggerIsBetter:
39 return "BiggerIsBetter";
40 case ImprovementDirection::kNeitherIsBetter:
41 return "NeitherIsBetter";
42 case ImprovementDirection::kSmallerIsBetter:
43 return "SmallerIsBetter";
44 }
45}
46
47} // namespace test
48} // namespace webrtc