Skip to content

Conversation

@inqrphl
Copy link
Contributor

@inqrphl inqrphl commented Nov 5, 2025

There might be a better place to put the transformation function to.

Additionally, I save checks where I can perform time keyword transformations in a map. If there is an object detailing different checks, maybe adding a flag that says to transform keywords for time, size , percentage etc. is better.

I also did not run any tests yet.

…arseArgs. The code checks the check task type before doing any conversions. Currently it only converts timestamps
@lgmu
Copy link
Contributor

lgmu commented Nov 6, 2025

Would be great if it would be more generic.
So we can use "5 days ago","2 months ago", ...

@datamuc
Copy link
Contributor

datamuc commented Nov 6, 2025

Would be great if it would be more generic. So we can use "5 days ago","2 months ago", ...

how long is a month? :)

there is already

func ExpandDuration(val string) (res float64, err error) {
used in check_event_log and check_cpu...

Ahmet Oeztuerk and others added 7 commits November 6, 2025 18:03
- add the ability to ascertain the beginning of this week this_day i.e today, this_week, this_month, this_year
- add the ability to move forward/backward in time using the suffixes 'ago' and 'from_now_on'
- add the ability to parse arbitrary numbers for the temporal move, as long as its given in digits
- now move in time with the library function, is more robust against leap days etc.
- integrate the parsing of such time keywords into the unit system. now these types of time phrases can be used anywhere in the code
…combinations

- integrate date keyword parsing better into the conditional operand parsing. If the regex for detecting an operand fails, it also tries to parse it as a date keyword.
- more explanatory errors in conditional parsing. Fix error propagation, previously some cases were just returning nils
- write a test function for parsing the date keyword
…rectly to the next steps.

- Fix a logic error in the time parser test
- Make time parser test linux only
- Trying to pass CI tests
- Fix linter errors about function and variable names
…l locally. The CI pipeline might be messing with the folder.
…the condition

- the date parsing now uses this timezone when determining times
- stop using time.UTC or time.Local except for testing.
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.

4 participants