12#ifndef O2_FRAMEWORK_DEVICEMETRICSINFO_H_
13#define O2_FRAMEWORK_DEVICEMETRICSINFO_H_
106 if constexpr (std::is_same_v<T, int>) {
108 }
else if constexpr (std::is_same_v<T, uint64_t>) {
110 }
else if constexpr (std::is_same_v<T, StringMetric>) {
112 }
else if constexpr (std::is_same_v<T, float>) {
114 }
else if constexpr (std::is_same_v<T, int8_t>) {
117 static_assert(always_static_assert_v<T>,
"Unsupported type");
176 template <typename T, size_t I = metricStorageSize<T>()>
179 if constexpr (std::is_same_v<T, int>) {
181 }
else if constexpr (std::is_same_v<T, uint64_t>) {
183 }
else if constexpr (std::is_same_v<T, StringMetric>) {
185 }
else if constexpr (std::is_same_v<T, float>) {
187 }
else if constexpr (std::is_same_v<T, int8_t>) {
190 static_assert(always_static_assert_v<T>,
"Unsupported type");
196 for (
auto& info : infos) {
197 info.intMetrics.clear();
198 info.uint64Metrics.clear();
199 info.stringMetrics.clear();
200 info.floatMetrics.clear();
201 info.enumMetrics.clear();
202 info.intTimestamps.clear();
203 info.uint64Timestamps.clear();
204 info.floatTimestamps.clear();
205 info.stringTimestamps.clear();
206 info.enumTimestamps.clear();
209 info.average.clear();
210 info.minDomain.clear();
211 info.maxDomain.clear();
212 info.metricLabels.clear();
213 info.metricPrefixes.clear();
214 info.metricLabelsAlphabeticallySortedIdx.clear();
215 info.metricLabelsPrefixesSortedIdx.clear();
216 info.metrics.clear();
217 info.changed.clear();
223 size_t totalSize = 0;
224 for (
auto& info : infos) {
235 totalSize += info.max.size() *
sizeof(float);
236 totalSize += info.min.size() *
sizeof(float);
237 totalSize += info.average.size() *
sizeof(float);
238 totalSize += info.minDomain.size() *
sizeof(size_t);
239 totalSize += info.maxDomain.size() *
sizeof(size_t);
240 totalSize += info.metricLabels.size() *
sizeof(
MetricLabel);
241 totalSize += info.metricPrefixes.size() *
sizeof(
MetricPrefix);
242 totalSize += info.metricLabelsAlphabeticallySortedIdx.size() *
sizeof(
MetricLabelIndex);
243 totalSize += info.metricLabelsPrefixesSortedIdx.size() *
sizeof(
MetricPrefixIndex);
244 totalSize += info.metrics.size() *
sizeof(
MetricInfo);
245 totalSize += info.changed.size() *
sizeof(bool);
#define O2_BUILTIN_UNREACHABLE
GLint GLint GLsizei GLint GLenum GLenum type
GLuint GLsizei const GLchar * label
Defining PrimaryVertex explicitly as messageable.
std::array< size_t, metricStorageSize< T >()> TimestampsStorage
constexpr size_t metricStorageSize()
std::ostream & operator<<(std::ostream &s, ChannelType const &type)
Stream operators so that we can use ChannelType with Boost.Test.
std::array< T, metricStorageSize< T >()> MetricsStorage
static std::array< T, I > const & get(DeviceMetricsInfo const &info, size_t metricIdx)
static size_t metricsStorageSize(gsl::span< DeviceMetricsInfo const > infos)
static void clearMetrics(std::vector< DeviceMetricsInfo > &infos)
std::vector< size_t > maxDomain
std::vector< MetricsStorage< float > > floatMetrics
std::vector< float > average
std::vector< MetricsStorage< StringMetric > > stringMetrics
std::vector< std::array< size_t, metricStorageSize< int8_t >()> > enumTimestamps
std::vector< MetricsStorage< uint64_t > > uint64Metrics
std::vector< MetricsStorage< int > > intMetrics
std::vector< MetricPrefix > metricPrefixes
std::vector< std::array< size_t, metricStorageSize< float >()> > floatTimestamps
std::vector< MetricLabel > metricLabels
std::vector< std::array< size_t, metricStorageSize< uint64_t >()> > uint64Timestamps
std::vector< std::array< size_t, metricStorageSize< StringMetric >()> > stringTimestamps
std::vector< size_t > minDomain
std::vector< bool > changed
std::vector< MetricPrefixIndex > metricLabelsPrefixesSortedIdx
std::vector< MetricLabelIndex > metricLabelsAlphabeticallySortedIdx
std::vector< MetricInfo > metrics
std::vector< MetricsStorage< int8_t > > enumMetrics
std::vector< std::array< size_t, metricStorageSize< int >()> > intTimestamps
static constexpr size_t MAX_METRIC_LABEL_SIZE
static constexpr size_t MAX_METRIC_PREFIX_SIZE
char prefix[MAX_METRIC_PREFIX_SIZE]
Temporary struct to hold a metric after it has been parsed.
char const * beginStringValue
char const * endStringValue
static constexpr ptrdiff_t MAX_SIZE