Skip to content

Commit 4fb166a

Browse files
committed
Send active and inactive connections
1 parent 1128970 commit 4fb166a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/compass-connections/src/stores/connections-store-redux.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,16 @@ const connectWithOptions = (
17391739
getExtraConnectionData(connectionInfo),
17401740
]);
17411741

1742+
const connections = getState().connections;
1743+
// Counting all connections, we need to filter out any connections currently being created
1744+
const totalConnectionsCount = Object.values(
1745+
connections.byId
1746+
).filter(({ isBeingCreated }) => !isBeingCreated).length;
1747+
const activeConnectionsCount =
1748+
getActiveConnectionsCount(connections);
1749+
const inactiveConnectionsCount =
1750+
totalConnectionsCount - activeConnectionsCount;
1751+
17421752
return {
17431753
is_atlas: isAtlas,
17441754
atlas_hostname: isAtlas ? resolvedHostname : null,
@@ -1751,6 +1761,8 @@ const connectWithOptions = (
17511761
server_arch: host.arch,
17521762
server_os_family: host.os_family,
17531763
topology_type: dataService.getCurrentTopologyType(),
1764+
num_active_connections: activeConnectionsCount,
1765+
num_inactive_connections: inactiveConnectionsCount,
17541766
...extraInfo,
17551767
};
17561768
},

0 commit comments

Comments
 (0)