Shirly Radco has uploaded a new change for review.

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

reports: dr4 report - added comments to queries

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

Change-Id: I619715966b19cb75bdaba17d5b764c9be13f5a43
Signed-off-by: Shirly Radco <[email protected]>
---
M 
packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_host_uptime_status_dr4_jrxml.data
1 file changed, 33 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/13/27913/1

diff --git 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_host_uptime_status_dr4_jrxml.data
 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_host_uptime_status_dr4_jrxml.data
index 8633dd2..5f8787b 100644
--- 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_host_uptime_status_dr4_jrxml.data
+++ 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_host_uptime_status_dr4_jrxml.data
@@ -1,19 +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="system_host_uptime_status_dr4" language="groovy" pageWidth="534" 
pageHeight="35" columnWidth="534" leftMargin="0" rightMargin="0" topMargin="0" 
bottomMargin="0" resourceBundle="ovirt_reports_bundle" 
whenResourceMissingType="Error" uuid="280aaf56-527a-469f-8439-912760450f4f">
        <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/system_dashboard"/>
-       <property name="ireport.jasperserver.url" 
value="http://localhost:8080/jasperserver-pro/services/repository"/>
-       <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
-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)]]>
+       <property name="ireport.jasperserver.url" 
value="http://localhost:8080/jasperserver-pro/"/>
+       <property name="ireport.jasperserver.report.resource" 
value="/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_host_uptime_status_dr4_jrxml"/>
+       <queryString language="SQL">
+               <![CDATA[-- DR4 - This query returns the total hosts uptime 
percent
+
+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
+        )]]>
        </queryString>
        <field name="uptime_mins_percent" class="java.math.BigDecimal"/>
        <summary>
                <band height="35" splitType="Stretch">
                        <textField>
-                               <reportElement 
uuid="8c74a391-0006-46e4-8a6d-5b7a18a896f6" x="0" y="0" width="370" height="35" 
forecolor="#333333"/>
+                               <reportElement x="0" y="0" width="370" 
height="35" forecolor="#333333" uuid="8c74a391-0006-46e4-8a6d-5b7a18a896f6"/>
                                <textElement verticalAlignment="Middle" 
markup="html">
                                        <font fontName="SansSerif" size="15"/>
                                </textElement>
@@ -21,14 +46,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 
system."]]></hyperlinkTooltipExpression>
                        </textField>
                        <image>
-                               <reportElement 
uuid="dadd5546-2da8-4a19-b802-c9d2167f03d9" x="370" y="10" width="17" 
height="15">
+                               <reportElement x="370" y="10" width="17" 
height="15" uuid="dadd5546-2da8-4a19-b802-c9d2167f03d9">
                                        
<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 
system."]]></hyperlinkTooltipExpression>
                        </image>
                        <image>
-                               <reportElement 
uuid="e6ce90db-aa5d-4df9-92b8-201a5d0653f5" x="370" y="10" width="17" 
height="15">
+                               <reportElement x="370" y="10" width="17" 
height="15" uuid="e6ce90db-aa5d-4df9-92b8-201a5d0653f5">
                                        
<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/27913
To unsubscribe, visit http://gerrit.ovirt.org/settings

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