siglens icon indicating copy to clipboard operation
siglens copied to clipboard

Fix Search traces with min/max duration with timeunits

Open ksankeerth opened this issue 11 months ago • 2 comments

  • before this fix, siglens doesn't have support for searching with time duration of different units
  • If search example 'search latency>0.5ms' would fail with errors
  • the fix avoids converting time duration with units to string

Description

  • Before convert values like "10s", "10ms", "10ds", "10cs" to string directly, PEG grammer will try to convert as time duration. If that fails only, they will be converted to String
  • Added new evaluation struct TimeDuration and some additional grammer rules for avoid string conversions for time duration
  • Moved and modified GetIntervalInMillis function to different file for reusing

Fixes #574

Testing

  • added tests

Checklist:

Before marking your pull request as ready for review, complete the following.

  • [X] I have self-reviewed this PR.
  • [X] I have removed all print-debugging and commented-out code that should not be merged.
  • [X] I have added sufficient comments in my code, particularly in hard-to-understand areas.
  • [X] I have formatted the code, if applicable. For Go, I have run goimports -w ..

ksankeerth avatar Mar 21 '24 04:03 ksankeerth