cloudstack/framework
Spaceman1984 b586eb22f1
Human readable sizes in logs (#4207)
This PR adds outputting human readable byte sizes in the management server logs, agent logs, and usage records. A non-dynamic global variable is added (display.human.readable.sizes) to control switching this feature on and off. This setting is sent to the agent on connection and is only read from the database when the management server is started up. The setting is kept in memory by the use of a static field on the NumbersUtil class and is available throughout the codebase.

Instead of seeing things like:
2020-07-23 15:31:58,593 DEBUG [c.c.a.t.Request] (AgentManager-Handler-12:null) (logid:) Seq 8-1863645820801253428: Processing: { Ans: , MgmtId: 52238089807, via: 8, Ver: v1, Flags: 10, [{"com.cloud.agent.api.NetworkUsageAnswer":{"routerName":"r-224-VM","bytesSent":"106496","bytesReceived":"0","result":"true","details":"","wait":"0",}}] }

The KB MB and GB values will be printed out:

2020-07-23 15:31:58,593 DEBUG [c.c.a.t.Request] (AgentManager-Handler-12:null) (logid:) Seq 8-1863645820801253428: Processing: { Ans: , MgmtId: 52238089807, via: 8, Ver: v1, Flags: 10, [{"com.cloud.agent.api.NetworkUsageAnswer":{"routerName":"r-224-VM","bytesSent":"(104.00 KB) 106496","bytesReceived":"(0 bytes) 0","result":"true","details":"","wait":"0",}}] }

FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Human+Readable+Byte+sizes
2020-08-13 15:55:16 +05:30
..
agent-lb Updating pom.xml version numbers for release 4.15.0.0-SNAPSHOT 2020-05-23 10:18:39 +01:00
ca Updating pom.xml version numbers for release 4.15.0.0-SNAPSHOT 2020-05-23 10:18:39 +01:00
cluster projects: Role based users in Projects (#4128) 2020-08-13 15:45:39 +05:30
config Updating pom.xml version numbers for release 4.15.0.0-SNAPSHOT 2020-05-23 10:18:39 +01:00
db Merge remote-tracking branch 'origin/4.14' 2020-06-16 13:31:29 +05:30
direct-download Updating pom.xml version numbers for release 4.15.0.0-SNAPSHOT 2020-05-23 10:18:39 +01:00
events Updating pom.xml version numbers for release 4.15.0.0-SNAPSHOT 2020-05-23 10:18:39 +01:00
ipc Updating pom.xml version numbers for release 4.15.0.0-SNAPSHOT 2020-05-23 10:18:39 +01:00
jobs Human readable sizes in logs (#4207) 2020-08-13 15:55:16 +05:30
managed-context logging: Logging framework to use only log4j (#4003) 2020-06-17 07:11:23 +05:30
quota Merge remote-tracking branch 'origin/4.14' 2020-07-07 12:53:05 +05:30
rest Updating pom.xml version numbers for release 4.15.0.0-SNAPSHOT 2020-05-23 10:18:39 +01:00
security Updating pom.xml version numbers for release 4.15.0.0-SNAPSHOT 2020-05-23 10:18:39 +01:00
spring logging: Logging framework to use only log4j (#4003) 2020-06-17 07:11:23 +05:30
pom.xml Updating pom.xml version numbers for release 4.15.0.0-SNAPSHOT 2020-05-23 10:18:39 +01:00