import {CHART_PALETTE} from 'sentry/constants/chartPalette'; import {t} from 'sentry/locale'; import {RateUnit} from 'sentry/utils/discover/fields'; import {formatRate} from 'sentry/utils/formatters'; import Chart, {ChartType} from 'sentry/views/insights/common/components/chart'; import ChartPanel from 'sentry/views/insights/common/components/chartPanel'; import {ALERTS} from 'sentry/views/insights/queues/alerts'; import {useProcessQueuesTimeSeriesQuery} from 'sentry/views/insights/queues/queries/useProcessQueuesTimeSeriesQuery'; import {usePublishQueuesTimeSeriesQuery} from 'sentry/views/insights/queues/queries/usePublishQueuesTimeSeriesQuery'; import type {Referrer} from 'sentry/views/insights/queues/referrers'; import {CHART_HEIGHT} from 'sentry/views/insights/queues/settings'; interface Props { referrer: Referrer; destination?: string; error?: Error | null; } export function ThroughputChart({error, destination, referrer}: Props) { const {data: publishData, isPending: isPublishDataLoading} = usePublishQueuesTimeSeriesQuery({ destination, referrer, }); const {data: processData, isPending: isProcessDataLoading} = useProcessQueuesTimeSeriesQuery({ destination, referrer, }); let {processed, published} = ALERTS; if (destination) { processed = { ...processed, query: `${processed.query} messaging.destination.name:${destination}`, }; published = { ...published, query: `${published.query} messaging.destination.name:${destination}`, }; } return ( formatRate(value, RateUnit.PER_MINUTE), }} showLegend /> ); }