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

dashboards should support automated bucketing by number of buckets #8616

Open
Vadman97 opened this issue May 17, 2024 — with Linear · 2 comments
Open

dashboards should support automated bucketing by number of buckets #8616

Vadman97 opened this issue May 17, 2024 — with Linear · 2 comments
Labels

Comments

Copy link
Member

infer bucket width by using current date range / bucket count

@Vadman97 Vadman97 added the waterloo label May 17, 2024 — with Linear
Copy link

linear bot commented May 17, 2024

Copy link

greptile-apps bot commented May 17, 2024

To implement automated bucketing by number of buckets, follow these steps:

  1. Frontend:

    • In /frontend/src/pages/LogsPage/LogsHistogram/LogsHistogram.tsx, update the LogsHistogramChart component to calculate the bucket width by dividing the current date range by the bucket count.
    const bucketWidth = (endDate - startDate) / bucketCount;
    • Pass this bucketWidth to the histogram rendering logic.
  2. Backend:

    • In /backend/clickhouse/query.go, modify the readMetrics function to accept a bucket width parameter and use it to adjust the query for fetching metrics.
    func readMetrics(params ... , bucketWidth int) {
        // Adjust query to use bucketWidth
    }
  3. Graph Component:

    • In /frontend/src/pages/Graphing/components/Graph.tsx, ensure the Graph component can handle dynamic bucket widths by passing the calculated bucketWidth as a prop.
    <Graph bucketWidth={bucketWidth} ... />

References

/frontend/src/pages/LogsPage/LogsHistogram/LogsHistogram.tsx
/frontend/src/pages/Graphing/components/Graph.tsx
/frontend/src/pages/ProjectSettings/ProjectFilters/ProjectFilters.tsx
/frontend/src/components/SearchResultsHistogram/SearchResultsHistogram.tsx
/backend/clickhouse/query.go

Ask Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant