Shirly Radco has uploaded a new change for review.

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

reports: dr6 report - added comments to queries

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

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/59/27859/1

diff --git 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_host_uptime_status_dr6_jrxml.data
 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_host_uptime_status_dr6_jrxml.data
index 44dd743..6469340 100644
--- 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_host_uptime_status_dr6_jrxml.data
+++ 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_host_uptime_status_dr6_jrxml.data
@@ -1,24 +1,51 @@
 <?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_host_uptime_status_dr6" language="groovy" pageWidth="534" 
pageHeight="35" whenNoDataType="AllSectionsNoDetail" columnWidth="534" 
leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" 
resourceBundle="ovirt_reports_bundle" whenResourceMissingType="Error" 
uuid="04941db3-31ab-4425-9015-0d7bd4586d1b">
        <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"/>
-       <parameter name="P_Cluster_ID" class="java.lang.String">
-               <defaultValueExpression><![CDATA[]]></defaultValueExpression>
-       </parameter>
-       <queryString>
-               <![CDATA[SELECT (SUM(CASE WHEN 
v3_5_statistics_hosts_resources_usage_samples.host_status = 1 THEN 
coalesce(v3_5_statistics_hosts_resources_usage_samples.minutes_in_status,0) 
ELSE 0 END) / 
SUM(v3_5_statistics_hosts_resources_usage_samples.minutes_in_status)) * 100 as 
uptime_mins_percent
+       <property name="ireport.jasperserver.url" 
value="http://localhost:8080/jasperserver-pro/"/>
+       <property name="ireport.jasperserver.report.resource" 
value="/reports_resources/embedded_reports/webadmin_dashboards/cluster_dashboard/jrxmls/cluster_host_uptime_status_dr6_jrxml"/>
+       <parameter name="P_Cluster_ID" class="java.lang.String"/>
+       <queryString language="SQL">
+               <![CDATA[-- DR6 - This query returns the average
+-- resources that  are not used ( cpu and memory )
+-- for the hosts in the specific cluster
+
+SELECT
+    (
+        SUM (
+            CASE
+                WHEN
+                    v3_5_statistics_hosts_resources_usage_samples.host_status 
= 1
+                        THEN
+                            COALESCE (
+                                
v3_5_statistics_hosts_resources_usage_samples.minutes_in_status,
+                                0
+                            )
+                ELSE 0
+            END
+        ) /
+        SUM (
+            v3_5_statistics_hosts_resources_usage_samples.minutes_in_status
+        )
+    ) * 100
+    AS uptime_mins_percent
 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)]]>
+    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 )]]>
        </queryString>
        <field name="uptime_mins_percent" class="java.math.BigDecimal"/>
        <summary>
                <band height="35" splitType="Stretch">
                        <textField>
-                               <reportElement 
uuid="646e1c49-211d-417d-b0ca-3cbeacb5569d" x="0" y="0" width="387" height="35" 
forecolor="#333333"/>
+                               <reportElement x="0" y="0" width="387" 
height="35" forecolor="#333333" uuid="646e1c49-211d-417d-b0ca-3cbeacb5569d"/>
                                <textElement verticalAlignment="Middle" 
markup="html">
                                        <font fontName="SansSerif" size="15"/>
                                </textElement>
@@ -26,14 +53,14 @@
                                
<hyperlinkTooltipExpression><![CDATA["Calculates average uptime percent for all 
hosts. Displays check mark if uptime is over 60%, otherwise displays X 
mark.\nThis query is calculated from the hosts' statistics samples view for the 
selected cluster."]]></hyperlinkTooltipExpression>
                        </textField>
                        <image>
-                               <reportElement 
uuid="f62694a7-214e-4e78-966a-2797bdf4f059" x="387" y="10" width="17" 
height="15">
+                               <reportElement x="387" y="10" width="17" 
height="15" uuid="f62694a7-214e-4e78-966a-2797bdf4f059">
                                        
<printWhenExpression><![CDATA[$F{uptime_mins_percent} == null || 
$F{uptime_mins_percent} >= 60]]></printWhenExpression>
                                </reportElement>
                                
<imageExpression><![CDATA["repo:/reports_resources/check-mark.jpg"]]></imageExpression>
                                
<hyperlinkTooltipExpression><![CDATA["Calculates average uptime percent for all 
hosts. Displays check mark if uptime is over 60%, otherwise displays X 
mark.\nThis query is calculated from the hosts' statistics samples view for the 
selected cluster."]]></hyperlinkTooltipExpression>
                        </image>
                        <image>
-                               <reportElement 
uuid="e0fd1cfb-fa18-47a8-84ff-f1c8eecf46d2" x="387" y="10" width="17" 
height="15">
+                               <reportElement x="387" y="10" width="17" 
height="15" uuid="e0fd1cfb-fa18-47a8-84ff-f1c8eecf46d2">
                                        
<printWhenExpression><![CDATA[$F{uptime_mins_percent} != null && 
$F{uptime_mins_percent} < 60]]></printWhenExpression>
                                </reportElement>
                                
<imageExpression><![CDATA["repo:/reports_resources/x-mark.jpg"]]></imageExpression>


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

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