Skip to content

Human readable sizes in logs#4207

Merged
yadvr merged 26 commits into
apache:masterfrom
shapeblue:human-readable-log-sizes
Aug 13, 2020
Merged

Human readable sizes in logs#4207
yadvr merged 26 commits into
apache:masterfrom
shapeblue:human-readable-log-sizes

Conversation

@Spaceman1984

@Spaceman1984 Spaceman1984 commented Jul 10, 2020

Copy link
Copy Markdown
Contributor

Description

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

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

This has been tested by observing the logs on the management server and on the agent while doing things like the following (Also inspecting the events table and cloud_usage table after the usage aggregation job has run.):

  • Upload an iso.
  • Deploy a vm.
  • Start a vm.
  • Stop a vm.
  • Migrate a vm.
  • Add a storage volume to a zone.
  • Resize the volume.

Tested on a VMWare, Xenserver and a KVM cluster.

@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖centos7 ✖debian. JID-1575

@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1576

@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1599

@GabrielBrascher

Copy link
Copy Markdown
Member

@Spaceman1984 is this PR ready for review?

@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@Spaceman1984 is this PR ready for review?

@GabrielBrascher not yet, just a few more tweaks.

@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@Spaceman1984 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@Spaceman1984 Spaceman1984 marked this pull request as ready for review July 24, 2020 11:05
@Spaceman1984 Spaceman1984 reopened this Jul 24, 2020
@Spaceman1984 Spaceman1984 marked this pull request as draft July 24, 2020 11:07
@Spaceman1984 Spaceman1984 marked this pull request as ready for review July 24, 2020 11:09
@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1602

@yadvr

yadvr commented Jul 27, 2020

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lggtm (save a space)

Comment thread core/src/main/java/com/cloud/agent/transport/Request.java Outdated
@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2203)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37059 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4207-t2203-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 79 look OK, 4 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_deploy_kubernetes_cluster Error 0.06 test_kubernetes_clusters.py
test_02_deploy_kubernetes_ha_cluster Error 0.03 test_kubernetes_clusters.py
test_04_deploy_and_upgrade_kubernetes_cluster Error 0.02 test_kubernetes_clusters.py
test_05_deploy_and_upgrade_kubernetes_ha_cluster Error 0.03 test_kubernetes_clusters.py
test_06_deploy_and_invalid_upgrade_kubernetes_cluster Error 0.03 test_kubernetes_clusters.py
test_07_deploy_and_scale_kubernetes_cluster Error 0.03 test_kubernetes_clusters.py
ContextSuite context=Test01DeployVM>:setup Error 0.00 test_vm_life_cycle.py
ContextSuite context=Test02VMLifeCycle>:setup Error 0.00 test_vm_life_cycle.py
ContextSuite context=Test03SecuredVmMigration>:setup Error 0.00 test_vm_life_cycle.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 328.01 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 310.74 test_vpc_redundant.py
test_hostha_enable_ha_when_host_disabled Error 1.39 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Error 303.50 test_hostha_kvm.py

@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2278)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
Total time taken: 49892 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4207-t2278-vmware-67u3.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_supported_versions.py
Intermittent failure detected: /marvin/tests/smoke/test_ssvm.py
Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 77 look OK, 3 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_add_delete_kubernetes_supported_version Error 1807.80 test_kubernetes_supported_versions.py
test_11_migrate_vm Error 61.06 test_vm_life_cycle.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 478.83 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Error 3799.13 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Error 3799.16 test_vpc_redundant.py
test_05_rvpc_multi_tiers Error 0.01 test_vpc_redundant.py
ContextSuite context=TestVPCRedundancy>:teardown Error 0.01 test_vpc_redundant.py

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2279)
Environment: xenserver-70 (x2), Advanced Networking with Mgmt server 7
Total time taken: 52977 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4207-t2279-xenserver-70.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_supported_versions.py
Intermittent failure detected: /marvin/tests/smoke/test_templates.py
Smoke tests completed. 82 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_add_delete_kubernetes_supported_version Error 1807.44 test_kubernetes_supported_versions.py
test_04_extract_template Failure 1.17 test_templates.py

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2284)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 47386 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4207-t2284-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Intermittent failure detected: /marvin/tests/smoke/test_reset_vm_on_reboot.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 80 look OK, 4 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_deploy_kubernetes_cluster Error 0.06 test_kubernetes_clusters.py
test_02_deploy_kubernetes_ha_cluster Error 0.04 test_kubernetes_clusters.py
test_04_deploy_and_upgrade_kubernetes_cluster Error 0.03 test_kubernetes_clusters.py
test_05_deploy_and_upgrade_kubernetes_ha_cluster Error 0.03 test_kubernetes_clusters.py
test_06_deploy_and_invalid_upgrade_kubernetes_cluster Error 0.03 test_kubernetes_clusters.py
test_07_deploy_and_scale_kubernetes_cluster Error 0.03 test_kubernetes_clusters.py
test_01_reset_vm_on_reboot Error 7.20 test_reset_vm_on_reboot.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 374.11 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Error 3857.87 test_vpc_redundant.py
test_hostha_kvm_host_fencing Error 167.28 test_hostha_kvm.py

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1670

@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1672

@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1673

@Spaceman1984

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@Spaceman1984 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@borisstoyanov borisstoyanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2294)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 50425 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4207-t2294-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Intermittent failure detected: /marvin/tests/smoke/test_password_server.py
Intermittent failure detected: /marvin/tests/smoke/test_reset_vm_on_reboot.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 81 look OK, 3 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_reset_vm_on_reboot Error 7.25 test_reset_vm_on_reboot.py
test_04_rvpc_network_garbage_collector_nics Error 3811.18 test_vpc_redundant.py
test_hostha_kvm_host_fencing Error 370.82 test_hostha_kvm.py

@alexandremattioli

Copy link
Copy Markdown
Contributor

LGTM

@yadvr

yadvr commented Aug 11, 2020

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✔debian. JID-1709

@yadvr

yadvr commented Aug 11, 2020

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2364)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 44721 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4207-t2364-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_supported_versions.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 82 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_add_delete_kubernetes_supported_version Error 1809.79 test_kubernetes_supported_versions.py
test_hostha_kvm_host_degraded Error 5.78 test_hostha_kvm.py
test_hostha_kvm_host_fencing Error 214.92 test_hostha_kvm.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants