diff --git a/server/src/uds/core/util/stats/counters.py b/server/src/uds/core/util/stats/counters.py index c069cc10..94bd79f1 100644 --- a/server/src/uds/core/util/stats/counters.py +++ b/server/src/uds/core/util/stats/counters.py @@ -47,8 +47,8 @@ CounterClass = typing.TypeVar('CounterClass', Provider, Service, ServicePool, Au # Posible counters, note that not all are used by every posible type # FIRST_COUNTER_TYPE, LAST_COUNTER_TYPE are just a placeholder for sanity checks ( - CT_LOAD, CT_STORAGE, CT_ASSIGNED, CT_INUSE, CT_AUTH_USERS, CT_AUTH_USERS_WITH_SERVICES, CT_AUTH_SERVICES -) = range(7) + CT_LOAD, CT_STORAGE, CT_ASSIGNED, CT_INUSE, CT_AUTH_USERS, CT_AUTH_USERS_WITH_SERVICES, CT_AUTH_SERVICES, CT_CACHED +) = range(8) __caRead: typing.Dict = {} __caWrite: typing.Dict = {} diff --git a/server/src/uds/core/workers/stats_collector.py b/server/src/uds/core/workers/stats_collector.py index 23a25068..ee6cbe73 100644 --- a/server/src/uds/core/workers/stats_collector.py +++ b/server/src/uds/core/workers/stats_collector.py @@ -63,8 +63,13 @@ class DeployedServiceStatsCollector(Job): ) assigned = fltr.count() inUse = fltr.filter(in_use=True).count() + # Cached user services + cached = servicePool.cachedUserServices().exclude( + state__in=State.INFO_STATES + ).count() counters.addCounter(servicePool, counters.CT_ASSIGNED, assigned) counters.addCounter(servicePool, counters.CT_INUSE, inUse) + counters.addCounter(servicePool, counters.CT_CACHED, cached) except Exception: logger.exception( 'Getting counters for service pool %s', servicePool.name