Skip to content

Commit

Permalink
fixes the bug on monitoring time with small rescheduling time like pr…
Browse files Browse the repository at this point in the history
…ometheus

Signed-off-by: Tullio Sebastiani <[email protected]>
  • Loading branch information
tsebastiani authored and chaitanyaenr committed Jul 16, 2024
1 parent d687e7a commit 7fb464f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/krkn_lib/k8s/krkn_kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2902,6 +2902,9 @@ def __monitor_pods_worker(
# no pods have been killed or pods have been killed and
# respawned with the same names
if set(pods_and_namespaces) == set(current_pods_and_namespaces):
for pod in current_pods_and_namespaces:
if not self.is_pod_running(pod[0], pod[1]):
missing_pods.add(pod)
if len(missing_pods) == 0:
continue
# in this case the pods to wait have been respawn
Expand Down Expand Up @@ -2959,7 +2962,7 @@ def __monitor_pods_worker(
# sum the time elapsed waiting before the pod
# has been rescheduled (rescheduling time)
# to the effective recovery time of the pod
result.pod_rescheduling_time = time.time() - start_time
result.pod_rescheduling_time = time.time() - start_time - result.pod_readiness_time
result.total_recovery_time = (
result.pod_readiness_time
+ result.pod_rescheduling_time
Expand Down

0 comments on commit 7fb464f

Please sign in to comment.