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_GleanAboutprocessesMetrics_h
#define mozilla_GleanAboutprocessesMetrics_h
#include "mozilla/glean/bindings/MetricTypes.h"
namespace mozilla::glean {
namespace resource_monitor {
/**
* generated from resource_monitor.panel_opened
*/
struct PanelOpenedExtra {
mozilla::Maybe<nsCString> openType;
mozilla::Maybe<uint32_t> totalCpuHundredths;
mozilla::Maybe<uint32_t> totalRamMb;
mozilla::Maybe<uint32_t> totalTabCount;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (openType) {
extraKeys.AppendElement()->AssignASCII("open_type");
extraValues.EmplaceBack(openType.value());
}
if (totalCpuHundredths) {
extraKeys.AppendElement()->AssignASCII("total_cpu_hundredths");
extraValues.AppendElement()->AppendInt(totalCpuHundredths.value());
}
if (totalRamMb) {
extraKeys.AppendElement()->AssignASCII("total_ram_mb");
extraValues.AppendElement()->AppendInt(totalRamMb.value());
}
if (totalTabCount) {
extraKeys.AppendElement()->AssignASCII("total_tab_count");
extraValues.AppendElement()->AppendInt(totalTabCount.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* The Resource Monitor tab view was opened. Recorded once it has CPU data to show.
*/
constexpr impl::EventMetric<PanelOpenedExtra> panel_opened(5219);
/**
* generated from resource_monitor.tab_action_taken
*/
struct TabActionTakenExtra {
mozilla::Maybe<nsCString> actionSource;
mozilla::Maybe<nsCString> actionType;
mozilla::Maybe<uint32_t> tabCount;
mozilla::Maybe<uint32_t> tabCpuHundredths;
mozilla::Maybe<uint32_t> tabRamMb;
mozilla::Maybe<uint32_t> totalCpuHundredths;
mozilla::Maybe<uint32_t> totalRamMb;
mozilla::Maybe<uint32_t> totalTabCount;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (actionSource) {
extraKeys.AppendElement()->AssignASCII("action_source");
extraValues.EmplaceBack(actionSource.value());
}
if (actionType) {
extraKeys.AppendElement()->AssignASCII("action_type");
extraValues.EmplaceBack(actionType.value());
}
if (tabCount) {
extraKeys.AppendElement()->AssignASCII("tab_count");
extraValues.AppendElement()->AppendInt(tabCount.value());
}
if (tabCpuHundredths) {
extraKeys.AppendElement()->AssignASCII("tab_cpu_hundredths");
extraValues.AppendElement()->AppendInt(tabCpuHundredths.value());
}
if (tabRamMb) {
extraKeys.AppendElement()->AssignASCII("tab_ram_mb");
extraValues.AppendElement()->AppendInt(tabRamMb.value());
}
if (totalCpuHundredths) {
extraKeys.AppendElement()->AssignASCII("total_cpu_hundredths");
extraValues.AppendElement()->AppendInt(totalCpuHundredths.value());
}
if (totalRamMb) {
extraKeys.AppendElement()->AssignASCII("total_ram_mb");
extraValues.AppendElement()->AppendInt(totalRamMb.value());
}
if (totalTabCount) {
extraKeys.AppendElement()->AssignASCII("total_tab_count");
extraValues.AppendElement()->AppendInt(totalTabCount.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* A user took an action on one or more tabs from the Resource Monitor tab view (about:processes?groupby=tab).
*/
constexpr impl::EventMetric<TabActionTakenExtra> tab_action_taken(5220);
}
} // namespace mozilla::glean
#endif // mozilla_GleanAboutprocessesMetrics_h