Bug 1776931 - Use types for SpiderMonkey telemetry. r=jandem,jonco

Similar to Glean FoG, use types for telemetry metrics. For our existing probes,
this is mainly about using TimeDuration directly. The reported values continue
to be unchanged.

Differential Revision: https://phabricator.services.mozilla.com/D150659
This commit is contained in:
Ted Campbell
2022-07-21 17:51:36 +00:00
parent f5b74e0bb7
commit b800cab6d6
7 changed files with 132 additions and 68 deletions

View File

@@ -1316,7 +1316,7 @@ static bool SetPromiseRejectionTrackerCallback(JSContext* cx, unsigned argc,
// clang-format off
static const char* telemetryNames[static_cast<int>(JSMetric::Count)] = {
#define LIT(NAME) #NAME,
#define LIT(NAME, _) #NAME,
FOR_EACH_JS_METRIC(LIT)
#undef LIT
};
@@ -1359,7 +1359,7 @@ static void WriteTelemetryDataToDisk(const char* dir) {
return true;
};
for (int id = 0; id < size_t(JSMetric::Count); id++) {
for (size_t id = 0; id < size_t(JSMetric::Count); id++) {
auto clear = MakeScopeExit([&] { telemetryResults[id].clearAndFree(); });
if (!initOutput(telemetryNames[id])) {
continue;