2023-08-16 12:18:56 +05:30
|
|
|
// This component is not been used in the application as we support only metrics for ApDex as of now.
|
|
|
|
|
// This component is been kept for future reference.
|
2024-03-04 10:15:43 +05:30
|
|
|
import { ENTITY_VERSION_V4 } from 'constants/app';
|
2023-08-16 12:18:56 +05:30
|
|
|
import { PANEL_TYPES } from 'constants/queryBuilder';
|
2023-10-08 23:21:17 +05:30
|
|
|
import Graph from 'container/GridCardLayout/GridCard';
|
2023-08-16 12:18:56 +05:30
|
|
|
import { GraphTitle } from 'container/MetricsApplication/constant';
|
|
|
|
|
import { getWidgetQueryBuilder } from 'container/MetricsApplication/MetricsApplication.factory';
|
|
|
|
|
import { apDexTracesQueryBuilderQueries } from 'container/MetricsApplication/MetricsPageQueries/OverviewQueries';
|
|
|
|
|
import { useMemo } from 'react';
|
|
|
|
|
import { useParams } from 'react-router-dom';
|
|
|
|
|
import { EQueryType } from 'types/common/dashboard';
|
|
|
|
|
import { v4 as uuid } from 'uuid';
|
|
|
|
|
|
|
|
|
|
import { IServiceName } from '../../types';
|
|
|
|
|
import { ApDexDataSwitcherProps } from './types';
|
|
|
|
|
|
|
|
|
|
function ApDexTraces({
|
|
|
|
|
handleGraphClick,
|
|
|
|
|
onDragSelect,
|
|
|
|
|
topLevelOperationsRoute,
|
|
|
|
|
tagFilterItems,
|
|
|
|
|
thresholdValue,
|
|
|
|
|
}: ApDexDataSwitcherProps): JSX.Element {
|
2024-03-08 00:08:12 +05:30
|
|
|
const { servicename: encodedServiceName } = useParams<IServiceName>();
|
|
|
|
|
const servicename = decodeURIComponent(encodedServiceName);
|
2023-08-16 12:18:56 +05:30
|
|
|
|
|
|
|
|
const apDexTracesWidget = useMemo(
|
|
|
|
|
() =>
|
|
|
|
|
getWidgetQueryBuilder({
|
|
|
|
|
query: {
|
|
|
|
|
queryType: EQueryType.QUERY_BUILDER,
|
|
|
|
|
promql: [],
|
|
|
|
|
builder: apDexTracesQueryBuilderQueries({
|
|
|
|
|
servicename,
|
|
|
|
|
tagFilterItems,
|
|
|
|
|
topLevelOperationsRoute,
|
|
|
|
|
threashold: thresholdValue || 0,
|
|
|
|
|
}),
|
|
|
|
|
clickhouse_sql: [],
|
|
|
|
|
id: uuid(),
|
|
|
|
|
},
|
|
|
|
|
title: GraphTitle.APDEX,
|
|
|
|
|
panelTypes: PANEL_TYPES.TIME_SERIES,
|
|
|
|
|
}),
|
|
|
|
|
[servicename, tagFilterItems, thresholdValue, topLevelOperationsRoute],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const isQueryEnabled =
|
|
|
|
|
topLevelOperationsRoute.length > 0 && thresholdValue !== undefined;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Graph
|
|
|
|
|
widget={apDexTracesWidget}
|
|
|
|
|
onDragSelect={onDragSelect}
|
|
|
|
|
onClickHandler={handleGraphClick('ApDex')}
|
|
|
|
|
threshold={thresholdValue}
|
|
|
|
|
isQueryEnabled={isQueryEnabled}
|
2024-03-04 10:15:43 +05:30
|
|
|
version={ENTITY_VERSION_V4}
|
2023-08-16 12:18:56 +05:30
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ApDexTraces;
|