Skip to content

Commit e08ecb8

Browse files
committed
Add additional timing logs
1 parent 73a8ba2 commit e08ecb8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

os_capacity/prometheus.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,22 @@ def collect(self):
317317
conn.compute, conn.placement
318318
)
319319
guages += host_guages
320+
321+
host_time = time.perf_counter()
322+
host_duration = host_time - start_time
323+
print(f"1 of 3 host flavor capacity complete for {collect_id} it took {host_duration} seconds")
324+
320325
guages += get_project_usage(conn.identity, conn.placement, conn.compute)
326+
327+
project_time = time.perf_counter()
328+
project_duration = project_time - host_time
329+
print(f"2 of 3 project usage complete for {collect_id} it took {project_duration} seconds")
330+
321331
guages += get_host_usage(resource_providers, conn.placement)
332+
333+
host_usage_time = time.perf_counter()
334+
host_usage_duration = host_usage_time - project_time
335+
print(f"3 of 3 host usage complete for {collect_id} it took {host_usage_duration} seconds")
322336
except Exception as e:
323337
print(f"error {e}")
324338

0 commit comments

Comments
 (0)