Skip to content

gracefully handle and warn about zero-gap between events for frequency estimate#87

Open
lasch wants to merge 1 commit intomainfrom
tolerant_zero_gap
Open

gracefully handle and warn about zero-gap between events for frequency estimate#87
lasch wants to merge 1 commit intomainfrom
tolerant_zero_gap

Conversation

@lasch
Copy link
Member

@lasch lasch commented Mar 17, 2026

More gracefully handle division by zero in src/aiu_trace_analyzer/pipeline/normalize.py and add user feedback:

Changes made:

  1. Added a new TraceWarning called "zero_gap_time" to track events with identical timestamps
  2. Added check for gap_time > 0 before calculating frequency
  3. When gap_time is 0, the code now:
    • Increments the warning counter via self.warnings["zero_gap_time"].update()
    • Falls back to using dur_freq instead of attempting division by zero

Users will now receive feedback about how many events had identical timestamps, helping them identify potential timestamp issues in their trace data. The warning message explains that this causes unreliable interval-based frequency calculation.

…y estimate

Signed-off-by: Lars Schneidenbach <schneidenbach@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant