<commit_before><config xmlns="http://software.in2p3.fr/lavoisier/config.xsd"
        xmlns:date="http://exslt.org/dates-and-times"
        xmlns:xi="http://www.w3.org/2001/XInclude"
        xmlns:str="http://exslt.org/strings"
        xmlns:e="http://software.in2p3.fr/lavoisier/entries.xsd">


    <!--
            XML TEMPLATE used to prepare data to the reports
            1) sort data by name (site or ngi)
            2) group it by name
            3) Add potential missing data for a month with N.A values
            4) Add average values for group
            5) Sort by date to be sure that all group have the same number of entries sorted in the same way
            -->

    <processors name="ReportsTemplate" xmlns:e="http://software.in2p3.fr/lavoisier/entries.xsd" xmlns:date="http://exslt.org/dates-and-times"  xmlns:str="http://exslt.org/strings">

        <element in="root" out="e:entries">
            <element out="e:entries">
                <element in="group">
                    <element in="results" out="Availability"></element>
                </element>
                <element-ignore></element-ignore>
            </element>

        </element>


        <element in="e:entries">
            <element in="e:entries">
                <element-ignore in="group"></element-ignore>
                <element-create>sort_by_string(../group,'@name')</element-create>
            </element>
        </element>

        <element in="e:entries">
            <element in="e:entries">
                <element-create-as-parent out="e:entry" group-by="@name" attributes="@name">
                    <element in="group"></element>
                </element-create-as-parent>
            </element>
        </element>


        <element in="e:entries">
            <element in="e:entries">
                <element in="e:entry">
                    <attribute in="name" out="key"></attribute>
                    <element-ignore in="group">
                        <element></element>
                    </element-ignore>
                </element>
            </element>
        </element>
        <element in="e:entries">
            <element in="e:entries">
                <element in="e:entry">
                    <element-ignore in="Availability" if="@timestamp=/e:entries/@monthend"></element-ignore>
                </element>
            </element>
        </element>


        <!-- ADD MISSING AV / RE  ans transform it into N.A entries then sort by date -->

        <element in="e:entries">
            <element in="e:entries">
                <element in="e:entry">
                    <element-create if="not(../Availability[@timestamp=/e:entries/@monthstart])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@monthstart)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>


                    <element-create if="not(../Availability[@timestamp=/e:entries/@month3])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month3)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>

                    <element-create if="not(../Availability[@timestamp=/e:entries/@month2])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month2)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>

                    <element-create if="not(../Availability[@timestamp=/e:entries/@month1])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month1)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>


                    <element-create if="not(../Availability[@timestamp=/e:entries/@month0])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month0)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>



                </element>
            </element>
        </element>





        <!-- ADD ENTRY for average values -->




        <element in="e:entries">
            <element in="e:entries">
                <element-create as="last-child">
                    entry('AVERAGE','')
                </element-create>
            </element>
        </element>

        <element in="e:entries">
            <element in="e:entries">
                <element in="e:entry" if="@key='AVERAGE'">
                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@monthstart)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@unknown!='N.A']/@unknown))
                        )
                    </element-create>


                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month3)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@unknown!='N.A']/@unknown))
                        )
                    </element-create>

                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month2)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@unknown!='N.A']/@unknown))
                        )
                    </element-create>

                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month1)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@unknown!='N.A']/@unknown))
                        )
                    </element-create>


                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month0)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@unknown!='N.A']/@unknown))
                        )
                    </element-create>



                </element>
            </element>
        </element>


        <element in="e:entries">
            <attribute-create out="ReportUrl">url()</attribute-create>

            <element in="e:entries">
                <element in="e:entry">
                    <element-ignore in="Availability"></element-ignore>
                    <element-create>sort_by_string(../Availability,'@timestamp')</element-create>
                </element>
            </element>
        </element>

    </processors>



    <view name="ngi_reports_cached">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports - cache Rotated</description>
        </info>
        <argument name="report">Critical</argument>


        <argument name="month0" eval="substring(date:date(),0,8)"></argument>
        <argument name="monthend" eval="substring(date:add($month0,'P1M'),0,8)"></argument>
        <argument name="month1" eval="substring(date:add($month0,'-P1M'),0,8)"></argument>
        <argument name="month2" eval="substring(date:add($month0,'-P2M'),0,8)"></argument>
        <argument name="month3" eval="substring(date:add($month0,'-P3M'),0,8)"></argument>
        <argument name="monthstart" eval="substring(date:add($month0,'-P4M'),0,8)"></argument>


        <connector type="XMLConnector">
            <parameter name="content" eval="new_element('root')"></parameter>
        </connector>
        <processors>

            <element in="root">
                <attribute-create out="monthstart">$monthstart</attribute-create>
                <attribute-create out="monthend">$monthend</attribute-create>
                <attribute-create out="month0">$month0</attribute-create>
                <attribute-create out="month1">$month1</attribute-create>
                <attribute-create out="month2">$month2</attribute-create>
                <attribute-create out="month3">$month3</attribute-create>

                <element-create>view('api.availability.file.cache',entry('group_type','ngi')|entry('granularity','MONTHLY')|entry('start_time',concat($monthstart,'-01T00:00:00Z'))|entry('end_time',concat($monthend,'-01T00:00:00Z'))|entry('report',$report))</element-create>
            </element>

        </processors>



    </view>



    <view name="ngi_reports_daily_cached">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports - cache Rotated</description>
        </info>
        <argument name="mode">RW</argument>
        <argument name="report">Critical</argument>


        <argument name="month0" eval="substring(date:date(),0,8)"></argument>

        <argument name="monthend" eval="substring(date:add($month0,'P1M'),0,8)"></argument>

        <argument name="month1" eval="substring(date:add($month0,'-P1M'),0,8)"></argument>
        <argument name="month2" eval="substring(date:add($month0,'-P2M'),0,8)"></argument>
        <argument name="month3" eval="substring(date:add($month0,'-P3M'),0,8)"></argument>
        <argument name="monthstart" eval="substring(date:add($month0,'-P4M'),0,8)"></argument>


        <connector type="XMLConnector">
            <parameter name="content" eval="new_element('root')"></parameter>

        </connector>

        <processors>



            <element in="root">

                <attribute-create out="monthstart">$monthstart</attribute-create>
                <attribute-create out="monthend">$monthend</attribute-create>
                <attribute-create out="month0">$month0</attribute-create>
                <attribute-create out="month1">$month1</attribute-create>
                <attribute-create out="month2">$month2</attribute-create>
                <attribute-create out="month3">$month3</attribute-create>


                <element-create>view('api.availability.file.cache',entry('group_type','ngi')|entry('granularity','DAILY')|entry('start_time',concat($monthstart,'-01T00:00:00Z'))|entry('end_time',concat($monthend,'-01T00:00:00Z'))|entry('report',$report))</element-create>

            </element>



        </processors>

    </view>





    <view name="ngi_reports_date">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports from date </description>
        </info>

        <argument name="month" eval="0"></argument>
        <argument name="month0" eval="choose($month!=0,$month,substring(date:date(),0,8))"></argument>
        <argument name="monthend" eval="substring(date:add($month0,'P1M'),0,8)"></argument>
        <argument name="month1" eval="substring(date:add($month0,'-P1M'),0,8)"></argument>
        <argument name="month2" eval="substring(date:add($month0,'-P2M'),0,8)"></argument>
        <argument name="month3" eval="substring(date:add($month0,'-P3M'),0,8)"></argument>
        <argument name="monthstart" eval="substring(date:add($month0,'-P4M'),0,8)"></argument>



        <argument name="report">Critical</argument>

        <connector type="XMLConnector">
            <parameter name="content" eval="new_element('root')"></parameter>
        </connector>

        <processors>
            <element>

                <attribute-create out="monthstart">$monthstart</attribute-create>
                <attribute-create out="monthend">$monthend</attribute-create>
                <attribute-create out="month0">$month0</attribute-create>
                <attribute-create out="month1">$month1</attribute-create>
                <attribute-create out="month2">$month2</attribute-create>
                <attribute-create out="month3">$month3</attribute-create>

                <element-create >view('api.availability.rotating.caches',entry('group_type','ngi')|entry('granularity','MONTHLY')|entry('start_time',concat($monthstart,'-01T00:00:00Z'))|entry('end_time',concat($monthend,'-01T00:00:00Z'))|entry('report',$report))</element-create>


            </element>
        </processors>


    </view>




    <view name="ngi_reports" post-processors="ReportsTemplate">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports</description>
        </info>
        <argument name="month" eval="0"></argument>
        <argument name="report">Critical</argument>


        <connector type="XMLConnector">
            <parameter name="content" eval="choose($month=0,view('ngi_reports_cached',entry('report',$report)),view('ngi_reports_date',entry('month',$month)|entry('report',$report)))"></parameter>
        </connector>

        <processors>


            <element in="root">
                <attribute-create out="description">'NGI League Report'</attribute-create>
                <attribute-create out="view">'ngi_reports'</attribute-create>
                <attribute-create out="related_view">'ngi_ar'</attribute-create>
                <attribute-create out="ngi">'all'</attribute-create>
                <attribute-create out="report">$report</attribute-create>
                <attribute-create out="details">'site_reports'</attribute-create>
                <attribute-create out="entity">'ngi'</attribute-create>

                <element in="root">
                    <attribute-create out="name">'EGI'</attribute-create>
                </element>

            </element>



        </processors>

        <pre-renderers>
            <title>/e:entries/@description</title>

            <field label="month">/e:entries/@monthstart</field>
            <field label="month3">/e:entries/@month3</field>
            <field label="month2">/e:entries/@month2</field>
            <field label="month1">/e:entries/@month1</field>
            <field label="month0">/e:entries/@month0</field>



            <row foreach="/e:entries/e:entries/e:entry/Availability[@timestamp=/e:entries/@monthstart or @timestamp=/e:entries/@month0 or @timestamp=/e:entries/@month1 or @timestamp=/e:entries/@month2 or @timestamp=/e:entries/@month3]">
                <column label="Ngi">ancestor::e:entry/@key</column>
                <column label="Timestamp">@timestamp</column>
                <column label="Availability" unit="percentage">@availability</column>
                <column label="Reliability" unit="percentage">@reliability</column>
            </row>
        </pre-renderers>
        <renderers>

            <renderer type="DefaultRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="HTMLRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>

            <renderer type="PDFRenderer">
                <parameter name="template">/html/ar_reports_pdf.html</parameter>
            </renderer>

            <renderer type="ChartRenderer">
                <parameter name="type">column</parameter>
                <parameter name="axis">inverted</parameter>
                <!--optional: The width of the chart (Integer)-->
                <parameter name="width">1200</parameter>


                <!--optional: The height of the chart (Integer)-->
                <parameter name="height">2000</parameter>
            </renderer>
        </renderers>
    </view>


    <view name="opsmon_reports" post-processors="ReportsTemplate">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports</description>
        </info>

        <argument name="ngi">all</argument>
        <argument name="month" eval="0"></argument>

        <connector type="XMLConnector">
            <parameter name="content" eval="choose($month=0,
            view('site_reports_cached',entry('report','OPS-MONITOR-Critical')),
            view('site_reports_date',entry('report','OPS-MONITOR-Critical')|entry('month',$month))
            )"></parameter>
        </connector>



        <processors>


            <element in="root">
                <attribute-create out="description">'OpsMon Report'</attribute-create>
                <attribute-create out="view">'opsmon_reports'</attribute-create>
                <attribute-create out="related_view">'opsmon_ar'</attribute-create>
                <attribute-create out="ngi">$ngi</attribute-create>
                <attribute-create out="report">'OPS-MONITOR-Critical'</attribute-create>
                <attribute-create out="entity">'site'</attribute-create>
            </element>





            <element in="root">
                <element-ignore in="root">
                    <element in="group" if="@name=$ngi or $ngi='all'"></element>
                    <element-ignore></element-ignore>
                </element-ignore>
            </element>


        </processors>

        <pre-renderers>
            <title>/e:entries/@description</title>

            <field label="month">/e:entries/@monthstart</field>
            <field label="month3">/e:entries/@month3</field>
            <field label="month2">/e:entries/@month2</field>
            <field label="month1">/e:entries/@month1</field>
            <field label="month0">/e:entries/@month0</field>

            <row foreach="/e:entries/e:entries/e:entry/Availability[@timestamp=/e:entries/@monthstart or @timestamp=/e:entries/@month0 or @timestamp=/e:entries/@month1 or @timestamp=/e:entries/@month2 or @timestamp=/e:entries/@month3]">
                <column label="Site">ancestor::e:entry/@key</column>
                <column label="Ngi">ancestor::e:entries/@key</column>
                <column label="Timestamp">@timestamp</column>
                <column label="Availability" unit="percentage">@availability</column>
                <column label="Reliability" unit="percentage">@reliability</column>
                <column label="Unknown" unit="percentage">@unknown </column>
                <column label="Downtime" unit="percentage">@downtime </column>
            </row>
        </pre-renderers>



        <renderers>
            <renderer type="DefaultRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="HTMLRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="PDFRenderer">
                <parameter name="template">/html/ar_reports_pdf.html</parameter>
            </renderer>

            <renderer type="ChartRenderer">
                <parameter name="rotation">-45</parameter>

            </renderer>
        </renderers>

    </view>


    <view name="cloud_reports" post-processors="ReportsTemplate">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports</description>
        </info>

        <argument name="ngi">all</argument>
        <argument name="month" eval="0"></argument>



        <connector type="XMLConnector">
            <parameter name="content" eval="choose($month=0,
            view('site_reports_cached',entry('report','Cloud')),
            view('site_reports_date',entry('report','Cloud')|entry('month',$month))
            )"></parameter>
        </connector>

        <processors>





            <element in="root">
                <attribute-create out="description">'EGI Federated Cloud  Report'</attribute-create>
                <attribute-create out="view">'cloud_reports'</attribute-create>
                <attribute-create out="related_view">'cloud_ar'</attribute-create>
                <attribute-create out="ngi">$ngi</attribute-create>
                <attribute-create out="report">'Cloud'</attribute-create>
                <attribute-create out="entity">'site'</attribute-create>
            </element>



            <element in="root">
                <element-ignore in="root">
                    <element in="group" if="@name=$ngi or $ngi='all'"></element>
                    <element-ignore></element-ignore>
                </element-ignore>
            </element>


        </processors>

        <pre-renderers>
            <title>/e:entries/@description</title>

            <field label="month">/e:entries/@monthstart</field>
            <field label="month3">/e:entries/@month3</field>
            <field label="month2">/e:entries/@month2</field>
            <field label="month1">/e:entries/@month1</field>
            <field label="month0">/e:entries/@month0</field>

            <row foreach="/e:entries/e:entries/e:entry/Availability[@timestamp=/e:entries/@monthstart or @timestamp=/e:entries/@month0 or @timestamp=/e:entries/@month1 or @timestamp=/e:entries/@month2 or @timestamp=/e:entries/@month3]">
                <column label="Site">ancestor::e:entry/@key</column>
                <column label="Ngi">ancestor::e:entries/@key</column>
                <column label="Timestamp">@timestamp</column>
                <column label="Availability" unit="percentage">@availability</column>
                <column label="Reliability" unit="percentage">@reliability</column>
                <column label="Unknown" unit="percentage">@unknown </column>
                <column label="Downtime" unit="percentage">@downtime </column>
            </row>
        </pre-renderers>

        <renderers>
            <renderer type="DefaultRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="HTMLRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="ChartRenderer">
                <parameter name="rotation">-45</parameter>

            </renderer>

            <renderer type="PDFRenderer">
                <parameter name="template">/html/ar_reports_pdf.html</parameter>
            </renderer>
        </renderers>

    </view>

    <view name="fedcloud_reports" post-processors="ReportsTemplate">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports</description>
        </info>

        <argument name="ngi">all</argument>
        <argument name="month" eval="0"></argument>

        <argument name="listSiteFedcloud" eval="concat(',',join(view('goc.listSiteFedcloud')/e:entries/e:entry/text(),','),',')"></argument>

        <connector type="XMLConnector">
            <parameter name="content" eval="choose($month=0,
            view('site_reports_cached',entry('report','Critical')),
            view('site_reports_date',entry('report','Fedcloud')|entry('month',$month))
            )"></parameter>
        </connector>

        <processors>





            <element in="root">
                <attribute-create out="description">'EGI Federated Cloud  Report'</attribute-create>
                <attribute-create out="view">'fedcloud_reports'</attribute-create>
                <attribute-create out="related_view">'fedcloud_ar'</attribute-create>
                <attribute-create out="ngi">$ngi</attribute-create>
                <attribute-create out="report">'Fedcloud'</attribute-create>
                <attribute-create out="entity">'site'</attribute-create>
            </element>



            <element in="root">
                <element-ignore in="root">
                    <element in="group" if="contains($listSiteFedcloud,concat(',',group/@name,','))">
                        <element in="group"  if="contains($listSiteFedcloud,@name)"></element>
                    </element>
                    <element-ignore></element-ignore>
                </element-ignore>
            </element>


        </processors>

        <pre-renderers>
            <title>/e:entries/@description</title>

            <field label="month">/e:entries/@monthstart</field>
            <field label="month3">/e:entries/@month3</field>
            <field label="month2">/e:entries/@month2</field>
            <field label="month1">/e:entries/@month1</field>
            <field label="month0">/e:entries/@month0</field>

            <row foreach="/e:entries/e:entries/e:entry/Availability[@timestamp=/e:entries/@monthstart or @timestamp=/e:entries/@month0 or @timestamp=/e:entries/@month1 or @timestamp=/e:entries/@month2 or @timestamp=/e:entries/@month3]"><commit_msg>fix related views for fedcloud<commit_after><config xmlns="http://software.in2p3.fr/lavoisier/config.xsd"
        xmlns:date="http://exslt.org/dates-and-times"
        xmlns:xi="http://www.w3.org/2001/XInclude"
        xmlns:str="http://exslt.org/strings"
        xmlns:e="http://software.in2p3.fr/lavoisier/entries.xsd">


    <!--
            XML TEMPLATE used to prepare data to the reports
            1) sort data by name (site or ngi)
            2) group it by name
            3) Add potential missing data for a month with N.A values
            4) Add average values for group
            5) Sort by date to be sure that all group have the same number of entries sorted in the same way
            -->

    <processors name="ReportsTemplate" xmlns:e="http://software.in2p3.fr/lavoisier/entries.xsd" xmlns:date="http://exslt.org/dates-and-times"  xmlns:str="http://exslt.org/strings">

        <element in="root" out="e:entries">
            <element out="e:entries">
                <element in="group">
                    <element in="results" out="Availability"></element>
                </element>
                <element-ignore></element-ignore>
            </element>

        </element>


        <element in="e:entries">
            <element in="e:entries">
                <element-ignore in="group"></element-ignore>
                <element-create>sort_by_string(../group,'@name')</element-create>
            </element>
        </element>

        <element in="e:entries">
            <element in="e:entries">
                <element-create-as-parent out="e:entry" group-by="@name" attributes="@name">
                    <element in="group"></element>
                </element-create-as-parent>
            </element>
        </element>


        <element in="e:entries">
            <element in="e:entries">
                <element in="e:entry">
                    <attribute in="name" out="key"></attribute>
                    <element-ignore in="group">
                        <element></element>
                    </element-ignore>
                </element>
            </element>
        </element>
        <element in="e:entries">
            <element in="e:entries">
                <element in="e:entry">
                    <element-ignore in="Availability" if="@timestamp=/e:entries/@monthend"></element-ignore>
                </element>
            </element>
        </element>


        <!-- ADD MISSING AV / RE  ans transform it into N.A entries then sort by date -->

        <element in="e:entries">
            <element in="e:entries">
                <element in="e:entry">
                    <element-create if="not(../Availability[@timestamp=/e:entries/@monthstart])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@monthstart)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>


                    <element-create if="not(../Availability[@timestamp=/e:entries/@month3])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month3)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>

                    <element-create if="not(../Availability[@timestamp=/e:entries/@month2])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month2)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>

                    <element-create if="not(../Availability[@timestamp=/e:entries/@month1])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month1)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>


                    <element-create if="not(../Availability[@timestamp=/e:entries/@month0])">
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month0)|new_attribute('availability','N.A')|new_attribute('reliability','N.A')|new_attribute('downtime','N.A')|new_attribute('unknown','N.A'))
                    </element-create>



                </element>
            </element>
        </element>





        <!-- ADD ENTRY for average values -->




        <element in="e:entries">
            <element in="e:entries">
                <element-create as="last-child">
                    entry('AVERAGE','')
                </element-create>
            </element>
        </element>

        <element in="e:entries">
            <element in="e:entries">
                <element in="e:entry" if="@key='AVERAGE'">
                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@monthstart)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@unknown!='N.A']/@unknown))
                        )
                    </element-create>


                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month3)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month3][@unknown!='N.A']/@unknown))
                        )
                    </element-create>

                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month2)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@monthstart][@unknown!='N.A']/@unknown))
                        )
                    </element-create>

                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month1)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month1][@unknown!='N.A']/@unknown))
                        )
                    </element-create>


                    <element-create>
                        new_element('Availability',new_attribute('timestamp',/e:entries/@month0)
                        |new_attribute('availability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@availability!='N.A']/@availability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@availability!='N.A']/@availability))
                        |new_attribute('reliability',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@reliability!='N.A']/@reliability)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@reliability!='N.A']/@reliability))
                        |new_attribute('downtime',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@downtime!='N.A']/@downtime)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@downtime!='N.A']/@downtime))
                        |new_attribute('unknown',
                        sum(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@unknown!='N.A']/@unknown)
                        div count(../preceding-sibling::e:entry/Availability[@timestamp=/e:entries/@month0][@unknown!='N.A']/@unknown))
                        )
                    </element-create>



                </element>
            </element>
        </element>


        <element in="e:entries">
            <attribute-create out="ReportUrl">url()</attribute-create>

            <element in="e:entries">
                <element in="e:entry">
                    <element-ignore in="Availability"></element-ignore>
                    <element-create>sort_by_string(../Availability,'@timestamp')</element-create>
                </element>
            </element>
        </element>

    </processors>



    <view name="ngi_reports_cached">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports - cache Rotated</description>
        </info>
        <argument name="report">Critical</argument>


        <argument name="month0" eval="substring(date:date(),0,8)"></argument>
        <argument name="monthend" eval="substring(date:add($month0,'P1M'),0,8)"></argument>
        <argument name="month1" eval="substring(date:add($month0,'-P1M'),0,8)"></argument>
        <argument name="month2" eval="substring(date:add($month0,'-P2M'),0,8)"></argument>
        <argument name="month3" eval="substring(date:add($month0,'-P3M'),0,8)"></argument>
        <argument name="monthstart" eval="substring(date:add($month0,'-P4M'),0,8)"></argument>


        <connector type="XMLConnector">
            <parameter name="content" eval="new_element('root')"></parameter>
        </connector>
        <processors>

            <element in="root">
                <attribute-create out="monthstart">$monthstart</attribute-create>
                <attribute-create out="monthend">$monthend</attribute-create>
                <attribute-create out="month0">$month0</attribute-create>
                <attribute-create out="month1">$month1</attribute-create>
                <attribute-create out="month2">$month2</attribute-create>
                <attribute-create out="month3">$month3</attribute-create>

                <element-create>view('api.availability.file.cache',entry('group_type','ngi')|entry('granularity','MONTHLY')|entry('start_time',concat($monthstart,'-01T00:00:00Z'))|entry('end_time',concat($monthend,'-01T00:00:00Z'))|entry('report',$report))</element-create>
            </element>

        </processors>



    </view>



    <view name="ngi_reports_daily_cached">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports - cache Rotated</description>
        </info>
        <argument name="mode">RW</argument>
        <argument name="report">Critical</argument>


        <argument name="month0" eval="substring(date:date(),0,8)"></argument>

        <argument name="monthend" eval="substring(date:add($month0,'P1M'),0,8)"></argument>

        <argument name="month1" eval="substring(date:add($month0,'-P1M'),0,8)"></argument>
        <argument name="month2" eval="substring(date:add($month0,'-P2M'),0,8)"></argument>
        <argument name="month3" eval="substring(date:add($month0,'-P3M'),0,8)"></argument>
        <argument name="monthstart" eval="substring(date:add($month0,'-P4M'),0,8)"></argument>


        <connector type="XMLConnector">
            <parameter name="content" eval="new_element('root')"></parameter>

        </connector>

        <processors>



            <element in="root">

                <attribute-create out="monthstart">$monthstart</attribute-create>
                <attribute-create out="monthend">$monthend</attribute-create>
                <attribute-create out="month0">$month0</attribute-create>
                <attribute-create out="month1">$month1</attribute-create>
                <attribute-create out="month2">$month2</attribute-create>
                <attribute-create out="month3">$month3</attribute-create>


                <element-create>view('api.availability.file.cache',entry('group_type','ngi')|entry('granularity','DAILY')|entry('start_time',concat($monthstart,'-01T00:00:00Z'))|entry('end_time',concat($monthend,'-01T00:00:00Z'))|entry('report',$report))</element-create>

            </element>



        </processors>

    </view>





    <view name="ngi_reports_date">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports from date </description>
        </info>

        <argument name="month" eval="0"></argument>
        <argument name="month0" eval="choose($month!=0,$month,substring(date:date(),0,8))"></argument>
        <argument name="monthend" eval="substring(date:add($month0,'P1M'),0,8)"></argument>
        <argument name="month1" eval="substring(date:add($month0,'-P1M'),0,8)"></argument>
        <argument name="month2" eval="substring(date:add($month0,'-P2M'),0,8)"></argument>
        <argument name="month3" eval="substring(date:add($month0,'-P3M'),0,8)"></argument>
        <argument name="monthstart" eval="substring(date:add($month0,'-P4M'),0,8)"></argument>



        <argument name="report">Critical</argument>

        <connector type="XMLConnector">
            <parameter name="content" eval="new_element('root')"></parameter>
        </connector>

        <processors>
            <element>

                <attribute-create out="monthstart">$monthstart</attribute-create>
                <attribute-create out="monthend">$monthend</attribute-create>
                <attribute-create out="month0">$month0</attribute-create>
                <attribute-create out="month1">$month1</attribute-create>
                <attribute-create out="month2">$month2</attribute-create>
                <attribute-create out="month3">$month3</attribute-create>

                <element-create >view('api.availability.rotating.caches',entry('group_type','ngi')|entry('granularity','MONTHLY')|entry('start_time',concat($monthstart,'-01T00:00:00Z'))|entry('end_time',concat($monthend,'-01T00:00:00Z'))|entry('report',$report))</element-create>


            </element>
        </processors>


    </view>




    <view name="ngi_reports" post-processors="ReportsTemplate">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports</description>
        </info>
        <argument name="month" eval="0"></argument>
        <argument name="report">Critical</argument>


        <connector type="XMLConnector">
            <parameter name="content" eval="choose($month=0,view('ngi_reports_cached',entry('report',$report)),view('ngi_reports_date',entry('month',$month)|entry('report',$report)))"></parameter>
        </connector>

        <processors>


            <element in="root">
                <attribute-create out="description">'NGI League Report'</attribute-create>
                <attribute-create out="view">'ngi_reports'</attribute-create>
                <attribute-create out="related_view">'ngi_ar'</attribute-create>
                <attribute-create out="ngi">'all'</attribute-create>
                <attribute-create out="report">$report</attribute-create>
                <attribute-create out="details">'site_reports'</attribute-create>
                <attribute-create out="entity">'ngi'</attribute-create>

                <element in="root">
                    <attribute-create out="name">'EGI'</attribute-create>
                </element>

            </element>



        </processors>

        <pre-renderers>
            <title>/e:entries/@description</title>

            <field label="month">/e:entries/@monthstart</field>
            <field label="month3">/e:entries/@month3</field>
            <field label="month2">/e:entries/@month2</field>
            <field label="month1">/e:entries/@month1</field>
            <field label="month0">/e:entries/@month0</field>



            <row foreach="/e:entries/e:entries/e:entry/Availability[@timestamp=/e:entries/@monthstart or @timestamp=/e:entries/@month0 or @timestamp=/e:entries/@month1 or @timestamp=/e:entries/@month2 or @timestamp=/e:entries/@month3]">
                <column label="Ngi">ancestor::e:entry/@key</column>
                <column label="Timestamp">@timestamp</column>
                <column label="Availability" unit="percentage">@availability</column>
                <column label="Reliability" unit="percentage">@reliability</column>
            </row>
        </pre-renderers>
        <renderers>

            <renderer type="DefaultRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="HTMLRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>

            <renderer type="PDFRenderer">
                <parameter name="template">/html/ar_reports_pdf.html</parameter>
            </renderer>

            <renderer type="ChartRenderer">
                <parameter name="type">column</parameter>
                <parameter name="axis">inverted</parameter>
                <!--optional: The width of the chart (Integer)-->
                <parameter name="width">1200</parameter>


                <!--optional: The height of the chart (Integer)-->
                <parameter name="height">2000</parameter>
            </renderer>
        </renderers>
    </view>


    <view name="opsmon_reports" post-processors="ReportsTemplate">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports</description>
        </info>

        <argument name="ngi">all</argument>
        <argument name="month" eval="0"></argument>

        <connector type="XMLConnector">
            <parameter name="content" eval="choose($month=0,
            view('site_reports_cached',entry('report','OPS-MONITOR-Critical')),
            view('site_reports_date',entry('report','OPS-MONITOR-Critical')|entry('month',$month))
            )"></parameter>
        </connector>



        <processors>


            <element in="root">
                <attribute-create out="description">'OpsMon Report'</attribute-create>
                <attribute-create out="view">'opsmon_reports'</attribute-create>
                <attribute-create out="related_view">'opsmon_ar'</attribute-create>
                <attribute-create out="ngi">$ngi</attribute-create>
                <attribute-create out="report">'OPS-MONITOR-Critical'</attribute-create>
                <attribute-create out="entity">'site'</attribute-create>
            </element>





            <element in="root">
                <element-ignore in="root">
                    <element in="group" if="@name=$ngi or $ngi='all'"></element>
                    <element-ignore></element-ignore>
                </element-ignore>
            </element>


        </processors>

        <pre-renderers>
            <title>/e:entries/@description</title>

            <field label="month">/e:entries/@monthstart</field>
            <field label="month3">/e:entries/@month3</field>
            <field label="month2">/e:entries/@month2</field>
            <field label="month1">/e:entries/@month1</field>
            <field label="month0">/e:entries/@month0</field>

            <row foreach="/e:entries/e:entries/e:entry/Availability[@timestamp=/e:entries/@monthstart or @timestamp=/e:entries/@month0 or @timestamp=/e:entries/@month1 or @timestamp=/e:entries/@month2 or @timestamp=/e:entries/@month3]">
                <column label="Site">ancestor::e:entry/@key</column>
                <column label="Ngi">ancestor::e:entries/@key</column>
                <column label="Timestamp">@timestamp</column>
                <column label="Availability" unit="percentage">@availability</column>
                <column label="Reliability" unit="percentage">@reliability</column>
                <column label="Unknown" unit="percentage">@unknown </column>
                <column label="Downtime" unit="percentage">@downtime </column>
            </row>
        </pre-renderers>



        <renderers>
            <renderer type="DefaultRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="HTMLRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="PDFRenderer">
                <parameter name="template">/html/ar_reports_pdf.html</parameter>
            </renderer>

            <renderer type="ChartRenderer">
                <parameter name="rotation">-45</parameter>

            </renderer>
        </renderers>

    </view>


    <view name="cloud_reports" post-processors="ReportsTemplate">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports</description>
        </info>

        <argument name="ngi">all</argument>
        <argument name="month" eval="0"></argument>



        <connector type="XMLConnector">
            <parameter name="content" eval="choose($month=0,
            view('site_reports_cached',entry('report','Cloud')),
            view('site_reports_date',entry('report','Cloud')|entry('month',$month))
            )"></parameter>
        </connector>

        <processors>





            <element in="root">
                <attribute-create out="description">'EGI Federated Cloud  Report'</attribute-create>
                <attribute-create out="view">'cloud_reports'</attribute-create>
                <attribute-create out="related_view">'cloud_ar'</attribute-create>
                <attribute-create out="ngi">$ngi</attribute-create>
                <attribute-create out="report">'Cloud'</attribute-create>
                <attribute-create out="entity">'site'</attribute-create>
            </element>



            <element in="root">
                <element-ignore in="root">
                    <element in="group" if="@name=$ngi or $ngi='all'"></element>
                    <element-ignore></element-ignore>
                </element-ignore>
            </element>


        </processors>

        <pre-renderers>
            <title>/e:entries/@description</title>

            <field label="month">/e:entries/@monthstart</field>
            <field label="month3">/e:entries/@month3</field>
            <field label="month2">/e:entries/@month2</field>
            <field label="month1">/e:entries/@month1</field>
            <field label="month0">/e:entries/@month0</field>

            <row foreach="/e:entries/e:entries/e:entry/Availability[@timestamp=/e:entries/@monthstart or @timestamp=/e:entries/@month0 or @timestamp=/e:entries/@month1 or @timestamp=/e:entries/@month2 or @timestamp=/e:entries/@month3]">
                <column label="Site">ancestor::e:entry/@key</column>
                <column label="Ngi">ancestor::e:entries/@key</column>
                <column label="Timestamp">@timestamp</column>
                <column label="Availability" unit="percentage">@availability</column>
                <column label="Reliability" unit="percentage">@reliability</column>
                <column label="Unknown" unit="percentage">@unknown </column>
                <column label="Downtime" unit="percentage">@downtime </column>
            </row>
        </pre-renderers>

        <renderers>
            <renderer type="DefaultRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="HTMLRenderer">
                <parameter name="template">/html/ar_reports.html</parameter>

            </renderer>
            <renderer type="ChartRenderer">
                <parameter name="rotation">-45</parameter>

            </renderer>

            <renderer type="PDFRenderer">
                <parameter name="template">/html/ar_reports_pdf.html</parameter>
            </renderer>
        </renderers>

    </view>

    <view name="fedcloud_reports" post-processors="ReportsTemplate">
        <info>
            <category>AR reports</category>
            <description>NGI League Reports</description>
        </info>

        <argument name="ngi">all</argument>
        <argument name="month" eval="0"></argument>

        <argument name="listSiteFedcloud" eval="concat(',',join(view('goc.listSiteFedcloud')/e:entries/e:entry/text(),','),',')"></argument>

        <connector type="XMLConnector">
            <parameter name="content" eval="choose($month=0,
            view('site_reports_cached',entry('report','Critical')),
            view('site_reports_date',entry('report','Critical')|entry('month',$month))
            )"></parameter>
        </connector>

        <processors>





            <element in="root">
                <attribute-create out="description">'EGI Federated Cloud  Report'</attribute-create>
                <attribute-create out="view">'fedcloud_reports'</attribute-create>
                <attribute-create out="related_view">'site_ar'</attribute-create>
                <attribute-create out="ngi">$ngi</attribute-create>
                <attribute-create out="report">'Critical'</attribute-create>
                <attribute-create out="entity">'site'</attribute-create>
            </element>



            <element in="root">
                <element-ignore in="root">
                    <element in="group" if="contains($listSiteFedcloud,concat(',',group/@name,','))">
                        <element in="group"  if="contains($listSiteFedcloud,@name)"></element>
                    </element>
                    <element-ignore></element-ignore>
                </element-ignore>
            </element>


        </processors>

        <pre-renderers>
            <title>/e:entries/@description</title>

            <field label="month">/e:entries/@monthstart</field>
            <field label="month3">/e:entries/@month3</field>
            <field label="month2">/e:entries/@month2</field>
            <field label="month1">/e:entries/@month1</field>
            <field label="month0">/e:entries/@month0</field>

            <row foreach="/e:entries/e:entries/e:entry/Availability[@timestamp=/e:entries/@monthstart or @timestamp=/e:entries/@month0 or @timestamp=/e:entries/@month1 or @timestamp=/e:entries/@month2 or @timestamp=/e:entries/@month3]">
{'fraction_non_alphanumeric': 0.16963718931588456, 'fraction_numerical': 0.008854599020134447, 'mean_word_length': 2.37145365746584, 'pattern_counts': {'":': 0, '<': 1121, '<?xml version=': 0, '>': 1121, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1962541', 'n_tokens_mistral': 18166, 'n_tokens_neox': 16277, 'n_words': 1879}