Repository navigation
feat: add time to first deploy distribution query, /api/time-to-deploy and Histogram component (fixes #11) - #59
Closed
evandroribeiro94 wants to merge 1 commit into
Conversation
…y and Histogram component (fixes devodii#11)
|
Someone is attempting to deploy a commit to the Payroutes OSS Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #11.
Calculates and visualizes the preparation velocity across hackathon projects — how fast teams progressed from their first commit inside the hack window to their first smart contract deployment on Stellar testnet:
Deploy Timing Calculation & Pure Bucketing (
queries.py):DEPLOY_DELTAS_SQL: computes the elapsed minutes between project starting timestamp (first commit in window, or repo creation time if inside window, or window start if repo predated the window) andmin(deployed_at)across attributed contracts.compute_deploy_histogram: pure, deterministic bucketing function grouping deltas into 30-minute intervals (0-30m,30-60m, etc.) and computing the true median.fetch_time_to_deploy: aggregates across verified & likely projects while respecting opt-out filtering.Schema & API Endpoint (
schemas.py&routes.py):TimeToDeployResponseandDeployBucketPydantic models.GET /api/time-to-deployreturningtotal_projects,median_minutes, andbuckets.Frontend Histogram & Overview Card (
apps/web):Histogramchart component (apps/web/src/components/charts/histogram.tsx) using Recharts and shadcn chart primitives with an annotated reference line for the median.useTimeToDeployhook (apps/web/src/hooks/use-time-to-deploy.ts).TimeToDeployCardon the home page insideOverview(apps/web/src/components/overview.tsx) directly under the timeline chart.Verification
pytest apps/api/tests/test_time_to_deploy.py: 3/3 passed in 3.38s[15, 45, 75]) produces exact buckets (0-30m,30-60m,60-90m) and median45.0m.TestClient.ruff check src/ tests/: 0 errorspnpm build(tsc -b && vite build): Built cleanly in 1.98s (0 errors)pnpm oxlint: 0 errorspnpm prettier: All files formatted