Shirly Radco has uploaded a new change for review.

Change subject: reports: dr28 report - added comments to queries
......................................................................

reports: dr28 report - added comments to queries

Changed the code structure so it will be more readable
and added commets.

Change-Id: I2876cf26aeadb8f9275ab467a189135d12d41cec
Signed-off-by: Shirly Radco <[email protected]>
---
M 
packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_summary_of_hosts_resources_usage_dr28_jrxml.data
1 file changed, 42 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/61/27861/1

diff --git 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_summary_of_hosts_resources_usage_dr28_jrxml.data
 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_summary_of_hosts_resources_usage_dr28_jrxml.data
index c744aa2..d05ce75 100644
--- 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_summary_of_hosts_resources_usage_dr28_jrxml.data
+++ 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_summary_of_hosts_resources_usage_dr28_jrxml.data
@@ -1,32 +1,52 @@
 <?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_summary_of_hosts_resources_usage_dr28" 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="a7d8d179-0d6a-432c-b7b3-4df95e14442d">
-       <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="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/cluster_dashboard/jrxmls/cluster_summary_of_hosts_resources_usage_dr28_jrxml"/>
        <parameter name="P_Cluster_ID" class="java.lang.String">
                
<defaultValueExpression><![CDATA["00000000-0000-0000-0000-000000000000"]]></defaultValueExpression>
        </parameter>
-       <queryString>
-               <![CDATA[-- Hosts Average Usage Peaks
-SELECT host_id,
-       host_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_hosts.host_id,
-             v3_5_latest_configuration_hosts.host_name,
-             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)
-      WHERE 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,
-         date_trunc('hour', 
v3_5_statistics_hosts_resources_usage_samples.history_datetime)) AS 
TBL_samples_PEAKS
-GROUP BY host_id, host_name]]>
+       <queryString language="SQL">
+               <![CDATA[-- DR28 - This query returns the
+-- average cpu and memory peaks per host
+-- for the specific cluster
+
+SELECT
+    host_id,
+    host_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_hosts.host_id,
+        v3_5_latest_configuration_hosts.host_name,
+        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
+            )
+    WHERE
+        -- Here we filter by the cluster chosen by the user
+        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,
+        DATE_TRUNC (
+            'hour',
+            v3_5_statistics_hosts_resources_usage_samples.history_datetime
+        )
+) AS TBL_samples_PEAKS
+GROUP BY
+    host_id,
+    host_name]]>
        </queryString>
        <field name="host_id" class="java.lang.Object"/>
        <field name="host_name" class="java.lang.String"/>
@@ -51,7 +71,7 @@
                <band height="260" splitType="Stretch">
                        <scatterChart>
                                <chart isShowLegend="false" 
evaluationTime="Report" hyperlinkTarget="Blank" renderType="draw" 
theme="WebadminLineBarChartTheme">
-                                       <reportElement 
uuid="501925f9-b8f3-46bf-9ec0-466a5943f760" x="0" y="0" width="445" 
height="260"/>
+                                       <reportElement x="0" y="0" width="445" 
height="260" uuid="501925f9-b8f3-46bf-9ec0-466a5943f760"/>
                                        <box>
                                                <pen lineWidth="0.0" 
lineColor="#3C617F"/>
                                                <topPen lineWidth="0.0" 
lineColor="#3C617F"/>


-- 
To view, visit http://gerrit.ovirt.org/27861
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2876cf26aeadb8f9275ab467a189135d12d41cec
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

Reply via email to