1// -*- mode: C++ -*- 2 3// AUTOGENERATED BY glean_parser. DO NOT EDIT. 4 5/* This Source Code Form is subject to the terms of the Mozilla Public 6 * License, v. 2.0. If a copy of the MPL was not distributed with this 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 8 9#ifndef mozilla_Metrics_h 10#define mozilla_Metrics_h 11 12#include "mozilla/glean/bindings/MetricTypes.h" 13#include "mozilla/Tuple.h" 14#include "mozilla/Maybe.h" 15#include "nsTArray.h" 16#include "nsPrintfCString.h" 17 18namespace mozilla::glean { 19struct NoExtraKeys; 20 21namespace test { 22 /** 23 * generated from test.boolean_metric 24 */ 25 /** 26 * A multi-line 27 * description 28 */ 29 constexpr impl::BooleanMetric boolean_metric(1); 30 31 /** 32 * generated from test.labeled_boolean_metric 33 */ 34 /** 35 * A multi-line 36 * description 37 */ 38 constexpr impl::Labeled<impl::BooleanMetric> labeled_boolean_metric(2); 39 40 /** 41 * generated from test.labeled_boolean_metric_labels 42 */ 43 /** 44 * A multi-line 45 * description 46 */ 47 constexpr impl::Labeled<impl::BooleanMetric> labeled_boolean_metric_labels(3); 48 49 /** 50 * generated from test.counter_metric 51 */ 52 /** 53 * A multi-line 54 * description 55 */ 56 constexpr impl::CounterMetric counter_metric(4); 57 58 /** 59 * generated from test.labeled_counter_metric 60 */ 61 /** 62 * A multi-line 63 * description 64 */ 65 constexpr impl::Labeled<impl::CounterMetric> labeled_counter_metric(5); 66 67 /** 68 * generated from test.labeled_counter_metric_labels 69 */ 70 /** 71 * A multi-line 72 * description 73 */ 74 constexpr impl::Labeled<impl::CounterMetric> labeled_counter_metric_labels(6); 75 76 /** 77 * generated from test.string_metric 78 */ 79 /** 80 * A multi-line 81 * description 82 */ 83 constexpr impl::StringMetric string_metric(7); 84 85 /** 86 * generated from test.labeled_string_metric 87 */ 88 /** 89 * A multi-line 90 * description 91 */ 92 constexpr impl::Labeled<impl::StringMetric> labeled_string_metric(8); 93 94 /** 95 * generated from test.labeled_string_metric_labels 96 */ 97 /** 98 * A multi-line 99 * description 100 */ 101 constexpr impl::Labeled<impl::StringMetric> labeled_string_metric_labels(9); 102 103 /** 104 * generated from test.string_list_metric 105 */ 106 /** 107 * A multi-line 108 * description 109 */ 110 constexpr impl::StringListMetric string_list_metric(10); 111 112 /** 113 * generated from test.timespan_metric 114 */ 115 /** 116 * A multi-line 117 * description 118 */ 119 constexpr impl::TimespanMetric timespan_metric(11); 120 121 /** 122 * generated from test.timing_distribution_metric 123 */ 124 /** 125 * A multi-line 126 * description 127 */ 128 constexpr impl::TimingDistributionMetric timing_distribution_metric(12); 129 130 /** 131 * generated from test.memory_distribution_metric 132 */ 133 /** 134 * A multi-line 135 * description 136 */ 137 constexpr impl::MemoryDistributionMetric memory_distribution_metric(13); 138 139 /** 140 * generated from test.custom_distribution_metric 141 */ 142 /** 143 * A multi-line 144 * description 145 */ 146 constexpr impl::CustomDistributionMetric custom_distribution_metric(14); 147 148} 149namespace test_nested { 150 /** 151 * generated from test.nested.uuid_metric 152 */ 153 /** 154 * A multi-line 155 * description 156 */ 157 constexpr impl::UuidMetric uuid_metric(15); 158 159 /** 160 * generated from test.nested.datetime_metric 161 */ 162 /** 163 * A multi-line 164 * description 165 */ 166 constexpr impl::DatetimeMetric datetime_metric(16); 167 168 /** 169 * generated from test.nested.event_metric 170 */ 171 /** 172 * A multi-line 173 * description 174 */ 175 constexpr impl::EventMetric<NoExtraKeys> event_metric(17); 176 177 /** 178 * generated from test.nested.event_metric_with_extra 179 */ 180 struct EventMetricWithExtraExtra { 181 mozilla::Maybe<nsCString> anExtraKey; 182 mozilla::Maybe<nsCString> anotherExtraKey; 183 184 Tuple<nsTArray<uint32_t>, nsTArray<nsCString>> ToFfiExtra() const { 185 nsTArray<uint32_t> extraKeys; 186 nsTArray<nsCString> extraValues; 187 if (anExtraKey) { 188 extraKeys.AppendElement(0); 189 extraValues.EmplaceBack(anExtraKey.value()); 190 } 191 if (anotherExtraKey) { 192 extraKeys.AppendElement(1); 193 extraValues.EmplaceBack(anotherExtraKey.value()); 194 } 195 return MakeTuple(std::move(extraKeys), std::move(extraValues)); 196 } 197 }; 198 /** 199 * A multi-line 200 * description 201 */ 202 constexpr impl::EventMetric<EventMetricWithExtraExtra> event_metric_with_extra(18); 203 204 /** 205 * generated from test.nested.quantity_metric 206 */ 207 /** 208 * A multi-line 209 * description 210 */ 211 constexpr impl::QuantityMetric quantity_metric(19); 212 213} 214 215} // namespace mozilla::glean 216 217#endif // mozilla_Metrics_h 218