Skip to content

Commit

Permalink
fix: search page all time
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-harris authored and cdxker committed Jan 1, 2025
1 parent 3ea5a57 commit 7d85790
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions frontends/dashboard/src/analytics/components/FilterBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface FilterBarProps {
}

export const timeFrameOptions: AnalyticsParams["granularity"][] = [
"month",
"day",
"hour",
"minute",
Expand Down Expand Up @@ -97,6 +98,10 @@ export const FilterBar = (props: FilterBarProps) => {
label="Date Range"
value={props.filters.filter.date_range}
onChange={(e) => props.setFilters("filter", "date_range", e)}
initialSelectedPresetId={7}
onGranularitySuggestion={(granularity) =>
props.setFilters("granularity", granularity)
}
/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions server/src/operators/analytics_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ pub async fn get_search_usage_graph_query(

let mut query_string = format!(
"SELECT
toStartOfInterval(created_at, INTERVAL {}) AS time_stamp,
CAST(toStartOfInterval(created_at, INTERVAL {}) AS DateTime) AS time_stamp,
count(*) AS requests
FROM
search_queries
Expand Down Expand Up @@ -696,7 +696,7 @@ pub async fn get_latency_graph_query(
),
per_interval_latency AS (
SELECT
toStartOfInterval(second, INTERVAL '1 {}') AS time_stamp,
CAST(toStartOfInterval(second, INTERVAL '1 {}') AS DateTime) AS time_stamp,
avg(latency_per_second) AS average_latency
FROM
per_second_latency
Expand Down

0 comments on commit 7d85790

Please sign in to comment.