Skip to content

Commit

Permalink
Merge pull request #4603 from zenoss/bugfix/ZEN-35085.6x
Browse files Browse the repository at this point in the history
Fixed converting a ConfigStatus into a tuple.
  • Loading branch information
jpeacock-zenoss authored Nov 8, 2024
2 parents bd101c8 + 06459aa commit 29bf0e5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Products/ZenCollector/configcache/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,20 @@ def task(self):
if self._store is None:
client = getRedisClient(url=getRedisUrl())
self._store = createObject("deviceconfigcache-store", client)
self._collect()
self._reporter.save()
try:
self._collect()
self._reporter.save()
except Exception:
logging.getLogger("zen.configcache.manager.metrics").exception(
"failed to collect/record metrics"
)

def _collect(self):
counts = Counter()
ages = defaultdict(list)
now = time()
for status in self._store.query_statuses():
key, uid, ts = attr.astuple(status)
key, ts = attr.astuple(status)
ages[type(status)].append(int(now - ts))
counts.update([type(status)])

Expand Down

0 comments on commit 29bf0e5

Please sign in to comment.