Shirly Radco has uploaded a new change for review. Change subject: reports: dr21 report - added comments to queries ......................................................................
reports: dr21 report - added comments to queries Changed the code structure so it will be more readable and added commets. Change-Id: I41e7e67f550a1ea2a9afbce11bc02ed04b1e1759 Signed-off-by: Shirly Radco <[email protected]> --- M packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/datacenter_top_five_busiest_clusters_dr21_jrxml.data 1 file changed, 40 insertions(+), 14 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/86/27886/1 diff --git a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/datacenter_top_five_busiest_clusters_dr21_jrxml.data b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/datacenter_top_five_busiest_clusters_dr21_jrxml.data index 5670749..5f9b942 100644 --- a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/datacenter_top_five_busiest_clusters_dr21_jrxml.data +++ b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/datacenter_top_five_busiest_clusters_dr21_jrxml.data @@ -1,23 +1,49 @@ <?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="datacenter_top_five_busiest_clusters_dr21" 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="a27761af-05aa-412c-b09c-febe2220960e"> <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/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="net.sf.jasperreports.chart.theme" value="ReportsLineBarChartTheme"/> - <parameter name="P_DataCenter_ID" class="java.lang.String"> - <defaultValueExpression><![CDATA[]]></defaultValueExpression> - </parameter> - <queryString> - <![CDATA[SELECT v3_5_latest_configuration_clusters.cluster_id, v3_5_latest_configuration_clusters.cluster_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/dc_dashboard/jrxmls/datacenter_top_five_busiest_clusters_dr21_jrxml"/> + <parameter name="P_DataCenter_ID" class="java.lang.String"/> + <queryString language="SQL"> + <![CDATA[-- DR21 - This query returns for the top 5 busiest clusters, +-- the max and average cpu and memory usage percent. + +SELECT + v3_5_latest_configuration_clusters.cluster_id, + v3_5_latest_configuration_clusters.cluster_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) - INNER JOIN v3_5_latest_configuration_clusters ON (v3_5_latest_configuration_clusters.cluster_id = v3_5_latest_configuration_hosts.cluster_id) -WHERE v3_5_statistics_hosts_resources_usage_samples.host_status = 1 - AND 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 -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 + ) + INNER JOIN v3_5_latest_configuration_clusters + ON ( + v3_5_latest_configuration_clusters.cluster_id = + v3_5_latest_configuration_hosts.cluster_id + ) +WHERE + -- Here we get only active hosts + v3_5_statistics_hosts_resources_usage_samples.host_status = 1 + -- Here we filter by the datacenter chosen by the user + AND 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 +ORDER BY + AVG ( cpu_usage_percent ) + + MAX ( cpu_usage_percent ) + + AVG ( memory_usage_percent ) + + MAX ( memory_usage_percent ) DESC LIMIT 5]]> </queryString> <field name="cluster_id" class="java.lang.Object"/> @@ -30,7 +56,7 @@ <band height="260" splitType="Stretch"> <barChart> <chart customizerClass="com.ovirt.reports.jasper.DrBarChartCustomizer" theme="WebadminLineBarChartTheme"> - <reportElement uuid="9d1b8366-a42e-4163-a775-7757377d153e" x="0" y="0" width="445" height="260"/> + <reportElement x="0" y="0" width="445" height="260" uuid="9d1b8366-a42e-4163-a775-7757377d153e"/> <chartTitle> <font fontName="SansSerif" size="10"/> <titleExpression><![CDATA[$R{dr21.title}]]></titleExpression> -- To view, visit http://gerrit.ovirt.org/27886 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I41e7e67f550a1ea2a9afbce11bc02ed04b1e1759 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
