-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds `--follow` flag to `snow app events` to enable live-tail of events. The command will poll the `get_events` function every 10 seconds (by default, can be changed with `--follow-interval`), printing new rows on each iteration. The way we detect new events is to make a second query filtering on rows where the `timestamp >=` the timestamp of the last row from the old results. The bound needs to be inclusive since there could be new events with the same timestamp in the new results (i.e. the `timestamp` column isn't necessarily monotonic). Since the bound is inclusive, the first few events from the new results would be the same events as the last few events of the old results, which means we need to only print the net-new rows from the new results. We do this by finding the point of largest overlap between the end of the old results and the start of the new results, returning the rows that come after.
- Loading branch information
1 parent
6d1c686
commit 5f412eb
Showing
5 changed files
with
301 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.