Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Enable filtering acorn events output to a given time span #1920

Merged
merged 4 commits into from
Jul 14, 2023

Conversation

njhale
Copy link
Member

@njhale njhale commented Jul 12, 2023

Add two new options to the acorn events subcommand:

  • --since will determine the start of the time span; excludes events
    observed before this point when provided
  • --until will determine the end of the time span; excludes events
    observed after this point when provided

Each option accepts a single argument; arguments can be Unix timestamps,
date formatted timestamps, or Go duration strings(relative to system time).

Addresses #1805

Comment on lines +67 to +74
func NewMicroTime(t time.Time) MicroTime {
return MicroTime(metav1.NewMicroTime(t))
}

func NowMicro() MicroTime {
return NewMicroTime(time.Now())
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Candidates for z?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerslaton Possibly. What did you have in mind? a generic implementation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of just porting these over for discoverability purposes.

@njhale njhale force-pushed the events/filter-time branch from 257806b to 0935a22 Compare July 13, 2023 18:00
@njhale njhale force-pushed the events/filter-time branch from 4f17997 to 0b65a61 Compare July 14, 2023 02:42
@njhale
Copy link
Member Author

njhale commented Jul 14, 2023

Pushed some changes to address @g-linville's feedback (see #1920 (comment)).

Requesting re-reviews

njhale and others added 4 commits July 14, 2023 12:23
Add two new options to the `acorn events` subcommand:
- `--since` will determine the start of the time span; excludes events
  observed before this point when provided
- `--until` will determine the end of the time span; excludes events
  observed after this point when provided

Each option accepts a single argument; arguments can be Unix timestamps,
date formatted timestamps, or Go duration strings(relative to system time).

Signed-off-by: Nick Hale <[email protected]>
Co-authored-by: Tyler Slaton <[email protected]>
Signed-off-by: Nick Hale <[email protected]>
Add support for unix timestamp strings when parsing since and until.

Signed-off-by: Nick Hale <[email protected]>
Co-authored-by: Grant Linville <[email protected]>
Signed-off-by: Nick Hale <[email protected]>
@njhale njhale force-pushed the events/filter-time branch from 87c50fc to 139d7c8 Compare July 14, 2023 16:25
@njhale
Copy link
Member Author

njhale commented Jul 14, 2023

Just pushed a simple rebase. Conflict was small and contained. Tests are passing, so I don't think this requires another round of review. Merging.

@njhale njhale merged commit 474682e into acorn-io:main Jul 14, 2023
@njhale njhale deleted the events/filter-time branch July 14, 2023 16:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants