mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 15:49:01 +08:00
fix: changed the error percentage calculation
This commit is contained in:
parent
7edb047c0c
commit
a41ffceca4
@ -89,14 +89,13 @@ function EndPointMetrics({
|
|||||||
) : (
|
) : (
|
||||||
<Tooltip title={metricsData?.errorRate}>
|
<Tooltip title={metricsData?.errorRate}>
|
||||||
<Progress
|
<Progress
|
||||||
percent={Number(
|
status="active"
|
||||||
(Number(metricsData?.errorRate ?? 0) * 100).toFixed(1),
|
percent={Number(Number(metricsData?.errorRate ?? 0).toFixed(1))}
|
||||||
)}
|
|
||||||
strokeLinecap="butt"
|
strokeLinecap="butt"
|
||||||
size="small"
|
size="small"
|
||||||
strokeColor={((): string => {
|
strokeColor={((): string => {
|
||||||
const errorRatePercent = Number(
|
const errorRatePercent = Number(
|
||||||
(Number(metricsData?.errorRate ?? 0) * 100).toFixed(1),
|
Number(metricsData?.errorRate ?? 0).toFixed(1),
|
||||||
);
|
);
|
||||||
if (errorRatePercent >= 90) return Color.BG_SAKURA_500;
|
if (errorRatePercent >= 90) return Color.BG_SAKURA_500;
|
||||||
if (errorRatePercent >= 60) return Color.BG_AMBER_500;
|
if (errorRatePercent >= 60) return Color.BG_AMBER_500;
|
||||||
|
@ -212,11 +212,11 @@ export const columnsConfig: ColumnType<APIDomainsRowData>[] = [
|
|||||||
return (
|
return (
|
||||||
<Progress
|
<Progress
|
||||||
status="active"
|
status="active"
|
||||||
percent={Number(((errorRate as number) * 100).toFixed(1))}
|
percent={Number((errorRate as number).toFixed(1))}
|
||||||
strokeLinecap="butt"
|
strokeLinecap="butt"
|
||||||
size="small"
|
size="small"
|
||||||
strokeColor={((): string => {
|
strokeColor={((): string => {
|
||||||
const errorRatePercent = Number(((errorRate as number) * 100).toFixed(1));
|
const errorRatePercent = Number((errorRate as number).toFixed(1));
|
||||||
if (errorRatePercent >= 90) return Color.BG_SAKURA_500;
|
if (errorRatePercent >= 90) return Color.BG_SAKURA_500;
|
||||||
if (errorRatePercent >= 60) return Color.BG_AMBER_500;
|
if (errorRatePercent >= 60) return Color.BG_AMBER_500;
|
||||||
return Color.BG_FOREST_500;
|
return Color.BG_FOREST_500;
|
||||||
@ -699,16 +699,15 @@ export const getEndPointsColumnsConfig = (
|
|||||||
<Progress
|
<Progress
|
||||||
status="active"
|
status="active"
|
||||||
percent={Number(
|
percent={Number(
|
||||||
(
|
((errorRate === 'n/a' || errorRate === '-'
|
||||||
((errorRate === 'n/a' || errorRate === '-' ? 0 : errorRate) as number) *
|
? 0
|
||||||
100
|
: errorRate) as number).toFixed(1),
|
||||||
).toFixed(1),
|
|
||||||
)}
|
)}
|
||||||
strokeLinecap="butt"
|
strokeLinecap="butt"
|
||||||
size="small"
|
size="small"
|
||||||
strokeColor={((): // eslint-disable-next-line sonarjs/no-identical-functions
|
strokeColor={((): // eslint-disable-next-line sonarjs/no-identical-functions
|
||||||
string => {
|
string => {
|
||||||
const errorRatePercent = Number(((errorRate as number) * 100).toFixed(1));
|
const errorRatePercent = Number((errorRate as number).toFixed(1));
|
||||||
if (errorRatePercent >= 90) return Color.BG_SAKURA_500;
|
if (errorRatePercent >= 90) return Color.BG_SAKURA_500;
|
||||||
if (errorRatePercent >= 60) return Color.BG_AMBER_500;
|
if (errorRatePercent >= 60) return Color.BG_AMBER_500;
|
||||||
return Color.BG_FOREST_500;
|
return Color.BG_FOREST_500;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user