gecko-dev/toolkit/components/glean/pytest/gifft_output_Histogram
Chris H-C 480dae9adf Bug 1705394 - Split FOG MLA impls from their headers r=TravisLong
Not doing Event because generic template impls must be in headers.

Basically a machine translation, but you might notice I had to inline
some static functions in the generated header-only map files?
That's because otherwise we'll get complaints from the build system that
those functions are unused in the files where they're unused.

The alternative would be to split those map files into headers and impls.
Which is more work than is needed for this bug.

Differential Revision: https://phabricator.services.mozilla.com/D115022
2021-05-13 19:04:17 +00:00

44 lines
1.2 KiB
C++

// -*- mode: C++ -*-
/* This file is auto-generated by run_glean_parser.py.
It is only for internal use by types in
toolkit/components/glean/bindings/private */
#include "mozilla/Maybe.h"
#include "mozilla/Telemetry.h"
#include "mozilla/DataMutex.h"
#ifndef mozilla_glean_HistogramGifftMap_h
#define mozilla_glean_HistogramGifftMap_h
namespace mozilla::glean {
using Telemetry::HistogramID;
typedef uint64_t TimerId; // Same as in TimingDistribution.h.
typedef StaticDataMutex<UniquePtr<nsTHashMap<TimerId, TimeStamp>>> TimerToStampMutex;
static inline TimerToStampMutex::AutoLock GetTimerIdToStartsLock() {
static TimerToStampMutex sTimerIdToStarts("sTimerIdToStarts");
auto lock = sTimerIdToStarts.Lock();
if (!*lock) {
*lock = MakeUnique<nsTHashMap<TimerId, TimeStamp>>();
}
return lock;
}
static Maybe<HistogramID> HistogramIdForMetric(uint32_t aId) {
switch(aId) {
case 12: { // test.timing_distribution_metric
return Some(HistogramID::SOME_TIME_HISTOGRAM_MS);
}
case 13: { // test.memory_distribution_metric
return Some(HistogramID::SOME_MEM_HISTOGRAM_KB);
}
default: {
return Nothing();
}
}
}
} // namespace mozilla::glean
#endif // mozilla_glean_HistogramGifftMaps_h