Shirly Radco has uploaded a new change for review. Change subject: reports: dr26 report - added comments to queries ......................................................................
reports: dr26 report - added comments to queries Changed the code structure so it will be more readable and added commets. Change-Id: Ie25846b58664f0e38fa1cac8b10fb8b7a4b57165 Signed-off-by: Shirly Radco <[email protected]> --- M packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_top_five_used_storage_domain_dr26_jrxml.data 1 file changed, 58 insertions(+), 18 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/06/27906/1 diff --git a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_top_five_used_storage_domain_dr26_jrxml.data b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_top_five_used_storage_domain_dr26_jrxml.data index d5beb82..57ef21a 100644 --- a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_top_five_used_storage_domain_dr26_jrxml.data +++ b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_top_five_used_storage_domain_dr26_jrxml.data @@ -1,26 +1,66 @@ <?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="dc_top_five_used_storage_domain_dr26" 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="d47c0249-2df7-4e1a-8c42-f0d8863bd217"> <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 v3_5_latest_configuration_storage_domains.storage_domain_id, v3_5_latest_configuration_storage_domains.storage_domain_name, available_disk_size_gb, used_disk_size_gb, (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_top_five_used_storage_domain_dr26_jrxml"/> + <parameter name="P_DataCenter_ID" class="java.lang.String"/> + <queryString language="SQL"> + <![CDATA[-- DR27 - This query returns, for the 5 storage domains +-- with the lowest available disk space, the available disk size, +-- used disk size and available disk size percent. + +SELECT + v3_5_latest_configuration_storage_domains.storage_domain_id, + v3_5_latest_configuration_storage_domains.storage_domain_name, + available_disk_size_gb, + used_disk_size_gb, + ( + 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) - INNER JOIN v3_5_latest_configuration_storage_domains - ON (storage_domain_samples_history.storage_domain_id = v3_5_latest_configuration_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) -GROUP BY v3_5_latest_configuration_storage_domains.storage_domain_id, v3_5_latest_configuration_storage_domains.storage_domain_name, available_disk_size_gb, used_disk_size_gb -ORDER BY SUM(cast(available_disk_size_gb as float)) / SUM(cast(used_disk_size_gb as float) + cast(available_disk_size_gb as float)) ASC + 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 + ) + INNER JOIN v3_5_latest_configuration_storage_domains + ON ( + storage_domain_samples_history.storage_domain_id = + v3_5_latest_configuration_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 + ) +GROUP BY + v3_5_latest_configuration_storage_domains.storage_domain_id, + v3_5_latest_configuration_storage_domains.storage_domain_name, + available_disk_size_gb, + used_disk_size_gb +ORDER BY + SUM ( + CAST ( available_disk_size_gb AS float ) + ) / + SUM ( + CAST ( used_disk_size_gb AS float ) + + CAST ( available_disk_size_gb AS float ) + ) ASC LIMIT 5]]> </queryString> <field name="storage_domain_id" class="java.lang.Object"/> @@ -32,7 +72,7 @@ <band height="260" splitType="Stretch"> <stackedBarChart> <chart customizerClass="com.ovirt.reports.jasper.DrBarChartCustomizer" renderType="draw" theme="WebadminLineBarChartTheme"> - <reportElement uuid="9e221fcd-d57a-4f31-9a0c-9fb80d7de8f7" mode="Opaque" x="0" y="0" width="445" height="260"/> + <reportElement mode="Opaque" x="0" y="0" width="445" height="260" uuid="9e221fcd-d57a-4f31-9a0c-9fb80d7de8f7"/> <box> <pen lineWidth="0.0" lineColor="#3C617F"/> <topPen lineWidth="0.0" lineColor="#3C617F"/> -- To view, visit http://gerrit.ovirt.org/27906 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie25846b58664f0e38fa1cac8b10fb8b7a4b57165 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
