Shirly Radco has uploaded a new change for review. Change subject: reports: dr7 report - added comments to queries ......................................................................
reports: dr7 report - added comments to queries Changed the code structure so it will be more readable and added commets. Change-Id: I8bf8a020c0ea3a84f39af155e88d3bbdc357a292 Signed-off-by: Shirly Radco <[email protected]> --- M packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data 1 file changed, 28 insertions(+), 10 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/14/27914/1 diff --git a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data index 89ba157..86cf350 100644 --- a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data +++ b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml.data @@ -1,22 +1,40 @@ <?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_storage_space_status_dr7" language="groovy" pageWidth="534" pageHeight="35" columnWidth="534" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" resourceBundle="ovirt_reports_bundle" whenResourceMissingType="Error" uuid="187a4111-7b9a-4d51-a98a-19ceb718033f"> <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(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/system_dashboard/jrxmls/system_storage_space_status_dr7_jrxml"/> + <queryString language="SQL"> + <![CDATA[-- DR7 - This query returns the available disk size percent +-- out of the total storage domains disks space + +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 -WHERE history_id in (SELECT max(a.history_id) - FROM storage_domain_samples_history AS a - GROUP BY a.storage_domain_id)]]> +WHERE + -- Here we get the latest storage domains configuration + 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="cff1038f-a8a9-469e-b69d-4407d77e43d8" x="0" y="0" width="370" height="35" forecolor="#333333"/> + <reportElement x="0" y="0" width="370" height="35" forecolor="#333333" uuid="cff1038f-a8a9-469e-b69d-4407d77e43d8"/> <textElement verticalAlignment="Middle" markup="html"> <font fontName="SansSerif" size="15"/> </textElement> @@ -24,14 +42,14 @@ <hyperlinkTooltipExpression><![CDATA["Calculates free disk size percent average of all storage domains in the system from their latest sample. Displays check mark if free disk space is over 60%, otherwise displays X mark."]]></hyperlinkTooltipExpression> </textField> <image> - <reportElement uuid="685337d4-65c6-451c-a09e-d85d60d502fb" x="370" y="10" width="17" height="15"> + <reportElement x="370" y="10" width="17" height="15" uuid="685337d4-65c6-451c-a09e-d85d60d502fb"> <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 in the system from their latest sample. Displays check mark if free disk space is over 60%, otherwise displays X mark."]]></hyperlinkTooltipExpression> </image> <image> - <reportElement uuid="4bc479ac-521d-4da1-b776-edeb664228cb" x="370" y="10" width="17" height="15"> + <reportElement x="370" y="10" width="17" height="15" uuid="4bc479ac-521d-4da1-b776-edeb664228cb"> <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/27914 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8bf8a020c0ea3a84f39af155e88d3bbdc357a292 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
