[MM-60609][MM-60612] Include Desktop App metrics in PerformanceReporter, add metrics in Prometheus for CPU/Memory usage (#28825)

* [MM-60609][MM-60612] Include Desktop App metrics in PerformanceReporter, add metrics in Prometheus for CPU/Memory usage

* Fix mocks

* PR feedback
Этот коммит содержится в:
Devin Binnie
2024-10-22 12:16:20 -04:00
коммит произвёл GitHub
родитель 2d96053012
Коммит 0c90b0363b
12 изменённых файлов: 141 добавлений и 22 удалений

Просмотреть файл

@@ -30,6 +30,9 @@ const (
MobileClientChannelSwitchDuration MetricType = "mobile_channel_switch"
MobileClientTeamSwitchDuration MetricType = "mobile_team_switch"
DesktopClientCPUUsage MetricType = "desktop_cpu"
DesktopClientMemoryUsage MetricType = "desktop_memory"
performanceReportTTLMilliseconds = 300 * 1000 // 300 seconds/5 minutes
)
@@ -104,8 +107,9 @@ func (r *PerformanceReport) IsValid() error {
func (r *PerformanceReport) ProcessLabels() map[string]string {
return map[string]string{
"platform": processLabel(r.Labels, "platform", acceptedPlatforms, "other"),
"agent": processLabel(r.Labels, "agent", acceptedAgents, "other"),
"platform": processLabel(r.Labels, "platform", acceptedPlatforms, "other"),
"agent": processLabel(r.Labels, "agent", acceptedAgents, "other"),
"desktop_app_version": r.Labels["desktop_app_version"],
}
}