Generated file

Copy as Markdown

Other Tools

// AUTOGENERATED BY glean_parser. DO NOT EDIT.
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_GleanPageextractorMetrics_h
#define mozilla_GleanPageextractorMetrics_h
#include "mozilla/glean/bindings/MetricTypes.h"
namespace mozilla::glean {
namespace page_extractor {
/**
* generated from page_extractor.phase
*/
struct PhaseExtra {
mozilla::Maybe<uint32_t> canvasCount;
mozilla::Maybe<uint32_t> durationMs;
mozilla::Maybe<nsCString> errorName;
mozilla::Maybe<nsCString> flowId;
mozilla::Maybe<uint32_t> linkCount;
mozilla::Maybe<nsCString> phase;
mozilla::Maybe<nsCString> process;
mozilla::Maybe<nsCString> siteStrategy;
mozilla::Maybe<nsCString> status;
mozilla::Maybe<nsCString> strategy;
mozilla::Maybe<uint32_t> textLength;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (canvasCount) {
extraKeys.AppendElement()->AssignASCII("canvas_count");
extraValues.AppendElement()->AppendInt(canvasCount.value());
}
if (durationMs) {
extraKeys.AppendElement()->AssignASCII("duration_ms");
extraValues.AppendElement()->AppendInt(durationMs.value());
}
if (errorName) {
extraKeys.AppendElement()->AssignASCII("error_name");
extraValues.EmplaceBack(errorName.value());
}
if (flowId) {
extraKeys.AppendElement()->AssignASCII("flow_id");
extraValues.EmplaceBack(flowId.value());
}
if (linkCount) {
extraKeys.AppendElement()->AssignASCII("link_count");
extraValues.AppendElement()->AppendInt(linkCount.value());
}
if (phase) {
extraKeys.AppendElement()->AssignASCII("phase");
extraValues.EmplaceBack(phase.value());
}
if (process) {
extraKeys.AppendElement()->AssignASCII("process");
extraValues.EmplaceBack(process.value());
}
if (siteStrategy) {
extraKeys.AppendElement()->AssignASCII("site_strategy");
extraValues.EmplaceBack(siteStrategy.value());
}
if (status) {
extraKeys.AppendElement()->AssignASCII("status");
extraValues.EmplaceBack(status.value());
}
if (strategy) {
extraKeys.AppendElement()->AssignASCII("strategy");
extraValues.EmplaceBack(strategy.value());
}
if (textLength) {
extraKeys.AppendElement()->AssignASCII("text_length");
extraValues.AppendElement()->AppendInt(textLength.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* The Glean twin of a "PageExtractor" profiler marker: recorded for every
* phase of every PageExtractor call (headless-extractor, get-text,
* dom-extract, pdf-extract, and so on; see PageExtractorEvent.Phase in
* PageExtractorEvents.sys.mjs), in whichever process it ran, whether or
* not the profiler is running. Smart Window is one caller among possibly
* several.
*
* `flow_id` ties every phase of one call together, and is the same value
* as the `flowId` field on that call's profiler markers. Use it to
* cross-reference a shared profile with this data.
*
* Slice by `phase` for a route's outcome and latency (e.g.
* "headless-extractor" for headless loads, "pdf-extract" for PDFs), by
* `strategy` for how a get-text call read the page ("dom", "reader",
* "youtube-dom", "youtube-transcript", "about-reader"), and by
* `site_strategy` for site-specific handling ("google-search",
* "youtube"). `status` and `error_name` give success rate and failure
* reasons per slice; `duration_ms` gives latency per slice.
*
* `text_length`, `link_count` and `canvas_count` are rounded down to a
* power of two (0 stays 0) so an exact value can't fingerprint the page.
* `duration_ms` measures our own work and is recorded exactly.
*/
constexpr impl::EventMetric<PhaseExtra> phase(5630);
}
} // namespace mozilla::glean
#endif // mozilla_GleanPageextractorMetrics_h