mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
vmui: heatmap fixes (#4086)
* fix: correct display of errors for query * fix: change the logic of histogram detection * feat: hide empty buckets from the graph * fix: revert server url
This commit is contained in:
parent
ee80e71d17
commit
01fc228fb0
2 changed files with 5 additions and 3 deletions
|
@ -89,6 +89,7 @@ export const useFetchQuery = ({
|
|||
|
||||
const isHideQuery = hideQuery?.includes(counter - 1);
|
||||
if (isHideQuery) {
|
||||
setQueryErrors(prev => [...prev, ""]);
|
||||
counter++;
|
||||
continue;
|
||||
}
|
||||
|
@ -105,6 +106,7 @@ export const useFetchQuery = ({
|
|||
}
|
||||
|
||||
const isHistogramResult = isDisplayChart && isHistogramData(resp.data.result);
|
||||
if (resp.data.result.length) setIsHistogram(isHistogramResult);
|
||||
if (isHistogramResult) seriesLimit = Infinity;
|
||||
const freeTempSize = seriesLimit - tempData.length;
|
||||
resp.data.result.slice(0, freeTempSize).forEach((d: MetricBase) => {
|
||||
|
@ -122,8 +124,6 @@ export const useFetchQuery = ({
|
|||
|
||||
const limitText = `Showing ${seriesLimit} series out of ${totalLength} series due to performance reasons. Please narrow down the query, so it returns less series`;
|
||||
setWarning(totalLength > seriesLimit ? limitText : "");
|
||||
|
||||
setIsHistogram(isDisplayChart && isHistogramData(tempData));
|
||||
isDisplayChart ? setGraphData(tempData as MetricResult[]) : setLiveData(tempData as InstantMetricResult[]);
|
||||
setTraces(tempTraces);
|
||||
} catch (e) {
|
||||
|
|
|
@ -149,7 +149,7 @@ export const normalizeData = (buckets: MetricResult[], isHistogram?: boolean): M
|
|||
const vmBuckets = convertPrometheusToVictoriaMetrics(sortedBuckets);
|
||||
const allValues = vmBuckets.map(b => b.values).flat();
|
||||
|
||||
return vmBuckets.map(bucket => {
|
||||
const result = vmBuckets.map(bucket => {
|
||||
const values = bucket.values.map((v) => {
|
||||
const totalHits = allValues
|
||||
.filter(av => av[0] === v[0])
|
||||
|
@ -160,4 +160,6 @@ export const normalizeData = (buckets: MetricResult[], isHistogram?: boolean): M
|
|||
|
||||
return { ...bucket, values };
|
||||
}) as MetricResult[];
|
||||
|
||||
return result.filter(r => !r.values.every(v => v[1] === "0"));
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue