20260623 迁移231并固定相位调度
This commit is contained in:
@@ -243,6 +243,7 @@ def load_routinator_repo_sets(errors):
|
||||
failed = set()
|
||||
duration = {}
|
||||
object_counts = {}
|
||||
publication_point_states = {}
|
||||
for metric in ["routinator_rrdp_status", "routinator_rsync_status"]:
|
||||
for labels, value in parse_prometheus_samples(text, metric):
|
||||
uri = labels.get("uri")
|
||||
@@ -254,6 +255,20 @@ def load_routinator_repo_sets(errors):
|
||||
success.add(uri)
|
||||
else:
|
||||
failed.add(uri)
|
||||
for labels, value in parse_prometheus_samples(text, "routinator_repository_publication_points_total"):
|
||||
uri = labels.get("uri")
|
||||
state = labels.get("state", "unknown")
|
||||
if not uri:
|
||||
continue
|
||||
total.add(uri)
|
||||
publication_point_states.setdefault(uri, {})[state] = publication_point_states.setdefault(uri, {}).get(state, 0.0) + value
|
||||
for uri, states in publication_point_states.items():
|
||||
valid_count = states.get("valid", 0.0)
|
||||
non_valid_count = sum(value for state, value in states.items() if state != "valid")
|
||||
if valid_count > 0:
|
||||
success.add(uri)
|
||||
elif non_valid_count > 0:
|
||||
failed.add(uri)
|
||||
for metric in ["routinator_rrdp_duration", "routinator_rsync_duration"]:
|
||||
for labels, value in parse_prometheus_samples(text, metric):
|
||||
uri = labels.get("uri")
|
||||
@@ -261,6 +276,7 @@ def load_routinator_repo_sets(errors):
|
||||
duration[uri] = max(duration.get(uri, 0.0), value)
|
||||
for labels, value in parse_prometheus_samples(text, "routinator_repository_objects_total"):
|
||||
add_object_count(object_counts, labels.get("uri"), labels.get("type"), value)
|
||||
failed = failed - success
|
||||
return {"total": total, "success": success, "failed": failed, "duration": duration, "object_counts": object_counts}
|
||||
|
||||
def emit_repo_diff_metrics(out, errors):
|
||||
|
||||
Reference in New Issue
Block a user