Add platform information for push notification metrics (#27460)

* Add platform information for push notification metrics

* Address feedback

* Add the client platform returned by the devices to the normalize function

* Add "no platform" platform label to distinguish from unknown
Этот коммит содержится в:
Daniel Espino García
2024-07-05 09:34:01 +02:00
коммит произвёл GitHub
родитель 6bbf7bbb9f
Коммит e5a3dd7fea
15 изменённых файлов: 122 добавлений и 105 удалений

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

@@ -96,12 +96,12 @@ type MetricsInterface interface {
SetReplicaLagAbsolute(node string, value float64)
SetReplicaLagTime(node string, value float64)
IncrementNotificationCounter(notificationType model.NotificationType)
IncrementNotificationAckCounter(notificationType model.NotificationType)
IncrementNotificationSuccessCounter(notificationType model.NotificationType)
IncrementNotificationErrorCounter(notificationType model.NotificationType, errorReason model.NotificationReason)
IncrementNotificationNotSentCounter(notificationType model.NotificationType, notSentReason model.NotificationReason)
IncrementNotificationUnsupportedCounter(notificationType model.NotificationType, notSentReason model.NotificationReason)
IncrementNotificationCounter(notificationType model.NotificationType, platform string)
IncrementNotificationAckCounter(notificationType model.NotificationType, platform string)
IncrementNotificationSuccessCounter(notificationType model.NotificationType, platform string)
IncrementNotificationErrorCounter(notificationType model.NotificationType, errorReason model.NotificationReason, platform string)
IncrementNotificationNotSentCounter(notificationType model.NotificationType, notSentReason model.NotificationReason, platform string)
IncrementNotificationUnsupportedCounter(notificationType model.NotificationType, notSentReason model.NotificationReason, platform string)
ObserveClientTimeToFirstByte(platform, agent string, elapsed float64)
ObserveClientFirstContentfulPaint(platform, agent string, elapsed float64)

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

@@ -168,34 +168,34 @@ func (_m *MetricsInterface) IncrementMemCacheMissCounterSession() {
_m.Called()
}
// IncrementNotificationAckCounter provides a mock function with given fields: notificationType
func (_m *MetricsInterface) IncrementNotificationAckCounter(notificationType model.NotificationType) {
_m.Called(notificationType)
// IncrementNotificationAckCounter provides a mock function with given fields: notificationType, platform
func (_m *MetricsInterface) IncrementNotificationAckCounter(notificationType model.NotificationType, platform string) {
_m.Called(notificationType, platform)
}
// IncrementNotificationCounter provides a mock function with given fields: notificationType
func (_m *MetricsInterface) IncrementNotificationCounter(notificationType model.NotificationType) {
_m.Called(notificationType)
// IncrementNotificationCounter provides a mock function with given fields: notificationType, platform
func (_m *MetricsInterface) IncrementNotificationCounter(notificationType model.NotificationType, platform string) {
_m.Called(notificationType, platform)
}
// IncrementNotificationErrorCounter provides a mock function with given fields: notificationType, errorReason
func (_m *MetricsInterface) IncrementNotificationErrorCounter(notificationType model.NotificationType, errorReason model.NotificationReason) {
_m.Called(notificationType, errorReason)
// IncrementNotificationErrorCounter provides a mock function with given fields: notificationType, errorReason, platform
func (_m *MetricsInterface) IncrementNotificationErrorCounter(notificationType model.NotificationType, errorReason model.NotificationReason, platform string) {
_m.Called(notificationType, errorReason, platform)
}
// IncrementNotificationNotSentCounter provides a mock function with given fields: notificationType, notSentReason
func (_m *MetricsInterface) IncrementNotificationNotSentCounter(notificationType model.NotificationType, notSentReason model.NotificationReason) {
_m.Called(notificationType, notSentReason)
// IncrementNotificationNotSentCounter provides a mock function with given fields: notificationType, notSentReason, platform
func (_m *MetricsInterface) IncrementNotificationNotSentCounter(notificationType model.NotificationType, notSentReason model.NotificationReason, platform string) {
_m.Called(notificationType, notSentReason, platform)
}
// IncrementNotificationSuccessCounter provides a mock function with given fields: notificationType
func (_m *MetricsInterface) IncrementNotificationSuccessCounter(notificationType model.NotificationType) {
_m.Called(notificationType)
// IncrementNotificationSuccessCounter provides a mock function with given fields: notificationType, platform
func (_m *MetricsInterface) IncrementNotificationSuccessCounter(notificationType model.NotificationType, platform string) {
_m.Called(notificationType, platform)
}
// IncrementNotificationUnsupportedCounter provides a mock function with given fields: notificationType, notSentReason
func (_m *MetricsInterface) IncrementNotificationUnsupportedCounter(notificationType model.NotificationType, notSentReason model.NotificationReason) {
_m.Called(notificationType, notSentReason)
// IncrementNotificationUnsupportedCounter provides a mock function with given fields: notificationType, notSentReason, platform
func (_m *MetricsInterface) IncrementNotificationUnsupportedCounter(notificationType model.NotificationType, notSentReason model.NotificationReason, platform string) {
_m.Called(notificationType, notSentReason, platform)
}
// IncrementPostBroadcast provides a mock function with given fields: