Skip to content

Commit

Permalink
Merge pull request #1 from JGreenlee/simpler_stats_timing
Browse files Browse the repository at this point in the history
Simpler stats timing
  • Loading branch information
TeachMeTW authored Oct 17, 2024
2 parents f5b07a4 + 39f763d commit 1bdc922
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 248 deletions.
9 changes: 2 additions & 7 deletions emission/storage/decorations/stats_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ def store_dashboard_time(code_fragment_name: str, timer: ec_timer.Timer):
- code_fragment_name (str): The name of the function or code fragment being timed.
- timer (ec_timer.Timer): The Timer object that records the execution duration.
"""
# Extract the elapsed time in seconds and convert to milliseconds
elapsed_ms = timer.elapsed * 1000 # Convert to milliseconds

# Get the current timestamp in seconds since epoch
timestamp = time.time()

Expand All @@ -68,13 +65,11 @@ def store_dashboard_time(code_fragment_name: str, timer: ec_timer.Timer):
metadata_key="stats/dashboard_time",
name=code_fragment_name,
ts=timestamp,
reading=elapsed_ms
reading=timer.elapsed_ms
)


def store_dashboard_error(code_fragment_name: str, timer: ec_timer.Timer):
elapsed_ms = timer.elapsed * 1000

# Get the current timestamp in seconds since epoch
timestamp = time.time()

Expand All @@ -84,6 +79,6 @@ def store_dashboard_error(code_fragment_name: str, timer: ec_timer.Timer):
metadata_key="stats/dashboard_error",
name=code_fragment_name,
ts=timestamp,
reading=elapsed_ms
reading=timer.elapsed_ms
)

241 changes: 0 additions & 241 deletions emission/tests/funcTests/TestFunctionTiming.py

This file was deleted.

Loading

0 comments on commit 1bdc922

Please sign in to comment.