Shirly Radco has uploaded a new change for review. Change subject: reports: dr23 report - added comments to queries ......................................................................
reports: dr23 report - added comments to queries Changed the code structure so it will be more readable and added commets. Change-Id: I16db527cafcf5cc45933627dc7cdafefbc98d48c Signed-off-by: Shirly Radco <[email protected]> --- M packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_top_five_busiest_hosts_dr23_jrxml.data 1 file changed, 35 insertions(+), 13 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/76/27876/1 diff --git a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_top_five_busiest_hosts_dr23_jrxml.data b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_top_five_busiest_hosts_dr23_jrxml.data index 6dbca83..8203bdc 100644 --- a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_top_five_busiest_hosts_dr23_jrxml.data +++ b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_top_five_busiest_hosts_dr23_jrxml.data @@ -1,22 +1,44 @@ <?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="cluster_top_five_busiest_hosts_dr23" 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="086f591c-60f9-464c-9592-1db1f2f4305b"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> - <property name="ireport.jasperserver.reportUnit" value="/reports_resources/webadmin_dashboards/ce/cluster_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="net.sf.jasperreports.chart.theme" value="ReportsLineBarChartTheme"/> - <parameter name="P_Cluster_ID" class="java.lang.String"> - <defaultValueExpression><![CDATA[]]></defaultValueExpression> - </parameter> - <queryString> - <![CDATA[SELECT v3_5_latest_configuration_hosts.host_id, v3_5_latest_configuration_hosts.host_name, AVG(cpu_usage_percent) AS cpu_usage_percent_avg, MAX(cpu_usage_percent) AS cpu_usage_percent_max, AVG(memory_usage_percent) AS memory_usage_percent_avg, MAX(memory_usage_percent) AS memory_usage_percent_max + <property name="ireport.jasperserver.report.resource" value="/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_top_five_busiest_hosts_dr23_jrxml"/> + <parameter name="P_Cluster_ID" class="java.lang.String"/> + <queryString language="SQL"> + <![CDATA[-- DR23 - This query returns the +-- cpu and memory usage for the +-- top 5 busiest hosts + +SELECT + v3_5_latest_configuration_hosts.host_id, v3_5_latest_configuration_hosts.host_name, + AVG ( cpu_usage_percent ) AS cpu_usage_percent_avg, + MAX ( cpu_usage_percent ) AS cpu_usage_percent_max, + AVG ( memory_usage_percent ) AS memory_usage_percent_avg, + MAX ( memory_usage_percent ) AS memory_usage_percent_max 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) -WHERE v3_5_statistics_hosts_resources_usage_samples.host_status = 1 - AND v3_5_latest_configuration_hosts.cluster_id = cast($P{P_Cluster_ID} as UUID) -GROUP BY v3_5_latest_configuration_hosts.host_id, v3_5_latest_configuration_hosts.host_name -ORDER BY AVG(cpu_usage_percent) + MAX(cpu_usage_percent) + AVG(memory_usage_percent) + MAX(memory_usage_percent) DESC + INNER JOIN v3_5_latest_configuration_hosts + ON ( + v3_5_latest_configuration_hosts.host_id = + v3_5_statistics_hosts_resources_usage_samples.host_id + ) +WHERE + -- Here we get only active hosts + v3_5_statistics_hosts_resources_usage_samples.host_status = 1 + -- Here we filter by the cluster chosen by the user + AND v3_5_latest_configuration_hosts.cluster_id = + CAST ( $P{P_Cluster_ID} AS UUID ) +GROUP BY + v3_5_latest_configuration_hosts.host_id, + v3_5_latest_configuration_hosts.host_name +ORDER BY + AVG ( cpu_usage_percent ) + + MAX ( cpu_usage_percent ) + + AVG ( memory_usage_percent ) + + MAX ( memory_usage_percent ) DESC LIMIT 5]]> </queryString> <field name="host_id" class="java.lang.Object"/> @@ -29,7 +51,7 @@ <band height="260" splitType="Stretch"> <barChart> <chart customizerClass="com.ovirt.reports.jasper.DrBarChartCustomizer" theme="WebadminLineBarChartTheme"> - <reportElement uuid="3bcbf87d-5451-48d5-8b8e-9fa88c53af73" x="0" y="0" width="445" height="260"/> + <reportElement x="0" y="0" width="445" height="260" uuid="3bcbf87d-5451-48d5-8b8e-9fa88c53af73"/> <chartTitle> <font fontName="SansSerif" size="10"/> <titleExpression><![CDATA[$R{dr23.title}]]></titleExpression> -- To view, visit http://gerrit.ovirt.org/27876 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16db527cafcf5cc45933627dc7cdafefbc98d48c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-reports Gerrit-Branch: master Gerrit-Owner: Shirly Radco <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
