From 1dc0fe25c7813ac0a653f9edd0c6ce9ef7dd0ede Mon Sep 17 00:00:00 2001 From: Michelle Brier Date: Fri, 20 Oct 2023 20:14:32 -0700 Subject: [PATCH 1/7] port changes over --- .../IndividualServiceApiCallsChart.tsx | 45 ++++++ .../IndividualServiceApiCallsChart/index.tsx | 1 + .../IndividualServiceUniqueUsersChart.tsx | 45 ++++++ .../index.tsx | 1 + .../components/NodeOverview/NodeOverview.tsx | 140 +++++++++--------- .../src/containers/Node/Node.module.css | 17 ++- 6 files changed, 182 insertions(+), 67 deletions(-) create mode 100644 protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx create mode 100644 protocol-dashboard/src/components/IndividualServiceApiCallsChart/index.tsx create mode 100644 protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/IndividualServiceUniqueUsersChart.tsx create mode 100644 protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/index.tsx diff --git a/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx b/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx new file mode 100644 index 00000000000..2c33fb882cb --- /dev/null +++ b/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx @@ -0,0 +1,45 @@ +import LineChart from 'components/LineChart' +import React, { useState } from 'react' +import { useIndividualServiceApiCalls } from 'store/cache/analytics/hooks' +import { Bucket, MetricError } from 'store/cache/analytics/slice' + +type OwnProps = { + node: string +} + +type IndividualServiceApiCallsChartProps = OwnProps + +const IndividualServiceApiCallsChart: React.FC = ({ + node +}) => { + const [bucket, setBucket] = useState(Bucket.MONTH) + + const { apiCalls } = useIndividualServiceApiCalls(node, bucket) + let error, labels, data + if (apiCalls === MetricError.ERROR) { + error = true + labels = [] + data = [] + } else { + labels = + apiCalls?.map( + a => new Date(parseInt(a.timestamp, 10) * 1000).getTime() / 1000 + ) ?? null + data = apiCalls?.map(a => a.count) ?? null + } + return ( + setBucket(option as Bucket)} + showLeadingDay + /> + ) +} + +export default IndividualServiceApiCallsChart diff --git a/protocol-dashboard/src/components/IndividualServiceApiCallsChart/index.tsx b/protocol-dashboard/src/components/IndividualServiceApiCallsChart/index.tsx new file mode 100644 index 00000000000..e36da82bddd --- /dev/null +++ b/protocol-dashboard/src/components/IndividualServiceApiCallsChart/index.tsx @@ -0,0 +1 @@ +export { default } from './IndividualServiceApiCallsChart' diff --git a/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/IndividualServiceUniqueUsersChart.tsx b/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/IndividualServiceUniqueUsersChart.tsx new file mode 100644 index 00000000000..b25dd7baabf --- /dev/null +++ b/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/IndividualServiceUniqueUsersChart.tsx @@ -0,0 +1,45 @@ +import LineChart from 'components/LineChart' +import React, { useState } from 'react' +import { useIndividualServiceApiCalls } from 'store/cache/analytics/hooks' +import { Bucket, MetricError } from 'store/cache/analytics/slice' + +type OwnProps = { + node: string +} + +type IndividualServiceUniqueUsersChartProps = OwnProps + +const IndividualServiceUniqueUsersChart: React.FC = ({ + node +}) => { + const [bucket, setBucket] = useState(Bucket.MONTH) + + const { apiCalls } = useIndividualServiceApiCalls(node, bucket) + let error, labels, data + if (apiCalls === MetricError.ERROR) { + error = true + labels = [] + data = [] + } else { + labels = + apiCalls?.map( + a => new Date(parseInt(a.timestamp, 10) * 1000).getTime() / 1000 + ) ?? null + data = apiCalls?.map(a => a.unique_count) ?? null + } + return ( + setBucket(option as Bucket)} + showLeadingDay + /> + ) +} + +export default IndividualServiceUniqueUsersChart diff --git a/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/index.tsx b/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/index.tsx new file mode 100644 index 00000000000..cf51d38aa75 --- /dev/null +++ b/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/index.tsx @@ -0,0 +1 @@ +export { default } from './IndividualServiceUniqueUsersChart' diff --git a/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx b/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx index 2af57935e7a..520c805dab4 100644 --- a/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx +++ b/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx @@ -80,6 +80,7 @@ type NodeOverviewProps = { isOwner?: boolean isDeregistered?: boolean isUnregistered?: boolean + isLoading: boolean } const NodeOverview = ({ @@ -92,6 +93,7 @@ const NodeOverview = ({ isOwner, isDeregistered, isUnregistered + isLoading }: NodeOverviewProps) => { const { isOpen, onClick, onClose } = useModalControls() const { health, status, error } = useNodeHealth(endpoint, serviceType) @@ -252,76 +254,82 @@ const NodeOverview = ({ return ( -
-
- {serviceType === ServiceType.DiscoveryProvider - ? messages.dp - : messages.cn} -
- {isDeregistered && ( -
{messages.deregistered}
- )} - {!isDeregistered && ( -
- {`${messages.version} ${health?.version || version || 'unknown'}`} + {isLoading ? ( + + ) : ( + <> +
+
+ {serviceType === ServiceType.DiscoveryProvider + ? messages.dp + : messages.cn} +
+ {isDeregistered && ( +
{messages.deregistered}
+ )} + {!isDeregistered && ( +
+ {`${messages.version} ${health?.version || version || 'unknown'}`} +
+ )} + {!isDeregistered && isUnregistered && ( + <> +
- )} - {!isDeregistered && isUnregistered && ( - <> -
- - {(operatorWallet || health?.operatorWallet) && ( - - )} - {(delegateOwnerWallet || health?.delegateOwnerWallet) && ( - + )} + {healthDetails} + )} - {healthDetails} ) } diff --git a/protocol-dashboard/src/containers/Node/Node.module.css b/protocol-dashboard/src/containers/Node/Node.module.css index 63695afca69..76b1509681b 100644 --- a/protocol-dashboard/src/containers/Node/Node.module.css +++ b/protocol-dashboard/src/containers/Node/Node.module.css @@ -1,4 +1,19 @@ .container { - display: inline-flex; width: 100%; } + +.section { + margin-bottom: 16px; + display: flex; + margin-left: -8px; + margin-right: -8px; +} + +.section > * { + width: 100%; + margin: 0 8px; +} + +.chart { + min-height: 340px; +} From e23662c206da869df31a016cd4fdcc12153dfb57 Mon Sep 17 00:00:00 2001 From: Michelle Brier Date: Fri, 20 Oct 2023 20:36:35 -0700 Subject: [PATCH 2/7] missed some files --- .../NodeOverview/NodeOverview.module.css | 7 ++ .../src/containers/Node/Node.tsx | 70 ++++++++++++------- .../src/store/cache/analytics/hooks.ts | 69 ++++++++++++++++-- .../src/store/cache/analytics/slice.ts | 25 ++++++- 4 files changed, 135 insertions(+), 36 deletions(-) diff --git a/protocol-dashboard/src/components/NodeOverview/NodeOverview.module.css b/protocol-dashboard/src/components/NodeOverview/NodeOverview.module.css index 2eaa948896e..075ef366bea 100644 --- a/protocol-dashboard/src/components/NodeOverview/NodeOverview.module.css +++ b/protocol-dashboard/src/components/NodeOverview/NodeOverview.module.css @@ -5,6 +5,13 @@ display: inline-flex; flex-direction: column; box-sizing: border-box; + min-height: 240px; +} + +.loading { + margin: 42px auto 0; + justify-content: center; + align-items: center; } .header { diff --git a/protocol-dashboard/src/containers/Node/Node.tsx b/protocol-dashboard/src/containers/Node/Node.tsx index 3985c574af7..d7c1edbe9d7 100644 --- a/protocol-dashboard/src/containers/Node/Node.tsx +++ b/protocol-dashboard/src/containers/Node/Node.tsx @@ -14,6 +14,9 @@ import { SERVICES, NOT_FOUND } from 'utils/routes' +import IndividualServiceApiCallsChart from 'components/IndividualServiceApiCallsChart' +import clsx from 'clsx' +import IndividualServiceUniqueUsersChart from 'components/IndividualServiceUniqueUsersChart' const messages = { title: 'SERVICE', @@ -22,59 +25,72 @@ const messages = { } type ContentNodeProps = { spID: number; accountWallet: Address | undefined } -const ContentNode = ({ spID, accountWallet }: ContentNodeProps) => { +const ContentNode: React.FC = ({ + spID, + accountWallet +}: ContentNodeProps) => { const { node: contentNode, status } = useContentNode({ spID }) if (status === Status.Failure) { return null - } else if (status === Status.Loading) { - return null } - // TODO: compare owner with the current user - const isOwner = accountWallet === contentNode!.owner + const isOwner = accountWallet === contentNode?.owner ?? false return ( ) } -type DiscoveryProviderProps = { +type DiscoveryNodeProps = { spID: number accountWallet: Address | undefined } -const DiscoveryProvider = ({ spID, accountWallet }: DiscoveryProviderProps) => { - const { node: discoveryProvider, status } = useDiscoveryProvider({ spID }) +const DiscoveryNode: React.FC = ({ + spID, + accountWallet +}: DiscoveryNodeProps) => { + const { node: discoveryNode, status } = useDiscoveryProvider({ spID }) const pushRoute = usePushRoute() if (status === Status.Failure) { pushRoute(NOT_FOUND) return null - } else if (status === Status.Loading) { - return null } - const isOwner = accountWallet === discoveryProvider!.owner + const isOwner = accountWallet === discoveryNode?.owner ?? false return ( - + <> +
+ +
+ {discoveryNode ? ( +
+ + +
+ ) : null} + ) } @@ -92,7 +108,7 @@ const Node = () => { defaultPreviousPageRoute={SERVICES} > {isDiscovery ? ( - + ) : ( )} diff --git a/protocol-dashboard/src/store/cache/analytics/hooks.ts b/protocol-dashboard/src/store/cache/analytics/hooks.ts index 2abfea97029..5c90fe56d4c 100644 --- a/protocol-dashboard/src/store/cache/analytics/hooks.ts +++ b/protocol-dashboard/src/store/cache/analytics/hooks.ts @@ -16,13 +16,14 @@ import { CountRecord, setTopApps, setTrailingTopGenres, - MetricError + MetricError, + setIndividualServiceApiCalls } from './slice' import { useEffect, useState } from 'react' import { useAverageBlockTime, useEthBlockNumber } from '../protocol/hooks' import { weiAudToAud } from 'utils/numeric' import { ELECTRONIC_SUB_GENRES } from './genres' -import { fetchWithLibs } from 'utils/fetch' +import { fetchWithLibs, fetchWithTimeout } from 'utils/fetch' import { AnyAction } from '@reduxjs/toolkit' dayjs.extend(duration) @@ -118,6 +119,10 @@ export const getTrailingTopGenres = ( : null export const getTopApps = (state: AppState, { bucket }: { bucket: Bucket }) => state.cache.analytics.topApps ? state.cache.analytics.topApps[bucket] : null +export const getIndividualServiceApiCalls = ( + state: AppState, + { node, bucket }: { node: string; bucket: Bucket } +) => state.cache.analytics.individualServiceApiCalls?.[node]?.[bucket] ?? null // -------------------------------- Thunk Actions --------------------------------- @@ -151,20 +156,38 @@ export function fetchApiCalls( } } +/** + * Fetches time series data from a discovery node + * @param route The route to fetch from (plays, routes) + * @param bucket The bucket size + * @param clampDays Whether or not to remove partial current day + * @param node An optional node to make the request against + * @returns the metric itself or a MetricError + */ async function fetchTimeSeries( route: string, bucket: Bucket, - clampDays: boolean = true + clampDays: boolean = true, + node?: string ) { const startTime = getStartTime(bucket, clampDays) let error = false let metric: TimeSeriesRecord[] = [] try { const bucketSize = BUCKET_GRANULARITY_MAP[bucket] - const data = (await fetchWithLibs({ - endpoint: `v1/metrics/${route}`, - queryParams: { bucket_size: bucketSize, start_time: startTime } - })) as any + let data + if (node) { + data = ( + await fetchWithTimeout( + `${node}/v1/metrics/${route}?bucket_size=${bucketSize}&start_time=${startTime}` + ) + ).data.slice(1) // Trim off the first day so we don't show partial data + } else { + data = await fetchWithLibs({ + endpoint: `v1/metrics/${route}`, + queryParams: { bucket_size: bucketSize, start_time: startTime } + }) + } metric = data.reverse() } catch (e) { console.error(e) @@ -192,6 +215,16 @@ export function fetchPlays( } } +export function fetchIndividualServiceRouteMetrics( + node: string, + bucket: Bucket +): ThunkAction> { + return async dispatch => { + const metric = await fetchTimeSeries('routes', bucket, true, node) + dispatch(setIndividualServiceApiCalls({ node, metric, bucket })) + } +} + export function fetchTotalStaked( bucket: Bucket, averageBlockTime: number, @@ -404,6 +437,28 @@ export const useApiCalls = (bucket: Bucket) => { return { apiCalls } } +export const useIndividualServiceApiCalls = (node: string, bucket: Bucket) => { + const [doOnce, setDoOnce] = useState(null) + const apiCalls = useSelector(state => + getIndividualServiceApiCalls(state as AppState, { node, bucket }) + ) + const dispatch = useDispatch() + useEffect(() => { + if (doOnce !== bucket && (apiCalls === null || apiCalls === undefined)) { + setDoOnce(bucket) + dispatch(fetchIndividualServiceRouteMetrics(node, bucket)) + } + }, [dispatch, apiCalls, bucket, node, doOnce]) + + useEffect(() => { + if (apiCalls) { + setDoOnce(null) + } + }, [apiCalls, setDoOnce]) + + return { apiCalls } +} + export const useTotalStaked = (bucket: Bucket) => { const [doOnce, setDoOnce] = useState(null) const totalStaked = useSelector(state => diff --git a/protocol-dashboard/src/store/cache/analytics/slice.ts b/protocol-dashboard/src/store/cache/analytics/slice.ts index 3c2bdfa27fb..b0405122279 100644 --- a/protocol-dashboard/src/store/cache/analytics/slice.ts +++ b/protocol-dashboard/src/store/cache/analytics/slice.ts @@ -39,6 +39,10 @@ export type State = { topApps: CountMetric trailingTopGenres: CountMetric trailingApiCalls: CountMetric + individualServiceApiCalls: { + // Mapping of node endpoint to TimeSeriesMetric + [node: string]: TimeSeriesMetric + } } export const initialState: State = { @@ -47,7 +51,8 @@ export const initialState: State = { plays: {}, topApps: {}, trailingTopGenres: {}, - trailingApiCalls: {} + trailingApiCalls: {}, + individualServiceApiCalls: {} } type SetApiCalls = { metric: TimeSeriesRecord[] | MetricError; bucket: Bucket } @@ -62,6 +67,11 @@ type SetTrailingTopGenres = { bucket: Bucket } type SetTrailingApiCalls = { metric: CountRecord | MetricError; bucket: Bucket } +type SetIndividualServiceApiCalls = { + node: string + metric: TimeSeriesRecord[] | MetricError + bucket: Bucket +} const slice = createSlice({ name: 'analytics', @@ -96,6 +106,16 @@ const slice = createSlice({ ) => { const { metric, bucket } = action.payload state.trailingApiCalls[bucket] = metric + }, + setIndividualServiceApiCalls: ( + state, + action: PayloadAction + ) => { + const { node, metric, bucket } = action.payload + if (!state.individualServiceApiCalls[node]) { + state.individualServiceApiCalls[node] = {} + } + state.individualServiceApiCalls[node][bucket] = metric } } }) @@ -106,7 +126,8 @@ export const { setPlays, setTopApps, setTrailingTopGenres, - setTrailingApiCalls + setTrailingApiCalls, + setIndividualServiceApiCalls } = slice.actions export default slice.reducer From b77cbdb9ef53282cbd4bc703a349a1461907b61b Mon Sep 17 00:00:00 2001 From: Michelle Brier Date: Fri, 20 Oct 2023 22:01:10 -0700 Subject: [PATCH 3/7] fix after using updated routes endpoint --- .../IndividualServiceApiCallsChart.tsx | 6 ++---- .../IndividualServiceUniqueUsersChart.tsx | 4 +--- protocol-dashboard/src/store/cache/analytics/hooks.ts | 9 ++++++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx b/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx index 2c33fb882cb..514c3fde65b 100644 --- a/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx +++ b/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx @@ -22,10 +22,8 @@ const IndividualServiceApiCallsChart: React.FC new Date(parseInt(a.timestamp, 10) * 1000).getTime() / 1000 - ) ?? null - data = apiCalls?.map(a => a.count) ?? null + apiCalls?.map(a => new Date(a.timestamp).getTime() / 1000) ?? null + data = apiCalls?.map(a => a.total_count) ?? null } return ( new Date(parseInt(a.timestamp, 10) * 1000).getTime() / 1000 - ) ?? null + apiCalls?.map(a => new Date(a.timestamp).getTime() / 1000) ?? null data = apiCalls?.map(a => a.unique_count) ?? null } return ( diff --git a/protocol-dashboard/src/store/cache/analytics/hooks.ts b/protocol-dashboard/src/store/cache/analytics/hooks.ts index 5c90fe56d4c..b759ddd3caa 100644 --- a/protocol-dashboard/src/store/cache/analytics/hooks.ts +++ b/protocol-dashboard/src/store/cache/analytics/hooks.ts @@ -176,11 +176,14 @@ async function fetchTimeSeries( try { const bucketSize = BUCKET_GRANULARITY_MAP[bucket] let data + let endpoint = `${node}/v1/metrics/${route}?bucket_size=${bucketSize}&start_time=${startTime}` + if (route === 'routes') { + endpoint = `${node}/v1/metrics/aggregates/${route}/${bucket}?bucket_size=${bucketSize}` + } + console.log(`MICHELLE BUCKET ${bucket} BUCKET SIZE ${bucketSize}`) if (node) { data = ( - await fetchWithTimeout( - `${node}/v1/metrics/${route}?bucket_size=${bucketSize}&start_time=${startTime}` - ) + await fetchWithTimeout(endpoint) ).data.slice(1) // Trim off the first day so we don't show partial data } else { data = await fetchWithLibs({ From 52a6fc33179096643bcae40d47bf0930548f041f Mon Sep 17 00:00:00 2001 From: Michelle Brier Date: Fri, 20 Oct 2023 22:05:04 -0700 Subject: [PATCH 4/7] Remove console.log --- protocol-dashboard/src/store/cache/analytics/hooks.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/protocol-dashboard/src/store/cache/analytics/hooks.ts b/protocol-dashboard/src/store/cache/analytics/hooks.ts index b759ddd3caa..d1d20f3d829 100644 --- a/protocol-dashboard/src/store/cache/analytics/hooks.ts +++ b/protocol-dashboard/src/store/cache/analytics/hooks.ts @@ -180,7 +180,6 @@ async function fetchTimeSeries( if (route === 'routes') { endpoint = `${node}/v1/metrics/aggregates/${route}/${bucket}?bucket_size=${bucketSize}` } - console.log(`MICHELLE BUCKET ${bucket} BUCKET SIZE ${bucketSize}`) if (node) { data = ( await fetchWithTimeout(endpoint) From 8e105e9ef67c8359890265cecbfaccea06794f6c Mon Sep 17 00:00:00 2001 From: Michelle Brier Date: Fri, 20 Oct 2023 22:14:14 -0700 Subject: [PATCH 5/7] lint --- .../IndividualServiceApiCallsChart.tsx | 3 +-- .../IndividualServiceUniqueUsersChart.tsx | 3 +-- protocol-dashboard/src/store/cache/analytics/hooks.ts | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx b/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx index 514c3fde65b..cf2ef473b33 100644 --- a/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx +++ b/protocol-dashboard/src/components/IndividualServiceApiCallsChart/IndividualServiceApiCallsChart.tsx @@ -21,8 +21,7 @@ const IndividualServiceApiCallsChart: React.FC new Date(a.timestamp).getTime() / 1000) ?? null + labels = apiCalls?.map(a => new Date(a.timestamp).getTime() / 1000) ?? null data = apiCalls?.map(a => a.total_count) ?? null } return ( diff --git a/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/IndividualServiceUniqueUsersChart.tsx b/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/IndividualServiceUniqueUsersChart.tsx index 6cf09adc692..94b2a438556 100644 --- a/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/IndividualServiceUniqueUsersChart.tsx +++ b/protocol-dashboard/src/components/IndividualServiceUniqueUsersChart/IndividualServiceUniqueUsersChart.tsx @@ -21,8 +21,7 @@ const IndividualServiceUniqueUsersChart: React.FC new Date(a.timestamp).getTime() / 1000) ?? null + labels = apiCalls?.map(a => new Date(a.timestamp).getTime() / 1000) ?? null data = apiCalls?.map(a => a.unique_count) ?? null } return ( diff --git a/protocol-dashboard/src/store/cache/analytics/hooks.ts b/protocol-dashboard/src/store/cache/analytics/hooks.ts index d1d20f3d829..ed37cbf0a69 100644 --- a/protocol-dashboard/src/store/cache/analytics/hooks.ts +++ b/protocol-dashboard/src/store/cache/analytics/hooks.ts @@ -176,14 +176,12 @@ async function fetchTimeSeries( try { const bucketSize = BUCKET_GRANULARITY_MAP[bucket] let data - let endpoint = `${node}/v1/metrics/${route}?bucket_size=${bucketSize}&start_time=${startTime}` + let endpoint = `${node}/v1/metrics/${route}?bucket_size=${bucketSize}&start_time=${startTime}` if (route === 'routes') { endpoint = `${node}/v1/metrics/aggregates/${route}/${bucket}?bucket_size=${bucketSize}` } if (node) { - data = ( - await fetchWithTimeout(endpoint) - ).data.slice(1) // Trim off the first day so we don't show partial data + data = (await fetchWithTimeout(endpoint)).data.slice(1) // Trim off the first day so we don't show partial data } else { data = await fetchWithLibs({ endpoint: `v1/metrics/${route}`, From fff60ef0d1f182fa9212a8c13d3c66c79e807b50 Mon Sep 17 00:00:00 2001 From: Michelle Brier Date: Fri, 27 Oct 2023 11:40:46 -0700 Subject: [PATCH 6/7] use new endpoint --- protocol-dashboard/src/store/cache/analytics/hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol-dashboard/src/store/cache/analytics/hooks.ts b/protocol-dashboard/src/store/cache/analytics/hooks.ts index ed37cbf0a69..4d519d65984 100644 --- a/protocol-dashboard/src/store/cache/analytics/hooks.ts +++ b/protocol-dashboard/src/store/cache/analytics/hooks.ts @@ -178,7 +178,7 @@ async function fetchTimeSeries( let data let endpoint = `${node}/v1/metrics/${route}?bucket_size=${bucketSize}&start_time=${startTime}` if (route === 'routes') { - endpoint = `${node}/v1/metrics/aggregates/${route}/${bucket}?bucket_size=${bucketSize}` + endpoint = `${node}/v1/metrics/routes/${bucket}?bucket_size=${bucketSize}` } if (node) { data = (await fetchWithTimeout(endpoint)).data.slice(1) // Trim off the first day so we don't show partial data From 0dda4a134c5de68247b84d369654ca1371fec96b Mon Sep 17 00:00:00 2001 From: Michelle Brier Date: Tue, 31 Oct 2023 13:31:14 -0700 Subject: [PATCH 7/7] Fix typo after rebase --- protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx b/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx index 520c805dab4..1536b7d76f5 100644 --- a/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx +++ b/protocol-dashboard/src/components/NodeOverview/NodeOverview.tsx @@ -92,7 +92,7 @@ const NodeOverview = ({ delegateOwnerWallet, isOwner, isDeregistered, - isUnregistered + isUnregistered, isLoading }: NodeOverviewProps) => { const { isOpen, onClick, onClose } = useModalControls()