Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve universe stats #396

Merged
merged 10 commits into from
Jul 14, 2023
Merged

Improve universe stats #396

merged 10 commits into from
Jul 14, 2023

Conversation

guggero
Copy link
Member

@guggero guggero commented Jul 12, 2023

Depends on #389.

Fixes #367.

This PR addresses items 2, 3, 4 and 5 of #367.

@jamaljsr can you please check if this is what you need?

@guggero guggero force-pushed the asset-stats-improvements branch 3 times, most recently from 47cac50 to cb9b7e2 Compare July 13, 2023 08:51
@guggero guggero requested review from jharveyb and ffranr July 13, 2023 08:54
@ffranr ffranr closed this Jul 13, 2023
@ffranr ffranr deleted the asset-stats-improvements branch July 13, 2023 15:21
@guggero guggero restored the asset-stats-improvements branch July 13, 2023 15:21
@guggero guggero reopened this Jul 13, 2023
Copy link
Collaborator

@jharveyb jharveyb left a comment

Choose a reason for hiding this comment

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

Looks good! Cool to have a migration in + DB-specific logic support.

rpcserver.go Show resolved Hide resolved
tapdb/universe_stats_test.go Show resolved Hide resolved
Copy link
Contributor

@ffranr ffranr left a comment

Choose a reason for hiding this comment

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

There's a lot of work here, good job Oli on getting it together!

I would question whether we need to aggregate the events data at all. Or at least whether it makes sense to aggregate by day. That seems like the sort of thing we could just ask a client to do for the time being.

If we are to aggregate, I wonder if we could just keep the aggregation window as an argument.

I see that the terminal team requested this level of aggregation (5 here: #367)

tapdb/sqlc/queries/universe.sql Show resolved Hide resolved
rpcserver.go Show resolved Hide resolved
tapdb/universe.go Outdated Show resolved Hide resolved
tapdb/universe.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
tapdb/sqlc/queries/universe.sql Show resolved Hide resolved
tapdb/universe_stats.go Show resolved Hide resolved
tapdb/universe_stats.go Show resolved Hide resolved
tapdb/universe_stats.go Show resolved Hide resolved
In a next commit we'll want to be able to better test asset events which
are always inserted into the DB with a timestamp of `time.Now()`.
In order to be able to influence what time is actually written to the
DB, we use the `clock.Now()` value that can be overwritten in unit
tests.
@guggero guggero requested a review from ffranr July 14, 2023 15:27
Copy link
Contributor

@ffranr ffranr left a comment

Choose a reason for hiding this comment

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

🥳

@guggero guggero added this pull request to the merge queue Jul 14, 2023
Merged via the queue into main with commit 29984dc Jul 14, 2023
12 checks passed
@guggero guggero deleted the asset-stats-improvements branch July 14, 2023 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Additional improvements for the stats RPCs
4 participants