mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-08 04:42:11 +02:00
fix(ontology): guard against missing cache_type label in metric parsing
Fixes #873 Signed-off-by: SAY-5 <say.apm35@gmail.com>
This commit is contained in:
parent
159b1e2824
commit
df36d9f84e
1 changed files with 5 additions and 3 deletions
|
|
@ -474,9 +474,11 @@ class PerformanceMonitor:
|
|||
# Cache performance
|
||||
cache_types = set()
|
||||
for metric_name in self.metrics_collector.counters.keys():
|
||||
if 'cache_type=' in metric_name:
|
||||
cache_type = metric_name.split('cache_type=')[1].split(',')[0].split('}')[0]
|
||||
cache_types.add(cache_type)
|
||||
parts = metric_name.split('cache_type=')
|
||||
if len(parts) < 2:
|
||||
continue
|
||||
cache_type = parts[1].split(',')[0].split('}')[0]
|
||||
cache_types.add(cache_type)
|
||||
|
||||
for cache_type in cache_types:
|
||||
labels = {'cache_type': cache_type}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue