Skip to content

Commit

Permalink
Merge pull request #142 from AudiusProject/sd-skip
Browse files Browse the repository at this point in the history
Temporarily skip bad dates
  • Loading branch information
sddioulde authored and michellebrier committed Oct 9, 2023
1 parent 2adc0d5 commit aba352b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import LineChart from 'components/LineChart'
import React, { useState } from 'react'
import { useApiCalls } from 'store/cache/analytics/hooks'
import { Bucket, MetricError } from 'store/cache/analytics/slice'
import { datesToSkip } from 'utils/consts'

type OwnProps = {}

Expand All @@ -17,8 +18,14 @@ const TotalApiCallsChart: React.FC<TotalApiCallsChartProps> = props => {
labels = []
data = []
} else {
labels = apiCalls?.map(a => new Date(a.timestamp).getTime() / 1000) ?? null
data = apiCalls?.map(a => a.total_count) ?? null
labels =
apiCalls
?.filter(a => !datesToSkip.has(a.timestamp))
?.map(a => new Date(a.timestamp).getTime() / 1000) ?? null
data =
apiCalls
?.filter(a => !datesToSkip.has(a.timestamp))
?.map(a => a.total_count) ?? null
}
return (
<LineChart
Expand All @@ -28,7 +35,7 @@ const TotalApiCallsChart: React.FC<TotalApiCallsChartProps> = props => {
data={data}
labels={labels}
selection={bucket}
options={[Bucket.ALL_TIME, Bucket.MONTH, Bucket.WEEK]}
options={[Bucket.ALL_TIME, Bucket.MONTH]}
onSelectOption={(option: string) => setBucket(option as Bucket)}
showLeadingDay
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import LineChart from 'components/LineChart'
import React, { useState } from 'react'
import { useApiCalls } from 'store/cache/analytics/hooks'
import { Bucket, MetricError } from 'store/cache/analytics/slice'
import { datesToSkip } from 'utils/consts'

type OwnProps = {}

Expand All @@ -17,8 +18,14 @@ const UniqueUsersChart: React.FC<UniqueUsersChartProps> = () => {
labels = []
data = []
} else {
labels = apiCalls?.map(a => new Date(a.timestamp).getTime() / 1000) ?? null
data = apiCalls?.map(a => a.summed_unique_count) ?? null
labels =
apiCalls
?.filter(a => !datesToSkip.has(a.timestamp))
?.map(a => new Date(a.timestamp).getTime() / 1000) ?? null
data =
apiCalls
?.filter(a => !datesToSkip.has(a.timestamp))
?.map(a => a.summed_unique_count) ?? null
}
return (
<LineChart
Expand All @@ -28,7 +35,7 @@ const UniqueUsersChart: React.FC<UniqueUsersChartProps> = () => {
labels={labels}
selection={bucket}
error={error}
options={[Bucket.ALL_TIME, Bucket.MONTH, Bucket.WEEK]}
options={[Bucket.ALL_TIME, Bucket.MONTH]}
onSelectOption={(option: string) => setBucket(option as Bucket)}
showLeadingDay
/>
Expand Down
13 changes: 13 additions & 0 deletions packages/protocol-dashboard/src/utils/consts.ts
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
export const TICKER = '$AUDIO'

export const datesToSkip = new Set([
'2023-06-23',
'2023-06-24',
'2023-06-25',
'2023-06-29',
'2023-06-30',
'2023-07-01',
'2023-07-02',
'2023-07-03',
'2023-07-04',
'2023-07-05'
])

0 comments on commit aba352b

Please sign in to comment.