forked from shaba/openuds
added number of services in cache for stats
This commit is contained in:
parent
1b4060a727
commit
13ec1877de
@ -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 = {}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user