Skip to content

Conversation

@yadvr
Copy link
Member

@yadvr yadvr commented Feb 16, 2017

This improves the metrics view feature by improving the rendering performance
of metrics view tables, by re-implementing the logic at the backend and data
served via APIs. In large environments, the older implementation would
make several API calls that increases both network and database load.

List of APIs introduced for improving the performance that re-implement the frontend logic at backend:

listClustersMetrics
listHostsMetrics
listInfrastructure
listStoragePoolsMetrics
listVMsMetrics
listVolumesMetrics
listZonesMetrics

Pinging for review - @abhinandanprateek @DaanHoogland @borisstoyanov @karuturi @rashmidixit

Marvin test results:

=== TestName: test_list_clusters_metrics | Status : SUCCESS ===

=== TestName: test_list_hosts_metrics | Status : SUCCESS ===

=== TestName: test_list_infrastructure_metrics | Status : SUCCESS ===

=== TestName: test_list_pstorage_metrics | Status : SUCCESS ===

=== TestName: test_list_vms_metrics | Status : SUCCESS ===

=== TestName: test_list_volumes_metrics | Status : SUCCESS ===

=== TestName: test_list_zones_metrics | Status : SUCCESS ===

@yadvr
Copy link
Member Author

yadvr commented Feb 16, 2017

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-492

@yadvr
Copy link
Member Author

yadvr commented Feb 16, 2017

@blueorangutan test

@blueorangutan
Copy link

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

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

Thanks Rohit, this really improves the load time of the infrastructure page.
LGTM

@yadvr
Copy link
Member Author

yadvr commented Feb 16, 2017

Thanks for testing/reviewing @borisstoyanov

@blueorangutan
Copy link

Trillian test result (tid-833)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 28094 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1944-t833-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_metrics_api.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Test completed. 47 look ok, 2 have error(s)

Test Result Time (s) Test File
test_04_rvpc_privategw_static_routes Failure 355.57 test_privategw_acl.py
test_list_vms_metrics Error 10.34 test_metrics_api.py
test_01_vpc_site2site_vpn Success 160.37 test_vpc_vpn.py
test_01_vpc_remote_access_vpn Success 71.41 test_vpc_vpn.py
test_01_redundant_vpc_site2site_vpn Success 307.09 test_vpc_vpn.py
test_02_VPC_default_routes Success 313.58 test_vpc_router_nics.py
test_01_VPC_nics_after_destroy Success 534.07 test_vpc_router_nics.py
test_05_rvpc_multi_tiers Success 521.52 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Success 1301.55 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Success 560.88 test_vpc_redundant.py
test_02_redundant_VPC_default_routes Success 760.16 test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Success 1282.47 test_vpc_redundant.py
test_09_delete_detached_volume Success 156.78 test_volumes.py
test_08_resize_volume Success 156.38 test_volumes.py
test_07_resize_fail Success 161.46 test_volumes.py
test_06_download_detached_volume Success 156.28 test_volumes.py
test_05_detach_volume Success 155.78 test_volumes.py
test_04_delete_attached_volume Success 151.10 test_volumes.py
test_03_download_attached_volume Success 156.46 test_volumes.py
test_02_attach_volume Success 94.97 test_volumes.py
test_01_create_volume Success 711.44 test_volumes.py
test_deploy_vm_multiple Success 253.11 test_vm_life_cycle.py
test_deploy_vm Success 0.03 test_vm_life_cycle.py
test_advZoneVirtualRouter Success 0.02 test_vm_life_cycle.py
test_10_attachAndDetach_iso Success 26.68 test_vm_life_cycle.py
test_09_expunge_vm Success 185.31 test_vm_life_cycle.py
test_08_migrate_vm Success 40.88 test_vm_life_cycle.py
test_07_restore_vm Success 0.13 test_vm_life_cycle.py
test_06_destroy_vm Success 125.76 test_vm_life_cycle.py
test_03_reboot_vm Success 125.85 test_vm_life_cycle.py
test_02_start_vm Success 10.17 test_vm_life_cycle.py
test_01_stop_vm Success 40.31 test_vm_life_cycle.py
test_CreateTemplateWithDuplicateName Success 50.49 test_templates.py
test_08_list_system_templates Success 0.03 test_templates.py
test_07_list_public_templates Success 0.04 test_templates.py
test_05_template_permissions Success 0.08 test_templates.py
test_04_extract_template Success 5.15 test_templates.py
test_03_delete_template Success 5.10 test_templates.py
test_02_edit_template Success 90.18 test_templates.py
test_01_create_template Success 60.53 test_templates.py
test_10_destroy_cpvm Success 161.59 test_ssvm.py
test_09_destroy_ssvm Success 163.58 test_ssvm.py
test_08_reboot_cpvm Success 131.59 test_ssvm.py
test_07_reboot_ssvm Success 133.52 test_ssvm.py
test_06_stop_cpvm Success 131.79 test_ssvm.py
test_05_stop_ssvm Success 133.81 test_ssvm.py
test_04_cpvm_internals Success 1.21 test_ssvm.py
test_03_ssvm_internals Success 3.35 test_ssvm.py
test_02_list_cpvm_vm Success 0.11 test_ssvm.py
test_01_list_sec_storage_vm Success 0.14 test_ssvm.py
test_01_snapshot_root_disk Success 11.03 test_snapshots.py
test_04_change_offering_small Success 234.65 test_service_offerings.py
test_03_delete_service_offering Success 0.03 test_service_offerings.py
test_02_edit_service_offering Success 0.05 test_service_offerings.py
test_01_create_service_offering Success 0.10 test_service_offerings.py
test_02_sys_template_ready Success 0.12 test_secondary_storage.py
test_01_sys_vm_start Success 0.18 test_secondary_storage.py
test_09_reboot_router Success 35.28 test_routers.py
test_08_start_router Success 30.25 test_routers.py
test_07_stop_router Success 10.27 test_routers.py
test_06_router_advanced Success 0.06 test_routers.py
test_05_router_basic Success 0.04 test_routers.py
test_04_restart_network_wo_cleanup Success 5.71 test_routers.py
test_03_restart_network_cleanup Success 60.68 test_routers.py
test_02_router_internal_adv Success 1.06 test_routers.py
test_01_router_internal_basic Success 0.59 test_routers.py
test_router_dns_guestipquery Success 76.71 test_router_dns.py
test_router_dns_externalipquery Success 0.09 test_router_dns.py
test_router_dhcphosts Success 276.71 test_router_dhcphosts.py
test_router_dhcp_opts Success 21.73 test_router_dhcphosts.py
test_01_updatevolumedetail Success 0.13 test_resource_detail.py
test_01_reset_vm_on_reboot Success 130.84 test_reset_vm_on_reboot.py
test_createRegion Success 0.04 test_regions.py
test_create_pvlan_network Success 5.21 test_pvlan.py
test_dedicatePublicIpRange Success 0.39 test_public_ip_range.py
test_03_vpc_privategw_restart_vpc_cleanup Success 505.12 test_privategw_acl.py
test_02_vpc_privategw_static_routes Success 375.05 test_privategw_acl.py
test_01_vpc_privategw_acl Success 92.29 test_privategw_acl.py
test_01_primary_storage_nfs Success 35.85 test_primary_storage.py
test_createPortablePublicIPRange Success 15.22 test_portable_publicip.py
test_createPortablePublicIPAcquire Success 15.43 test_portable_publicip.py
test_isolate_network_password_server Success 89.53 test_password_server.py
test_UpdateStorageOverProvisioningFactor Success 0.12 test_over_provisioning.py
test_oobm_zchange_password Success 30.61 test_outofbandmanagement.py
test_oobm_multiple_mgmt_server_ownership Success 16.32 test_outofbandmanagement.py
test_oobm_issue_power_status Success 10.25 test_outofbandmanagement.py
test_oobm_issue_power_soft Success 15.31 test_outofbandmanagement.py
test_oobm_issue_power_reset Success 15.35 test_outofbandmanagement.py
test_oobm_issue_power_on Success 15.30 test_outofbandmanagement.py
test_oobm_issue_power_off Success 15.29 test_outofbandmanagement.py
test_oobm_issue_power_cycle Success 15.31 test_outofbandmanagement.py
test_oobm_enabledisable_across_clusterzones Success 87.62 test_outofbandmanagement.py
test_oobm_enable_feature_valid Success 5.14 test_outofbandmanagement.py
test_oobm_enable_feature_invalid Success 0.08 test_outofbandmanagement.py
test_oobm_disable_feature_valid Success 5.17 test_outofbandmanagement.py
test_oobm_disable_feature_invalid Success 0.13 test_outofbandmanagement.py
test_oobm_configure_invalid_driver Success 0.08 test_outofbandmanagement.py
test_oobm_configure_default_driver Success 0.07 test_outofbandmanagement.py
test_oobm_background_powerstate_sync Success 23.40 test_outofbandmanagement.py
test_extendPhysicalNetworkVlan Success 15.28 test_non_contigiousvlan.py
test_01_nic Success 419.56 test_nic.py
test_releaseIP Success 247.74 test_network.py
test_reboot_router Success 418.48 test_network.py
test_public_ip_user_account Success 10.24 test_network.py
test_public_ip_admin_account Success 40.26 test_network.py
test_network_rules_acquired_public_ip_3_Load_Balancer_Rule Success 66.82 test_network.py
test_network_rules_acquired_public_ip_2_nat_rule Success 61.76 test_network.py
test_network_rules_acquired_public_ip_1_static_nat_rule Success 124.73 test_network.py
test_delete_account Success 292.73 test_network.py
test_02_port_fwd_on_non_src_nat Success 55.68 test_network.py
test_01_port_fwd_on_src_nat Success 111.98 test_network.py
test_nic_secondaryip_add_remove Success 218.31 test_multipleips_per_nic.py
test_list_zones_metrics Success 0.22 test_metrics_api.py
test_list_volumes_metrics Success 5.38 test_metrics_api.py
test_list_pstorage_metrics Success 0.22 test_metrics_api.py
test_list_infrastructure_metrics Success 0.32 test_metrics_api.py
test_list_hosts_metrics Success 0.21 test_metrics_api.py
test_list_clusters_metrics Success 0.23 test_metrics_api.py
login_test_saml_user Success 19.15 test_login.py
test_assign_and_removal_lb Success 133.10 test_loadbalance.py
test_02_create_lb_rule_non_nat Success 187.10 test_loadbalance.py
test_01_create_lb_rule_src_nat Success 217.61 test_loadbalance.py
test_03_list_snapshots Success 0.06 test_list_ids_parameter.py
test_02_list_templates Success 0.04 test_list_ids_parameter.py
test_01_list_volumes Success 0.03 test_list_ids_parameter.py
test_07_list_default_iso Success 0.06 test_iso.py
test_05_iso_permissions Success 0.06 test_iso.py
test_04_extract_Iso Success 5.14 test_iso.py
test_03_delete_iso Success 95.10 test_iso.py
test_02_edit_iso Success 0.06 test_iso.py
test_01_create_iso Success 20.97 test_iso.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfaces Success 213.87 test_internal_lb.py
test_03_vpc_internallb_haproxy_stats_on_all_interfaces Success 147.73 test_internal_lb.py
test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 Success 542.70 test_internal_lb.py
test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 Success 436.18 test_internal_lb.py
test_dedicateGuestVlanRange Success 10.25 test_guest_vlan_range.py
test_UpdateConfigParamWithScope Success 0.12 test_global_settings.py
test_rolepermission_lifecycle_update Success 6.11 test_dynamicroles.py
test_rolepermission_lifecycle_list Success 5.94 test_dynamicroles.py
test_rolepermission_lifecycle_delete Success 5.82 test_dynamicroles.py
test_rolepermission_lifecycle_create Success 5.86 test_dynamicroles.py
test_rolepermission_lifecycle_concurrent_updates Success 5.96 test_dynamicroles.py
test_role_lifecycle_update_role_inuse Success 5.88 test_dynamicroles.py
test_role_lifecycle_update Success 10.95 test_dynamicroles.py
test_role_lifecycle_list Success 5.87 test_dynamicroles.py
test_role_lifecycle_delete Success 10.89 test_dynamicroles.py
test_role_lifecycle_create Success 5.93 test_dynamicroles.py
test_role_inuse_deletion Success 5.88 test_dynamicroles.py
test_role_account_acls_multiple_mgmt_servers Success 7.98 test_dynamicroles.py
test_role_account_acls Success 8.13 test_dynamicroles.py
test_default_role_deletion Success 6.08 test_dynamicroles.py
test_04_create_fat_type_disk_offering Success 0.06 test_disk_offerings.py
test_03_delete_disk_offering Success 0.03 test_disk_offerings.py
test_02_edit_disk_offering Success 0.04 test_disk_offerings.py
test_02_create_sparse_type_disk_offering Success 0.06 test_disk_offerings.py
test_01_create_disk_offering Success 0.10 test_disk_offerings.py
test_deployvm_userdispersing Success 20.57 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userconcentrated Success 20.66 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_firstfit Success 70.71 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userdata_post Success 10.37 test_deploy_vm_with_userdata.py
test_deployvm_userdata Success 65.80 test_deploy_vm_with_userdata.py
test_02_deploy_vm_root_resize Success 5.95 test_deploy_vm_root_resize.py
test_01_deploy_vm_root_resize Success 5.96 test_deploy_vm_root_resize.py
test_00_deploy_vm_root_resize Success 222.47 test_deploy_vm_root_resize.py
test_deploy_vm_from_iso Success 207.32 test_deploy_vm_iso.py
test_DeployVmAntiAffinityGroup Success 65.90 test_affinity_groups.py
test_03_delete_vm_snapshots Skipped 0.00 test_vm_snapshots.py
test_02_revert_vm_snapshots Skipped 0.00 test_vm_snapshots.py
test_01_test_vm_volume_snapshot Skipped 0.00 test_vm_snapshots.py
test_01_create_vm_snapshots Skipped 0.00 test_vm_snapshots.py
test_06_copy_template Skipped 0.00 test_templates.py
test_static_role_account_acls Skipped 0.02 test_staticroles.py
test_01_scale_vm Skipped 0.00 test_scale_vm.py
test_01_primary_storage_iscsi Skipped 0.03 test_primary_storage.py
test_06_copy_iso Skipped 0.00 test_iso.py
test_deploy_vgpu_enabled_vm Skipped 0.00 test_deploy_vgpu_enabled_vm.py

@borisstoyanov
Copy link
Contributor

Just triggered Trillian env to check the test failure.

@yadvr yadvr force-pushed the 4.9-metrics-enhancement branch from 3aba6ad to 3881d24 Compare February 17, 2017 05:45
@borisstoyanov
Copy link
Contributor

I've created a Trillian env out of the PR and run the test and it has passed:

test_list_vms_metrics (tests.smoke.test_metrics_api.TestMetrics) ... === TestName: test_list_vms_metrics | Status : SUCCESS ===
ok

@yadvr
Copy link
Member Author

yadvr commented Feb 17, 2017

Thanks @borisstoyanov test results LGTM.
/cc @karuturi

@yadvr
Copy link
Member Author

yadvr commented Feb 22, 2017

Requesting for review - @abhinandanprateek @DaanHoogland @rashmidixit @karuturi @koushik-das

@DaanHoogland
Copy link
Contributor

seen it work in practice: LGTM

@rashmidixit
Copy link

@rhtyd Will be trying this out today - will post my comments.

@yadvr
Copy link
Member Author

yadvr commented Feb 27, 2017

Thanks @rashmidixit awaiting your review

</dependency>
</dependencies>
<build>
<plugins>
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to follow maven standards on new modules. Since you cannot inherit from cloud-maven-standard you have to put all those lines:

<build>
    <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
    <scriptSourceDirectory>${basedir}/src/main/scripts</scriptSourceDirectory>
    <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
    <outputDirectory>${basedir}/target/classes</outputDirectory>
    <testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory>
    <resources>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>${basedir}/src/test/resources</directory>
      </testResource>
    </testResources>
    ...
</build>

@rashmidixit
Copy link

@rhtyd I pulled the code and was able to run it as well.
I just have one Q: you have added metrics as a pluggable service. However, from the UI is there a way to switch off the Metrics button in case someone decides not to ship the metrics service? I think we should take care of this part if it hasn't been done.

Otherwise LGTM.

@yadvr
Copy link
Member Author

yadvr commented Feb 27, 2017

@borisstoyanov can you see the failure in Travis with test_list_infrastructure_metrics test case?
Thanks @rashmidixit you're right I added this as a plugin to keep it separate from the core APIs. If this is a major concern, I can move these APIs to server/api modules.

From the UI, to remove this service they can modify the core metrics widget to do no-operation (in ui/scripts/ui-custom/metricsView.js) and the rendered button can be modified to be hidden, alternatively metricsView section can be removed across the resources (zones, cluster, host, vms, volumes and storage pool).

@rashmidixit
Copy link

@rhtyd On the contrary, I think you adding metrics as pluggable API is a good idea. However, to seriously make the feature pluggable the UI component should also load based on a plugin based flag.

For example (I am not sure if the current design makes this possible), the plugin should return a flag in the listCapabilities API which tells the UI that metrics is enabled. If this flag is present, the metrics button should appear, else not.

@yadvr
Copy link
Member Author

yadvr commented Feb 28, 2017

@rashmidixit the current UI does not support support pluggability of components within UI like the backend does. We can have a separate tab but not the implementation that the current metrics view UI has i.e. embedded across resource views. It's a general purpose feature that works for all deployments/environments and I think most users would want to keep it so we never implemented a way to disable it.

@yadvr yadvr closed this Feb 28, 2017
@yadvr yadvr reopened this Feb 28, 2017
@rashmidixit
Copy link

@rhtyd I guess this is fine for now. Thanks!

@yadvr
Copy link
Member Author

yadvr commented Feb 28, 2017

Thanks @rashmidixit

@karuturi this is ready for merge, as soon as Travis passes. Thanks.

This improves the metrics view feature by improving the rendering performance
of metrics view tables, by reimplementing the logic at the backend and data
served via APIs. In large environments, the older implementation would
make several API calls that increases both network and database load.

List of APIs introduced for improving the performance:

    listClustersMetrics
    listHostsMetrics
    listInfrastructure
    listStoragePoolsMetrics
    listVMsMetrics
    listVolumesMetrics
    listZonesMetrics

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr yadvr force-pushed the 4.9-metrics-enhancement branch from 6950feb to 4022535 Compare February 28, 2017 08:15
@yadvr yadvr closed this Mar 1, 2017
@yadvr yadvr reopened this Mar 1, 2017
@yadvr
Copy link
Member Author

yadvr commented Mar 15, 2017

@karuturi ping? can this be merged as well, this greatly improves the UI performance for the existing metrics view feature as well as improves the load time of the infrastructure tab
@abhinandanprateek @DaanHoogland - would you like to review this as well, thanks.

@yadvr
Copy link
Member Author

yadvr commented Mar 26, 2017

@karuturi this is merge-able and much needed enhancement to improve UI performance for large environments

@nvazquez
Copy link
Contributor

Hi @rhtyd, thanks for this great improvement! Along with @serg38 we've been testing in our env and got some failures on listHostsMetrics and listVolumeMetrics:

test_list_clusters_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_clusters_metrics | Status : SUCCESS ===
ok
test_list_hosts_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_hosts_metrics | Status : EXCEPTION ===
ERROR
test_list_infrastructure_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_infrastructure_metrics | Status : SUCCESS ===
ok
test_list_pstorage_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_pstorage_metrics | Status : SUCCESS ===
ok
test_list_vms_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_vms_metrics | Status : SUCCESS ===
ok
test_list_volumes_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_volumes_metrics | Status : EXCEPTION ===
ERROR
test_list_zones_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_zones_metrics | Status : SUCCESS ===
ok
[root@ussarlabcsmgt41 cloudstack]# cat /tmp//MarvinLogs//1A23HU/failed_plus_exceptions.txt
2017-03-31 10:21:19,514 - CRITICAL - EXCEPTION: test_list_hosts_metrics: ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python2.7/unittest/case.py", line 331, in run\n    testMethod()\n', '  File "/home/t_vazqnadmin/cloudstack/test/integration/smoke/test_metrics_api.py", line 77, in test_list_hosts_metrics\n    host_metric = self.apiclient.listHostsMetrics(cmd)[0]\n', '  File "/usr/local/lib/python2.7/site-packages/marvin/cloudstackAPI/cloudstackAPIClient.py", line 3094, in listHostsMetrics\n    response = self.connection.marvinRequest(command, response_type=response, method=method)\n', '  File "/usr/local/lib/python2.7/site-packages/marvin/cloudstackConnection.py", line 379, in marvinRequest\n    raise e\n', "CloudstackAPIException: Execute cmd: listhostsmetrics failed, due to: errorCode: 530, errorText:No value specified for 'Date'\n"]
2017-03-31 10:23:50,276 - CRITICAL - EXCEPTION: test_list_volumes_metrics: ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python2.7/unittest/case.py", line 331, in run\n    testMethod()\n', '  File "/home/t_vazqnadmin/cloudstack/test/integration/smoke/test_metrics_api.py", line 172, in test_list_volumes_metrics\n    lvm = self.apiclient.listVolumesMetrics(cmd)[0]\n', '  File "/usr/local/lib/python2.7/site-packages/marvin/cloudstackAPI/cloudstackAPIClient.py", line 954, in listVolumesMetrics\n    response = self.connection.marvinRequest(command, response_type=response, method=method)\n', '  File "/usr/local/lib/python2.7/site-packages/marvin/cloudstackConnection.py", line 379, in marvinRequest\n    raise e\n', "CloudstackAPIException: Execute cmd: listvolumesmetrics failed, due to: errorCode: 530, errorText:No value specified for 'Date'\n"]

Exception is thrown by BeanUtils.copyProperties, log on management server:

2017-03-31 10:28:33,257 ERROR [cloud.api.ApiServer] (catalina-exec-15:ctx-7fb0b31e ctx-6ded5acb) unhandled exception executing api command: [Ljava.lang.String;@63f1496d
org.apache.commons.beanutils.ConversionException: No value specified for 'Date'
        at org.apache.commons.beanutils.converters.AbstractConverter.handleMissing(AbstractConverter.java:310)
        at org.apache.commons.beanutils.converters.AbstractConverter.convert(AbstractConverter.java:136)
        at org.apache.commons.beanutils.converters.ConverterFacade.convert(ConverterFacade.java:60)
        at org.apache.commons.beanutils.BeanUtilsBean.convert(BeanUtilsBean.java:1078)
        at org.apache.commons.beanutils.BeanUtilsBean.copyProperty(BeanUtilsBean.java:437)
        at org.apache.commons.beanutils.BeanUtilsBean.copyProperties(BeanUtilsBean.java:286)
        at org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:137)
        at org.apache.cloudstack.metrics.MetricsServiceImpl.listHostMetrics(MetricsServiceImpl.java:244)
        at org.apache.cloudstack.api.ListHostsMetricsCmd.execute(ListHostsMetricsCmd.java:48)
        at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:150)
        at com.cloud.api.ApiServer.queueCommand(ApiServer.java:709)
        at com.cloud.api.ApiServer.handleRequest(ApiServer.java:533)
        at com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:299)
        at com.cloud.api.ApiServlet$1.run(ApiServlet.java:129)
        at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
        at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
        at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
        at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:126)
        at com.cloud.api.ApiServlet.doGet(ApiServlet.java:88)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:299)
        at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:889)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:732)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2274)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

In our case it failed for this hostResponse:

{"id":"be606171-57e0-4cef-99e3-d4f2d47478b4","name":"ussfoldcsesx116.adslab.local","state":"Up","disconnected":"Mar 29, 2017 11:24:21 PM","type":"Routing","ipaddress":"10.140.32.116","zoneid":"0d074f25-ed31-482f-8bc5-44c9314fc417","zonename":"ECS-NSX","podid":"01d4848c-5357-442a-bfce-d0c691fe5bdf","podname":"POD1","version":"4.9.3.0-SNAPSHOT","hypervisor":"VMware","cpusockets":2,"cpunumber":48,"cpuspeed":2596,"cpuallocated":"1.2%","cpuused":"0.3%","cpuwithoverprovisioning":"124608.0","networkkbsread":0,"networkkbswrite":0,"memorytotal":137308676096,"memoryallocated":2147483648,"memoryused":6262890496,"capabilities":"hvm","lastpinged":"Jan 17, 1970 12:27:11 PM","managementserverid":345051565299,"clusterid":"e13b0968-a61e-474f-939e-8d03a088a9cc","clustername":"ussfoldvs6vc027.adslab.local/ECS-CSDEV/CLD100","clustertype":"ExternalManaged","islocalstorageactive":false,"created":"Apr 19, 2016 3:19:24 PM","events":"PingTimeout; StartAgentRebalance; HostDown; AgentConnected; AgentDisconnected; ManagementServerDown; ShutdownRequested; Ping; Remove","hosttags":"test","outofbandmanagement":{"powerstate":"Disabled","enabled":false},"resourcestate":"Enabled","hypervisorversion":"6.0","hahost":false}

And metricsResponse after failure:

{"id":"be606171-57e0-4cef-99e3-d4f2d47478b4","name":"ussfoldcsesx116.adslab.local","disconnected":"Mar 29, 2017 11:24:21 PM","type":"Routing","ipaddress":"10.140.32.116","podid":"01d4848c-5357-442a-bfce-d0c691fe5bdf","podname":"POD1","hypervisor":"VMware","cpusockets":2,"cpunumber":48,"cpuspeed":2596,"cpuallocated":"1.2%","cpuused":"0.3%","cpuwithoverprovisioning":"124608.0","averageload":0,"networkkbsread":0,"networkkbswrite":0,"memorytotal":137308676096,"memoryallocated":2147483648,"memoryused":6262890496,"disksizetotal":0,"disksizeallocated":0,"capabilities":"hvm","lastpinged":"Jan 17, 1970 12:27:11 PM","managementserverid":345051565299,"clusterid":"e13b0968-a61e-474f-939e-8d03a088a9cc","clustername":"ussfoldvs6vc027.adslab.local/ECS-CSDEV/CLD100","clustertype":"ExternalManaged","islocalstorageactive":false,"created":"Apr 19, 2016 3:19:24 PM","events":"PingTimeout; StartAgentRebalance; HostDown; AgentConnected; AgentDisconnected; ManagementServerDown; ShutdownRequested; Ping; Remove","hosttags":"test","hasenoughcapacity":false,"hypervisorversion":"6.0","hahost":false,"jobstatus":0}

Did you have a failure like this?

@nvazquez
Copy link
Contributor

nvazquez commented Apr 4, 2017

Please ommit my last comment, we were using commons-beanutils version 1.8.3 instead of 1.9.2

LGTM

[root@ussarlabcsmgt41 cloudstack]# cat /tmp//MarvinLogs//DVIXST/results.txt
test_list_clusters_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_clusters_metrics | Status : SUCCESS ===
ok
test_list_hosts_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_hosts_metrics | Status : SUCCESS ===
ok
test_list_infrastructure_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_infrastructure_metrics | Status : SUCCESS ===
ok
test_list_pstorage_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_pstorage_metrics | Status : SUCCESS ===
ok
test_list_vms_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_vms_metrics | Status : SUCCESS ===
ok
test_list_volumes_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_volumes_metrics | Status : SUCCESS ===
ok
test_list_zones_metrics (test_metrics_api.TestMetrics) ... === TestName: test_list_zones_metrics | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 7 tests in 142.134s

OK

@karuturi
Copy link
Member

karuturi commented Apr 6, 2017

merging now

@asfgit asfgit merged commit 4022535 into apache:4.9 Apr 6, 2017
asfgit pushed a commit that referenced this pull request Apr 6, 2017
CLOUDSTACK-9783: Improve metrics view performanceThis improves the metrics view feature by improving the rendering performance
of metrics view tables, by re-implementing the logic at the backend and data
served via APIs. In large environments, the older implementation would
make several API calls that increases both network and database load.

List of APIs introduced for improving the performance that re-implement the frontend logic at backend:

    listClustersMetrics
    listHostsMetrics
    listInfrastructure
    listStoragePoolsMetrics
    listVMsMetrics
    listVolumesMetrics
    listZonesMetrics

Pinging for review - @abhinandanprateek @DaanHoogland @borisstoyanov @karuturi @rashmidixit

Marvin test results:

=== TestName: test_list_clusters_metrics | Status : SUCCESS ===

=== TestName: test_list_hosts_metrics | Status : SUCCESS ===

=== TestName: test_list_infrastructure_metrics | Status : SUCCESS ===

=== TestName: test_list_pstorage_metrics | Status : SUCCESS ===

=== TestName: test_list_vms_metrics | Status : SUCCESS ===

=== TestName: test_list_volumes_metrics | Status : SUCCESS ===

=== TestName: test_list_zones_metrics | Status : SUCCESS ===

* pr/1944:
  CLOUDSTACK-9783: Improve metrics view performance

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
@yadvr
Copy link
Member Author

yadvr commented Apr 6, 2017

Thanks @nvazquez @karuturi

@karuturi
Copy link
Member

karuturi commented Apr 7, 2017

master is broken after the merge. Pom version changes

asfgit pushed a commit that referenced this pull request Apr 7, 2017
CLOUDSTACK-9783: corrected the version number in metrics pommaster is broken after fwd-merging metrics PR #1944 from 4.9
This is due to the incorrect parent version number in the metrics pom.
Corrected the same to reflect master version number.

* pr/2032:
  CLOUDSTACK-9783: corrected the version number in metrics pom

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
@yadvr
Copy link
Member Author

yadvr commented Apr 7, 2017

@karuturi thanks for fixing it

abhinandanprateek pushed a commit to shapeblue/cloudstack that referenced this pull request Apr 26, 2017
master is broken after fwd-merging metrics PR apache#1944 from 4.9
This is due to the incorrect parent version number in the metrics pom.
Corrected the same to reflect master version number.
@karuturi karuturi modified the milestone: 4.10.0.0 Apr 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants