Shirly Radco has uploaded a new change for review. Change subject: reports: dr27 report - added comments to queries ......................................................................
reports: dr27 report - added comments to queries Changed the code structure so it will be more readable and added commets. Change-Id: Ic9bc62cc7e123f3d825eb8f89bbe6edc3978935e Signed-off-by: Shirly Radco <sra...@redhat.com> --- M packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_summary_of_cluster_hosts_resources_usage_dr27_jrxml.data 1 file changed, 47 insertions(+), 26 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/04/27904/1 diff --git a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_summary_of_cluster_hosts_resources_usage_dr27_jrxml.data b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_summary_of_cluster_hosts_resources_usage_dr27_jrxml.data index 2629fe4..25be08e 100644 --- a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_summary_of_cluster_hosts_resources_usage_dr27_jrxml.data +++ b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_summary_of_cluster_hosts_resources_usage_dr27_jrxml.data @@ -1,36 +1,57 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Created with Jaspersoft Studio version 5.5.0--> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="dc_summary_of_cluster_hosts_resources_usage_dr27" language="groovy" pageWidth="445" pageHeight="260" whenNoDataType="AllSectionsNoDetail" columnWidth="445" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" resourceBundle="ovirt_reports_bundle" whenResourceMissingType="Error" uuid="0018af59-8a45-40dd-a1b4-a6268c06df6a"> - <property name="ireport.jasperserver.reportUnit" value="/reports_resources/webadmin_dashboards/ce/datacenter_dashboard"/> - <property name="ireport.jasperserver.url" value="http://localhost:8080/jasperserver-pro/services/repository"/> + <property name="ireport.jasperserver.url" value="http://localhost:8080/jasperserver-pro/"/> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> + <property name="ireport.jasperserver.report.resource" value="/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_summary_of_cluster_hosts_resources_usage_dr27_jrxml"/> <parameter name="P_DataCenter_ID" class="java.lang.String"> <defaultValueExpression><![CDATA["00000000-0000-0000-0000-000000000000"]]></defaultValueExpression> </parameter> - <queryString> - <![CDATA[-- Hosts Average Usage Peaks -SELECT cluster_id, - cluster_name, - AVG(cpu_peak) AS avg_cpu_peak, - AVG(mem_peak) AS avg_mem_peak -FROM (-- Calculation of samples cpu and memory usage peaks - SELECT v3_5_latest_configuration_clusters.cluster_id, - v3_5_latest_configuration_clusters.cluster_name, - v3_5_latest_configuration_hosts.host_id, - MAX(cpu_usage_percent) as cpu_peak, - MAX(memory_usage_percent) as mem_peak - FROM v3_5_statistics_hosts_resources_usage_samples - INNER JOIN v3_5_latest_configuration_hosts - ON (v3_5_latest_configuration_hosts.host_id = v3_5_statistics_hosts_resources_usage_samples.host_id) - INNER JOIN v3_5_latest_configuration_clusters - ON (v3_5_latest_configuration_hosts.cluster_id = v3_5_latest_configuration_clusters.cluster_id) - WHERE v3_5_latest_configuration_clusters.datacenter_id = cast($P{P_DataCenter_ID} as UUID) - GROUP BY v3_5_latest_configuration_clusters.cluster_id, - v3_5_latest_configuration_clusters.cluster_name, - v3_5_latest_configuration_hosts.host_id, - date_part('hour', v3_5_statistics_hosts_resources_usage_samples.history_datetime)) AS TBL_samples_PEAKS -GROUP BY cluster_id, cluster_name]]> + <queryString language="SQL"> + <![CDATA[-- DR27 - This query returns the hosts Average Usage Peaks +-- per cluster in the chosen datacenter + +SELECT + cluster_id, + cluster_name, + AVG ( cpu_peak ) AS avg_cpu_peak, + AVG ( mem_peak ) AS avg_mem_peak +FROM ( + SELECT + v3_5_latest_configuration_clusters.cluster_id, + v3_5_latest_configuration_clusters.cluster_name, + v3_5_latest_configuration_hosts.host_id, + MAX ( cpu_usage_percent ) AS cpu_peak, + MAX ( memory_usage_percent ) AS mem_peak + FROM v3_5_statistics_hosts_resources_usage_samples + INNER JOIN v3_5_latest_configuration_hosts + ON ( + v3_5_latest_configuration_hosts.host_id = + v3_5_statistics_hosts_resources_usage_samples.host_id + ) + INNER JOIN v3_5_latest_configuration_clusters + ON ( + v3_5_latest_configuration_hosts.cluster_id = + v3_5_latest_configuration_clusters.cluster_id + ) + WHERE + -- Here we filter the datacenter chosen by the user + v3_5_latest_configuration_clusters.datacenter_id = + CAST ( $P{P_DataCenter_ID} AS UUID ) + GROUP BY + v3_5_latest_configuration_clusters.cluster_id, + v3_5_latest_configuration_clusters.cluster_name, + v3_5_latest_configuration_hosts.host_id, + DATE_PART ( + 'hour', + v3_5_statistics_hosts_resources_usage_samples.history_datetime + ) +) AS TBL_samples_PEAKS +GROUP BY + cluster_id, + cluster_name]]> </queryString> <field name="cluster_id" class="java.lang.Object"/> <field name="cluster_name" class="java.lang.String"/> @@ -55,7 +76,7 @@ <band height="260" splitType="Stretch"> <scatterChart> <chart isShowLegend="false" evaluationTime="Report" hyperlinkTarget="Blank" renderType="draw" theme="WebadminLineBarChartTheme"> - <reportElement uuid="76536f18-0236-4a44-890d-298729c6aa7d" x="0" y="0" width="445" height="260"/> + <reportElement x="0" y="0" width="445" height="260" uuid="76536f18-0236-4a44-890d-298729c6aa7d"/> <box> <pen lineWidth="0.0" lineColor="#3C617F"/> <topPen lineWidth="0.0" lineColor="#3C617F"/> -- To view, visit http://gerrit.ovirt.org/27904 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9bc62cc7e123f3d825eb8f89bbe6edc3978935e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-reports Gerrit-Branch: master Gerrit-Owner: Shirly Radco <sra...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches