Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix(device): raise device health usage color thresholds (#20549)

Arvin Xu9897f7123125
diff --git a/src/features/DeviceManager/DeviceHealth/format.test.ts b/src/features/DeviceManager/DeviceHealth/format.test.ts
index 94d15d2db6e..ad7042d64bf 100644
--- a/src/features/DeviceManager/DeviceHealth/format.test.ts
+++ b/src/features/DeviceManager/DeviceHealth/format.test.ts
@@ -16,17 +16,17 @@ describe('device health formatters', () => {
});
describe('usage levels', () => {
- it('turns yellow from 70% and red from 90%', () => {
- expect(usageLevel(69.9)).toBe('normal');
- expect(usageLevel(70)).toBe('high');
- expect(usageLevel(89.9)).toBe('high');
- expect(usageLevel(90)).toBe('critical');
+ it('turns yellow from 80% and red from 95%', () => {
+ expect(usageLevel(79.9)).toBe('normal');
+ expect(usageLevel(80)).toBe('high');
+ expect(usageLevel(94.9)).toBe('high');
+ expect(usageLevel(95)).toBe('critical');
expect(usageLevel(null)).toBeUndefined();
});
it('rates a block by its busiest metric', () => {
- expect(peakUsageLevel(40, 55, 93)).toBe('critical');
- expect(peakUsageLevel(null, 72, undefined)).toBe('high');
+ expect(peakUsageLevel(40, 55, 96)).toBe('critical');
+ expect(peakUsageLevel(null, 82, undefined)).toBe('high');
expect(peakUsageLevel(null, undefined)).toBeUndefined();
});
});
diff --git a/src/features/DeviceManager/DeviceHealth/format.ts b/src/features/DeviceManager/DeviceHealth/format.ts
index bfa4d75d7f9..4ee151faad6 100644
--- a/src/features/DeviceManager/DeviceHealth/format.ts
+++ b/src/features/DeviceManager/DeviceHealth/format.ts
@@ -4,11 +4,11 @@ type ChartValue = number | null | undefined;
export const formatPercent = (value: ChartValue) =>
value === null || value === undefined ? '—' : `${Math.round(value)}%`;
-/** How loaded a machine is: yellow from 70%, red from 90%. */
+/** How loaded a machine is: yellow from 80%, red from 95%. */
export type UsageLevel = 'normal' | 'high' | 'critical';
-export const HIGH_USAGE_PERCENT = 70;
-export const CRITICAL_USAGE_PERCENT = 90;
+export const HIGH_USAGE_PERCENT = 80;
+export const CRITICAL_USAGE_PERCENT = 95;
export const usageLevel = (value: ChartValue): UsageLevel | undefined => {
if (value === null || value === undefined) return undefined;