Shirly Radco has uploaded a new change for review.

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

reports: dr8 report - added comments to queries

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

Change-Id: I5c0e3e64dd1ff84cd610d1710f33f167b517a284
Signed-off-by: Shirly Radco <[email protected]>
---
M 
packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_storage_space_status_dr8_jrxml.data
1 file changed, 37 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/03/27903/1

diff --git 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_storage_space_status_dr8_jrxml.data
 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_storage_space_status_dr8_jrxml.data
index f0aedac..7cac0bd 100644
--- 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_storage_space_status_dr8_jrxml.data
+++ 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_storage_space_status_dr8_jrxml.data
@@ -1,27 +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_storage_space_status_dr8" language="groovy" pageWidth="534" 
pageHeight="35" columnWidth="534" leftMargin="0" rightMargin="0" topMargin="0" 
bottomMargin="0" resourceBundle="ovirt_reports_bundle" 
whenResourceMissingType="Error" uuid="8e3f0e12-c523-4c66-b726-b7b352342b47">
        <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"/>
-       <parameter name="P_DataCenter_ID" class="java.lang.String">
-               <defaultValueExpression><![CDATA[]]></defaultValueExpression>
-       </parameter>
-       <queryString>
-               <![CDATA[SELECT (SUM(cast(available_disk_size_gb as float)) / 
SUM(cast(used_disk_size_gb as float) + cast(available_disk_size_gb as float))) 
* 100 as free_disk_size_gb_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/dc_dashboard/jrxmls/dc_storage_space_status_dr8_jrxml"/>
+       <parameter name="P_DataCenter_ID" class="java.lang.String"/>
+       <queryString language="SQL">
+               <![CDATA[-- DR8 - This query returns the available disk size 
percent
+-- of the storage domains in the chosen datacenter
+
+SELECT
+    (
+        SUM (
+            CAST ( available_disk_size_gb AS float )
+        ) /
+        SUM (
+            CAST ( used_disk_size_gb AS float ) +
+            CAST ( available_disk_size_gb AS float )
+        )
+    ) * 100
+    AS free_disk_size_gb_percent
 FROM storage_domain_samples_history
-     INNER JOIN v3_5_latest_map_datacenters_storage_domains ON 
(storage_domain_samples_history.storage_domain_id = 
v3_5_latest_map_datacenters_storage_domains.storage_domain_id)
-WHERE v3_5_latest_map_datacenters_storage_domains.datacenter_id = 
CAST($P{P_DataCenter_ID} as UUID)
-      AND storage_domain_samples_history.history_id in (SELECT 
max(a.history_id)
-                                                        FROM 
storage_domain_samples_history AS a
-                                                        GROUP BY 
a.storage_domain_id)]]>
+    INNER JOIN v3_5_latest_map_datacenters_storage_domains
+        ON (
+            storage_domain_samples_history.storage_domain_id =
+            v3_5_latest_map_datacenters_storage_domains.storage_domain_id
+        )
+WHERE
+    -- Here we filter the datacenter chosen by the user
+    v3_5_latest_map_datacenters_storage_domains.datacenter_id =
+    CAST ( $P{P_DataCenter_ID} AS UUID )
+    -- Here we get the latest storage domains configuration
+    AND storage_domain_samples_history.history_id IN (
+        SELECT MAX ( a.history_id )
+        FROM storage_domain_samples_history AS a
+        GROUP BY a.storage_domain_id
+    )]]>
        </queryString>
        <field name="free_disk_size_gb_percent" class="java.lang.Double"/>
        <summary>
                <band height="35" splitType="Stretch">
                        <textField>
-                               <reportElement 
uuid="9fd81865-1947-472e-83f3-8b287c7832f1" x="0" y="0" width="375" height="35" 
forecolor="#333333"/>
+                               <reportElement x="0" y="0" width="375" 
height="35" forecolor="#333333" uuid="9fd81865-1947-472e-83f3-8b287c7832f1"/>
                                <textElement verticalAlignment="Middle" 
markup="html">
                                        <font fontName="SansSerif" size="15"/>
                                </textElement>
@@ -29,14 +51,14 @@
                                
<hyperlinkTooltipExpression><![CDATA["Calculates free disk size percent average 
of all storage domains attached to the datacenter from their latest sample. 
Displays check mark if free disk space is over 60%, otherwise displays X 
mark."]]></hyperlinkTooltipExpression>
                        </textField>
                        <image>
-                               <reportElement 
uuid="9faf4e5e-3d3f-4b99-91da-b17301b4dd00" x="375" y="10" width="17" 
height="15">
+                               <reportElement x="375" y="10" width="17" 
height="15" uuid="9faf4e5e-3d3f-4b99-91da-b17301b4dd00">
                                        
<printWhenExpression><![CDATA[$F{free_disk_size_gb_percent} == null || 
$F{free_disk_size_gb_percent} >= 60]]></printWhenExpression>
                                </reportElement>
                                
<imageExpression><![CDATA["repo:/reports_resources/check-mark.jpg"]]></imageExpression>
                                
<hyperlinkTooltipExpression><![CDATA["Calculates free disk size percent average 
of all storage domains attached to the datacenter from their latest sample. 
Displays check mark if free disk space is over 60%, otherwise displays X 
mark."]]></hyperlinkTooltipExpression>
                        </image>
                        <image>
-                               <reportElement 
uuid="2550b310-5c63-46b9-9ce3-c72979405c0e" x="375" y="10" width="17" 
height="15">
+                               <reportElement x="375" y="10" width="17" 
height="15" uuid="2550b310-5c63-46b9-9ce3-c72979405c0e">
                                        
<printWhenExpression><![CDATA[$F{free_disk_size_gb_percent} != null && 
$F{free_disk_size_gb_percent} < 60]]></printWhenExpression>
                                </reportElement>
                                
<imageExpression><![CDATA["repo:/reports_resources/x-mark.jpg"]]></imageExpression>


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

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