Просмотр исходного кода

[real-time] rename metric label to align with common name (#24732)

GitOrigin-RevId: fd161f2345f0c30aa82395dbca673025698f13fe
Jakob Ackermann 1 год назад
Родитель
Сommit
ca111771c2

+ 2 - 2
services/real-time/app/js/ConnectedUsersManager.js

@@ -88,7 +88,7 @@ module.exports = {
       }
       const [, nConnectedClients] = res
       Metrics.inc('editing_session_mode', 1, {
-        mode: cursorData ? 'update' : 'connect',
+        method: cursorData ? 'update' : 'connect',
         status: nConnectedClients === 1 ? 'single' : 'multi',
       })
       callback(err)
@@ -141,7 +141,7 @@ module.exports = {
             ? 'single'
             : 'multi'
       Metrics.inc('editing_session_mode', 1, {
-        mode: 'disconnect',
+        method: 'disconnect',
         status,
       })
       if (status === 'empty') {

+ 7 - 7
services/real-time/test/unit/js/ConnectedUsersManagerTests.js

@@ -277,7 +277,7 @@ describe('ConnectedUsersManager', function () {
           nConnectedClients: 1,
           cursorData: null,
           labels: {
-            mode: 'connect',
+            method: 'connect',
             status: 'single',
           },
         },
@@ -285,7 +285,7 @@ describe('ConnectedUsersManager', function () {
           nConnectedClients: 2,
           cursorData: null,
           labels: {
-            mode: 'connect',
+            method: 'connect',
             status: 'multi',
           },
         },
@@ -293,7 +293,7 @@ describe('ConnectedUsersManager', function () {
           nConnectedClients: 1,
           cursorData: { row: 42 },
           labels: {
-            mode: 'update',
+            method: 'update',
             status: 'single',
           },
         },
@@ -301,7 +301,7 @@ describe('ConnectedUsersManager', function () {
           nConnectedClients: 2,
           cursorData: { row: 42 },
           labels: {
-            mode: 'update',
+            method: 'update',
             status: 'multi',
           },
         },
@@ -388,21 +388,21 @@ describe('ConnectedUsersManager', function () {
         'should bump the metric when disconnecting from now empty room': {
           nConnectedClients: 0,
           labels: {
-            mode: 'disconnect',
+            method: 'disconnect',
             status: 'empty',
           },
         },
         'should bump the metric when disconnecting from now single room': {
           nConnectedClients: 1,
           labels: {
-            mode: 'disconnect',
+            method: 'disconnect',
             status: 'single',
           },
         },
         'should bump the metric when disconnecting from now multi room': {
           nConnectedClients: 2,
           labels: {
-            mode: 'disconnect',
+            method: 'disconnect',
             status: 'multi',
           },
         },