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

GitOrigin-RevId: fd161f2345f0c30aa82395dbca673025698f13fe
This commit is contained in:
Jakob Ackermann
2025-04-09 08:05:33 +00:00
committed by Copybot
parent dadf6f0ed4
commit ca111771c2
2 changed files with 9 additions and 9 deletions
@@ -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') {
@@ -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',
},
},