|
@@ -35,9 +35,12 @@ import * as ModuleLayout from 'sentry/views/performance/moduleLayout';
|
|
import {useSpanFieldSupportedTags} from 'sentry/views/performance/utils/useSpanFieldSupportedTags';
|
|
import {useSpanFieldSupportedTags} from 'sentry/views/performance/utils/useSpanFieldSupportedTags';
|
|
import DetailPanel from 'sentry/views/starfish/components/detailPanel';
|
|
import DetailPanel from 'sentry/views/starfish/components/detailPanel';
|
|
import {getTimeSpentExplanation} from 'sentry/views/starfish/components/tableCells/timeSpentCell';
|
|
import {getTimeSpentExplanation} from 'sentry/views/starfish/components/tableCells/timeSpentCell';
|
|
-import {useMetrics, useSpanMetrics} from 'sentry/views/starfish/queries/useDiscover';
|
|
|
|
|
|
+import {
|
|
|
|
+ useMetrics,
|
|
|
|
+ useSpanMetrics,
|
|
|
|
+ useSpansIndexed,
|
|
|
|
+} from 'sentry/views/starfish/queries/useDiscover';
|
|
import {useSpanMetricsSeries} from 'sentry/views/starfish/queries/useDiscoverSeries';
|
|
import {useSpanMetricsSeries} from 'sentry/views/starfish/queries/useDiscoverSeries';
|
|
-import {useIndexedSpans} from 'sentry/views/starfish/queries/useIndexedSpans';
|
|
|
|
import {useTransactions} from 'sentry/views/starfish/queries/useTransactions';
|
|
import {useTransactions} from 'sentry/views/starfish/queries/useTransactions';
|
|
import {
|
|
import {
|
|
MetricsFields,
|
|
MetricsFields,
|
|
@@ -46,6 +49,7 @@ import {
|
|
SpanFunction,
|
|
SpanFunction,
|
|
SpanIndexedField,
|
|
SpanIndexedField,
|
|
type SpanIndexedQueryFilters,
|
|
type SpanIndexedQueryFilters,
|
|
|
|
+ type SpanIndexedResponse,
|
|
SpanMetricsField,
|
|
SpanMetricsField,
|
|
type SpanMetricsQueryFilters,
|
|
type SpanMetricsQueryFilters,
|
|
} from 'sentry/views/starfish/types';
|
|
} from 'sentry/views/starfish/types';
|
|
@@ -146,29 +150,34 @@ export function CacheSamplePanel() {
|
|
project_id: query.project,
|
|
project_id: query.project,
|
|
};
|
|
};
|
|
|
|
|
|
- const useIndexedCacheSpans = (isCacheHit, limit) =>
|
|
|
|
- useIndexedSpans({
|
|
|
|
- search: MutableSearch.fromQueryObject({
|
|
|
|
- ...sampleFilters,
|
|
|
|
- ...new MutableSearch(query.spanSearchQuery).filters,
|
|
|
|
- 'cache.hit': isCacheHit,
|
|
|
|
- }),
|
|
|
|
- fields: [
|
|
|
|
- SpanIndexedField.PROJECT,
|
|
|
|
- SpanIndexedField.TRACE,
|
|
|
|
- SpanIndexedField.TRANSACTION_ID,
|
|
|
|
- SpanIndexedField.ID,
|
|
|
|
- SpanIndexedField.TIMESTAMP,
|
|
|
|
- SpanIndexedField.SPAN_DESCRIPTION,
|
|
|
|
- SpanIndexedField.CACHE_HIT,
|
|
|
|
- SpanIndexedField.SPAN_OP,
|
|
|
|
- SpanIndexedField.CACHE_ITEM_SIZE,
|
|
|
|
- ],
|
|
|
|
- sorts: [SPAN_SAMPLES_SORT],
|
|
|
|
- limit: limit,
|
|
|
|
- enabled: isPanelOpen,
|
|
|
|
- referrer: Referrer.SAMPLES_CACHE_SPAN_SAMPLES,
|
|
|
|
- });
|
|
|
|
|
|
+ const useIndexedCacheSpans = (
|
|
|
|
+ isCacheHit: SpanIndexedResponse['cache.hit'],
|
|
|
|
+ limit: number
|
|
|
|
+ ) =>
|
|
|
|
+ useSpansIndexed(
|
|
|
|
+ {
|
|
|
|
+ search: MutableSearch.fromQueryObject({
|
|
|
|
+ ...sampleFilters,
|
|
|
|
+ ...new MutableSearch(query.spanSearchQuery).filters,
|
|
|
|
+ 'cache.hit': isCacheHit,
|
|
|
|
+ }),
|
|
|
|
+ fields: [
|
|
|
|
+ SpanIndexedField.PROJECT,
|
|
|
|
+ SpanIndexedField.TRACE,
|
|
|
|
+ SpanIndexedField.TRANSACTION_ID,
|
|
|
|
+ SpanIndexedField.ID,
|
|
|
|
+ SpanIndexedField.TIMESTAMP,
|
|
|
|
+ SpanIndexedField.SPAN_DESCRIPTION,
|
|
|
|
+ SpanIndexedField.CACHE_HIT,
|
|
|
|
+ SpanIndexedField.SPAN_OP,
|
|
|
|
+ SpanIndexedField.CACHE_ITEM_SIZE,
|
|
|
|
+ ],
|
|
|
|
+ sorts: [SPAN_SAMPLES_SORT],
|
|
|
|
+ limit,
|
|
|
|
+ enabled: isPanelOpen,
|
|
|
|
+ },
|
|
|
|
+ Referrer.SAMPLES_CACHE_SPAN_SAMPLES
|
|
|
|
+ );
|
|
|
|
|
|
// display half hits and half misses by default
|
|
// display half hits and half misses by default
|
|
let cacheHitSamplesLimit = SPAN_SAMPLE_LIMIT / 2;
|
|
let cacheHitSamplesLimit = SPAN_SAMPLE_LIMIT / 2;
|