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

Any range statistics for graphs #267

Merged
merged 11 commits into from
Oct 21, 2024
Merged

Conversation

owl352
Copy link
Collaborator

@owl352 owl352 commented Sep 23, 2024

Issue

At this moment, we can get statistic only for 1h, 24h, 3d, 1w timespan's with fixed intervals (12 per timespan)

Things done

At this PR, was implemented generator for intervals, whose steps we can easily customize
Also now we take as input not timespan, but start= and end=, which allows date in ISO format (2024-01-01T00:00:00Z)
Also, integration tests for transaction statistics have been implemented and tests for validator statistics have been updated

We would also like to note that we can control the minimum number of steps for timespan. The current implementation does not allow us to set the maximum number of steps for a timespan, but it allows us to partially fix this by smooth transitions between steps. Current settings allow to get no more than 12 intervals (5 minutes in 1 hour min), and an infinite number of timespans when scheduling by years (max unit), but not less than 3

@owl352 owl352 added the backend Related to backend (API) label Sep 23, 2024
@owl352 owl352 self-assigned this Sep 23, 2024
Copy link

vercel bot commented Sep 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
platform-explorer-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 21, 2024 3:39pm
platform-explorer-testnet 🛑 Canceled (Inspect) Oct 21, 2024 3:39pm

@owl352 owl352 requested a review from pshenmic September 23, 2024 20:39
packages/api/src/utils.js Outdated Show resolved Hide resolved
# Conflicts:
#	packages/api/src/controllers/ValidatorsController.js
#	packages/api/src/utils.js
#	packages/api/test/integration/validators.spec.js
@pshenmic pshenmic merged commit df16347 into master Oct 21, 2024
9 checks passed
@owl352 owl352 deleted the feat/custom-period-statistics branch November 23, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend (API)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants