mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 12:49:06 +08:00
fix: resolve unnecessary refetching of graphs on service details page
This commit is contained in:
commit
81775c7d55
@ -145,41 +145,49 @@ function Application(): JSX.Element {
|
|||||||
[servicename, topLevelOperations],
|
[servicename, topLevelOperations],
|
||||||
);
|
);
|
||||||
|
|
||||||
const operationPerSecWidget = getWidgetQueryBuilder({
|
const operationPerSecWidget = useMemo(
|
||||||
query: {
|
() =>
|
||||||
queryType: EQueryType.QUERY_BUILDER,
|
getWidgetQueryBuilder({
|
||||||
promql: [],
|
query: {
|
||||||
builder: operationPerSec({
|
queryType: EQueryType.QUERY_BUILDER,
|
||||||
servicename,
|
promql: [],
|
||||||
tagFilterItems,
|
builder: operationPerSec({
|
||||||
topLevelOperations: topLevelOperationsRoute,
|
servicename,
|
||||||
|
tagFilterItems,
|
||||||
|
topLevelOperations: topLevelOperationsRoute,
|
||||||
|
}),
|
||||||
|
clickhouse_sql: [],
|
||||||
|
id: uuid(),
|
||||||
|
},
|
||||||
|
title: GraphTitle.RATE_PER_OPS,
|
||||||
|
panelTypes: PANEL_TYPES.TIME_SERIES,
|
||||||
|
yAxisUnit: 'ops',
|
||||||
|
id: SERVICE_CHART_ID.rps,
|
||||||
}),
|
}),
|
||||||
clickhouse_sql: [],
|
[servicename, tagFilterItems, topLevelOperationsRoute],
|
||||||
id: uuid(),
|
);
|
||||||
},
|
|
||||||
title: GraphTitle.RATE_PER_OPS,
|
|
||||||
panelTypes: PANEL_TYPES.TIME_SERIES,
|
|
||||||
yAxisUnit: 'ops',
|
|
||||||
id: SERVICE_CHART_ID.rps,
|
|
||||||
});
|
|
||||||
|
|
||||||
const errorPercentageWidget = getWidgetQueryBuilder({
|
const errorPercentageWidget = useMemo(
|
||||||
query: {
|
() =>
|
||||||
queryType: EQueryType.QUERY_BUILDER,
|
getWidgetQueryBuilder({
|
||||||
promql: [],
|
query: {
|
||||||
builder: errorPercentage({
|
queryType: EQueryType.QUERY_BUILDER,
|
||||||
servicename,
|
promql: [],
|
||||||
tagFilterItems,
|
builder: errorPercentage({
|
||||||
topLevelOperations: topLevelOperationsRoute,
|
servicename,
|
||||||
|
tagFilterItems,
|
||||||
|
topLevelOperations: topLevelOperationsRoute,
|
||||||
|
}),
|
||||||
|
clickhouse_sql: [],
|
||||||
|
id: uuid(),
|
||||||
|
},
|
||||||
|
title: GraphTitle.ERROR_PERCENTAGE,
|
||||||
|
panelTypes: PANEL_TYPES.TIME_SERIES,
|
||||||
|
yAxisUnit: '%',
|
||||||
|
id: SERVICE_CHART_ID.errorPercentage,
|
||||||
}),
|
}),
|
||||||
clickhouse_sql: [],
|
[servicename, tagFilterItems, topLevelOperationsRoute],
|
||||||
id: uuid(),
|
);
|
||||||
},
|
|
||||||
title: GraphTitle.ERROR_PERCENTAGE,
|
|
||||||
panelTypes: PANEL_TYPES.TIME_SERIES,
|
|
||||||
yAxisUnit: '%',
|
|
||||||
id: SERVICE_CHART_ID.errorPercentage,
|
|
||||||
});
|
|
||||||
|
|
||||||
const stepInterval = useMemo(
|
const stepInterval = useMemo(
|
||||||
() =>
|
() =>
|
||||||
|
@ -53,24 +53,28 @@ function ServiceOverview({
|
|||||||
[isSpanMetricEnable, queries],
|
[isSpanMetricEnable, queries],
|
||||||
);
|
);
|
||||||
|
|
||||||
const latencyWidget = getWidgetQueryBuilder({
|
const latencyWidget = useMemo(
|
||||||
query: {
|
() =>
|
||||||
queryType: EQueryType.QUERY_BUILDER,
|
getWidgetQueryBuilder({
|
||||||
promql: [],
|
query: {
|
||||||
builder: latency({
|
queryType: EQueryType.QUERY_BUILDER,
|
||||||
servicename,
|
promql: [],
|
||||||
tagFilterItems,
|
builder: latency({
|
||||||
isSpanMetricEnable,
|
servicename,
|
||||||
topLevelOperationsRoute,
|
tagFilterItems,
|
||||||
|
isSpanMetricEnable,
|
||||||
|
topLevelOperationsRoute,
|
||||||
|
}),
|
||||||
|
clickhouse_sql: [],
|
||||||
|
id: uuid(),
|
||||||
|
},
|
||||||
|
title: GraphTitle.LATENCY,
|
||||||
|
panelTypes: PANEL_TYPES.TIME_SERIES,
|
||||||
|
yAxisUnit: 'ns',
|
||||||
|
id: SERVICE_CHART_ID.latency,
|
||||||
}),
|
}),
|
||||||
clickhouse_sql: [],
|
[isSpanMetricEnable, servicename, tagFilterItems, topLevelOperationsRoute],
|
||||||
id: uuid(),
|
);
|
||||||
},
|
|
||||||
title: GraphTitle.LATENCY,
|
|
||||||
panelTypes: PANEL_TYPES.TIME_SERIES,
|
|
||||||
yAxisUnit: 'ns',
|
|
||||||
id: SERVICE_CHART_ID.latency,
|
|
||||||
});
|
|
||||||
|
|
||||||
const isQueryEnabled =
|
const isQueryEnabled =
|
||||||
!topLevelOperationsIsLoading && topLevelOperationsRoute.length > 0;
|
!topLevelOperationsIsLoading && topLevelOperationsRoute.length > 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user