mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-21 06:33:30 +00:00
Add SUPERVISOR_HARDWARE_METRICS
to config documentation
Signed-off-by: Christina Wang <christina@balena.io>
This commit is contained in:
parent
dcd863eed8
commit
5004cc5fd2
@ -26,6 +26,7 @@ This list contains configuration variables that can be used with all balena devi
|
||||
| BALENA_HOST_FIREWALL_MODE | string | false | off | Toggle firewall modes between on, off, and auto. | v11.9.1 |
|
||||
| BALENA_HOST_DISCOVERABILITY | boolean | false | true | Enable / Disable Avahi to run which will allow the device to respond to requests such as network scans. | v11.9.2 |
|
||||
| BALENA_HOST_SPLASH_IMAGE | integer | true | /boot/splash/balena-logo-default.png | Allows changing splash screen on boot to user defined file from userspace. | v12.3.0 |
|
||||
| BALENA_SUPERVISOR_HARDWARE_METRICS | boolean | false | true | Toggle hardware metrics reporting to the cloud, which occurs every 10 seconds when there are changes. Metrics include CPU utilization, CPU temperature, memory usage, and disk space. Useful for devices with bandwith sensitivity. | v12.8.0 |
|
||||
|
||||
---
|
||||
|
||||
|
@ -26,41 +26,42 @@ describe('System information', () => {
|
||||
(fsUtils.exec as SinonStub).restore();
|
||||
});
|
||||
|
||||
describe('filterNonSignificantChanges', () => {
|
||||
describe('isSignificantChange', () => {
|
||||
it('should correctly filter cpu usage', () => {
|
||||
expect(sysInfo.isSignificantChange('cpu_usage', 21, 20)).to.equal(false);
|
||||
|
||||
expect(sysInfo.isSignificantChange('cpu_usage', 10, 20)).to.equal(true);
|
||||
expect(sysInfo.isSignificantChange('cpu_usage', 21, 20)).to.be.false;
|
||||
expect(sysInfo.isSignificantChange('cpu_usage', 10, 20)).to.be.true;
|
||||
});
|
||||
|
||||
it('should correctly filter cpu temperature', () => {
|
||||
expect(sysInfo.isSignificantChange('cpu_temp', 21, 22)).to.equal(false);
|
||||
|
||||
expect(sysInfo.isSignificantChange('cpu_temp', 10, 20)).to.equal(true);
|
||||
expect(sysInfo.isSignificantChange('cpu_temp', 21, 22)).to.be.false;
|
||||
expect(sysInfo.isSignificantChange('cpu_temp', 10, 20)).to.be.true;
|
||||
});
|
||||
|
||||
it('should correctly filter memory usage', () => {
|
||||
expect(sysInfo.isSignificantChange('memory_usage', 21, 22)).to.equal(
|
||||
false,
|
||||
);
|
||||
|
||||
expect(sysInfo.isSignificantChange('memory_usage', 10, 20)).to.equal(
|
||||
true,
|
||||
);
|
||||
expect(sysInfo.isSignificantChange('memory_usage', 21, 22)).to.be.false;
|
||||
expect(sysInfo.isSignificantChange('memory_usage', 10, 20)).to.be.true;
|
||||
});
|
||||
|
||||
it("should not filter if we didn't have a past value", () => {
|
||||
expect(sysInfo.isSignificantChange('cpu_usage', undefined, 22)).to.equal(
|
||||
true,
|
||||
);
|
||||
expect(sysInfo.isSignificantChange('cpu_usage', undefined, 22)).to.be
|
||||
.true;
|
||||
expect(sysInfo.isSignificantChange('cpu_temp', undefined, 10)).to.be.true;
|
||||
expect(sysInfo.isSignificantChange('memory_usage', undefined, 5)).to.be
|
||||
.true;
|
||||
});
|
||||
|
||||
expect(sysInfo.isSignificantChange('cpu_temp', undefined, 10)).to.equal(
|
||||
true,
|
||||
);
|
||||
|
||||
expect(
|
||||
sysInfo.isSignificantChange('memory_usage', undefined, 5),
|
||||
).to.equal(true);
|
||||
it('should not filter if the current value is null', () => {
|
||||
// When the current value is null, we're sending a null patch to the
|
||||
// API in response to setting DISABLE_HARDWARE_METRICS to true, so
|
||||
// we need to include null for all values. None of the individual metrics
|
||||
// in systemMetrics return null (only number/undefined), so the only
|
||||
// reason for current to be null is when a null patch is happening.
|
||||
expect(sysInfo.isSignificantChange('cpu_usage', 15, null as any)).to.be
|
||||
.true;
|
||||
expect(sysInfo.isSignificantChange('cpu_temp', 55, null as any)).to.be
|
||||
.true;
|
||||
expect(sysInfo.isSignificantChange('memory_usage', 760, null as any)).to
|
||||
.be.true;
|
||||
});
|
||||
|
||||
it('should not filter if the current value is null', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user