<?xml version="1.0" encoding="UTF-8"?>
<views>
  <!--
      An out-of-the-box set of analysis reports for groups and individual servers.

      Author: Computer & Financial  Solutions, Inc.
    -->

 <category name="Monthly Report Samples">


    <!--
      Title: Application Report
      Author: Karl Steger
      Description: This sample report applies a set of rule to the selected group over the selected period.
                   It analyzes: CPU, CPU runQ, Virtual Memory, Page Scanning, and data collections.  It also
                   provides charts for the group's busiest business hour, and busiest batch period.  This
                   report works with Perceive as delivered, without extension.
      -->
   <view name="Application Report">
       <report file="sample_app_report.html" template="Error loading CFS_App_Report.html" >

           <!-- $0 Data Collection Status:
                The table lists the number of hours of collected data per day by server.  Each cell is color coded to indicate the number of missing
                intervals.  Normally, we collect data 24 hours a day.-->
               <table-format heading="Collection Status by Server and by Date" date-format="MMM yyyy" no-data-msg="No Server Broke this Rule" number-format="##" colours="0-18=red,18-22=yellow">
                   <count>
                       <date-split type="days">
                           <get-group-data  metric="/common/CPU/CPU Utilization" />
                       </date-split>
                   </count>
               </table-format>

           <!-- $1 CPU Utilization and RunQ Testing Table:
                Count the number of days, by server, during the analysis period where CPU utilization is over 30% and Run Queue Length is
                greater than 0 per CPU, for 1 or more hours that day.
            -->
            <table-format heading="Rule 1: CPU Util and RunQ" date-format="MMM yyyy" no-data-msg="No Server Broke this Rule" number-format="##" colours="1-7=yellow,7-32=red">
            <count>
              <date-split type="Months">
               <time-summarize type="days" category="count">
                <common-intervals type="AND" group-by="system" values="true">
                 <threshold-filter include="above" limit="30">
                      <get-group-data  metric="/common/CPU/CPU Utilization" unique="interval" id="Rules" />
                 </threshold-filter>
                 <threshold-filter include="above" limit="0">
                   <arithmetic expression="a/b=QL Per  Processor">
                     <get-group-data metric="/common/CPU/Run Queue Length" unique="interval" id="Rules" />
                     <get-group-data metric="/common/Config/Num Processors" unique="interval" id="Rules" />
                   </arithmetic>
                 </threshold-filter>
                </common-intervals>
               </time-summarize>
              </date-split>
            </count>
           </table-format>

           <!-- $2 Swap Utilization Testing Table - Business Hours:
                Count the number of days, by server, during the analysis period where Swap Utilization is over 60%,
                for 1 or more hours that day.  Since we do not want to know how many hours per day, we can summarize
                for the maximum observation per day and test against our threshold.
             -->
            <table-format heading="Rule 2: Swap Utilization" date-format="MMM yyyy" no-data-msg="No Server Broke this Rule" number-format="##" colours="1-7=yellow,7-32=red">
            <count>
              <date-split type="Months">
                   <threshold-filter include="above" limit="60">
                     <time-summarize type="days" category="maximum">
                       <date-filter days="Weekdays" hours="Business Hours" include="true">
                       <get-group-data  metric="/common/Memory/Virtual Memory Utilization" unique="interval" id="Rules" />
                       </date-filter>
                     </time-summarize>
                   </threshold-filter>
              </date-split>
           </count>
           </table-format>

           <!-- $3 Memory Paging Testing Table - Business Hours:
                Count the number of days during the analysis period where the Memory Paging rate is above 100 pages/second
                for more than one hour that day.  Since we do not want to know how many hours per day, we can
                summarize for the maximum observation per day and test against our threshold.
             -->
           <table-format heading="Rule 3: Memory Paging" date-format="MMM yyyy" number-format="##" no-data-msg="No Server Broke this Rule" colours="1-7=yellow,7-32=red">
           <count>
              <date-split type="Months">
                 <threshold-filter include="above" limit="0">
                   <time-summarize type="days" category="maximum">
                     <date-filter days="Weekdays" hours="Business Hours" include="true">
                       <get-group-data  metric="/common/Memory/Memory Paging" unique="interval" id="Rules" />
                     </date-filter>
                   </time-summarize>
                 </threshold-filter>
              </date-split>
           </count>
           </table-format>

           <!-- $4 Busiest Day CPU Chart:
                This chart depicts each individual servers' hourly CPU utilization for each individual servers' busiest day.

                This chart requires a custom Perceiver metric that returns a server's hourly CPU utilization for it's busiest day.  In a
                nutshell:
                     1. identify the daily-average CPU utilization for each day.
                     2. find the largest day in 1.
                     3. use the day defined in 2. and return CPU utilization for all intervals that day.
                -->
           <chart title="Busiest Day CPU by Server" size="400x300" type="dod" scales="0-100" y-labels="Total System CPU Utilization" >
                       <topbottom-filter type="days" location="top" count="1">
                                   <get-group-data  metric="/common/CPU/CPU Utilization" />
                       </topbottom-filter>
           </chart>

           <!-- $5 Average Business Day CPU chart:
                This chart depics each individual servers' average CPU utilization day.  By server, average each business
                hour of the day from all business days in the interval.  This could also be called "each servers normal
                business day".
                -->
           <chart title="Average Business Day CPU by Server" size="400x300" type="line" scales="0-100" y-labels="Total System CPU Utilization" >
             <date-categorize type="hours" categories="Average">
              <date-filter days="Weekdays" hours="Business Hours" include="TRUE">
                             <get-group-data  metric="/common/CPU/CPU Utilization" />
              </date-filter>
             </date-categorize>
           </chart>

           <!-- $6 Peak Batch Day CPU chart, by sum of that day's batch hours:
                This chart is very similar to $4, but is restricted to batch hours.  Notice the time-adjust to move 18:00 hours
                to 00:00 so that the date defines the entire batch period, not just the hours on a particular calendar day.
             -->
           <chart title="Busiest Batch Day CPU by Server" size="400x300" type="dod" scales="0-100" y-labels="Total System CPU Utilization" x-label="hide">
               <time-adjust type="hours" value="-18" >
                   <topbottom-filter type="days" location="top" count="1">
                        <date-filter days="6" hours="8-24" include="false">
                          <date-filter days="2" hours="0-8" include="false">
                            <date-filter days="Weekends" hours="0-24" include="false">
                              <date-filter days="Weekdays" hours="Business Hours" include="false">
                                <get-group-data  metric="/common/CPU/CPU Utilization" />
                              </date-filter>
                            </date-filter>
                          </date-filter>
                        </date-filter>
                   </topbottom-filter>
               </time-adjust>
           </chart>

           <!-- $7 Peak Bus Day CPU
                This chart is very similar to $8, but is restricted to business hours via the custom Perceiver metric.

                This chart requires a custom Perceiver metric that returns a server's hourly CPU utilization for it's busiest business day.
                 -->
           <chart title="Busiest Business Day CPU by Server" size="400x300" type="dod" scales="0-100" y-labels="Total System CPU Utilization" >
                      <topbottom-filter type="days" location="top" count="1">
                          <date-filter days="Weekdays" hours="Business Hours" include="TRUE">
                                  <get-group-data  metric="/common/CPU/CPU Utilization" />
                          </date-filter>
                      </topbottom-filter>
           </chart>


           <!-- $8 Peak Day CPU by server table:
                Similar to $4, but a table instead of a chart.
             -->
                 <table-format heading="Busiest CPU Day by Server, average CPU%" date-format="dd MMM yy" number-format="##">
                       <topbottom-filter type="points" location="top" count="1">
                           <time-summarize type="days" category="average">
                               <date-filter days="all" hours="all" include="true">
                                   <get-group-data  metric="/common/CPU/CPU Utilization" />
                               </date-filter>
                           </time-summarize>
                       </topbottom-filter>
                 </table-format>

            <!-- $9 Peak Business Day CPU by server table
                 Similar to $7, but a table instead of a chart.
                  -->
                 <table-format heading="Busiest Business CPU Day by Server, average CPU%" date-format="dd MMM yy" number-format="##">
                       <topbottom-filter type="points" location="top" count="1">
                           <time-summarize type="days" category="average">
                               <date-filter days="Weekdays" hours="Business Hours" include="true">
                                   <get-group-data  metric="/common/CPU/CPU Utilization" />
                               </date-filter>
                           </time-summarize>
                       </topbottom-filter>
                 </table-format>

            <!-- $10 Peak Batch Day CPU by server table
                 Similar to $6, but a table instead of a chart.
                  -->
           <table-format heading="Busiest Batch CPU Day by Server, average CPU%" date-format="dd MMM yy" number-format="##">
               <time-adjust type="hours" value="-18" >
                   <topbottom-filter type="points" location="top" count="1">
                   <topbottom-filter type="days" location="top" count="1">
                        <date-filter days="6" hours="8-24" include="false">
                          <date-filter days="2" hours="0-8" include="false">
                            <date-filter days="Weekends" hours="0-24" include="false">
                              <date-filter days="Weekdays" hours="Business Hours" include="false">
                                <get-group-data  metric="/common/CPU/CPU Utilization" />
                              </date-filter>
                            </date-filter>
                          </date-filter>
                        </date-filter>
                   </topbottom-filter>
                   </topbottom-filter>
               </time-adjust>
           </table-format>

            <!-- $11 Memory Paging:
                 Paging rate chart, during business hours.
                  -->
            <chart title="Memory Paging - Business Hours" size="700x400" type="line" y-labels="Page Rate (s/b &lt; 100)" >
                 <date-filter days="Weekdays" hours="Business Hours" include="true">
                                   <get-group-data  metric="/common/Memory/Memory Paging" />
                 </date-filter>
            </chart>

           <!-- $12 V Memory Util:
                Virtual memory utilization chart.
                 -->
            <chart title="Virtual Memory Utilization" scales="0-100" size="700x400" type="line" y-labels="% (s/b &lt; 80%)" >
                                   <get-group-data  metric="/common/Memory/Virtual Memory Utilization" />
            </chart>

            <!-- $13 App Busiest Business Hour Chart
                 This chart is meant to depict the application busiest hour (full day) CPU utilization.
                  -->
           <for-each item="system-dates" filter-type="none">
                       <topbottom-filter type="points" location="top" count="1">
                            <summarize-series type="AVERAGE">
                               <date-filter days="Weekdays" hours="Business Hours" include="true">
                                   <get-group-data  metric="/common/CPU/CPU Utilization" />
                               </date-filter>
                            </summarize-series>
                       </topbottom-filter>

                <!-- This FE produces the charts for the peak day The Application's Busiest Business Hour-->
                    <chart title="Busiest Business Hour for $object0.name is on $start.format(&quot;dd MMM yyyy&quot;)" legend="bottom" interval="data" type="line" scales="0-100"  y-labels="Total System CPU Utilization" x-label="Hour of Day" >
                      <threshold-filter include="above" limit="0">
                         <date-filter days="Weekdays" hours="Business Hours" include="true">
                            <get-group-data  metric="/common/CPU/CPU Utilization" interval="$iterator" />
                         </date-filter>
                      </threshold-filter>
                    </chart>
            </for-each>

            <!-- $14 App Busiest Batch Day Chart
                 This chart is meant to depict the application busiest batch day CPU utilization.
                  -->
              <for-each item="system-dates" filter-type="none">
                <time-adjust type="hours" shift="data" value="-18" >
                  <topbottom-filter type="points" location="top" count="1">
                    <topbottom-filter type="days" location="top" count="1">
                        <summarize-series type="AVERAGE">
                          <date-filter days="6" hours="8-24" include="false">
                           <date-filter days="2" hours="0-8" include="false">
                           <date-filter days="Weekends" hours="0-24" include="false">
                             <date-filter days="Weekdays" hours="Business Hours" include="false">
                                 <get-group-data  metric="/common/CPU/CPU Utilization" />
                             </date-filter>
                            </date-filter>
                           </date-filter>
                          </date-filter>
                        </summarize-series>
                    </topbottom-filter>
                  </topbottom-filter>
                </time-adjust>

                  <chart title="Busiest Batch Period for $object0.name is on $start.format(&quot;dd MMM yyyy&quot;)" legend="bottom" type="line" interval="data"
                         scales="0-100"  y-labels="Total System CPU Utilization" x-label="Hour of Day" >
                    <time-adjust type="hours" shift="request" value="18" >
                        <date-filter days="Weekdays" hours="Business Hours" include="false">
                          <get-group-data  metric="/common/CPU/CPU Utilization" interval="$iterator" />
                        </date-filter>
                    </time-adjust>
                  </chart>
              </for-each>

             <!-- $15 Application Busiest Business Hour (RAW):
                  This table determines the busiest business hour for the ENTIRE application, across all servers.
                   -->
                 <table-format raw="true" date-format="dd MMM yyyy HH:mm" number-format="##" delimiter=",">
                       <topbottom-filter type="points" location="top" count="1">
                             <summarize-series type="Maximum" group-by="date">
                               <date-filter days="Weekdays" hours="Business Hours" include="true">
                                   <get-group-data  metric="/common/CPU/CPU Utilization" />
                               </date-filter>
                             </summarize-series>
                       </topbottom-filter>
                 </table-format>

             <!-- $16 Application Busiest Batch Period (RAW):
                  This table determines the busiest batch hour for the ENTIRE application, across all servers.
                   -->
                   <table-format raw="true" date-format="dd MMM yy" number-format="##" delimiter=",">
                        <time-adjust type="hours" shift="data" value="-18" >
                          <topbottom-filter type="points" location="top" count="1">
                            <topbottom-filter type="days" location="top" count="1">
                                <summarize-series type="AVERAGE">
                                  <date-filter days="6" hours="8-24" include="false">
                                   <date-filter days="2" hours="0-8" include="false">
                                   <date-filter days="Weekends" hours="0-24" include="false">
                                     <date-filter days="Weekdays" hours="Business Hours" include="false">
                                         <get-group-data  metric="/common/CPU/CPU Utilization" />
                                     </date-filter>
                                    </date-filter>
                                   </date-filter>
                                  </date-filter>
                                </summarize-series>
                            </topbottom-filter>
                          </topbottom-filter>
                        </time-adjust>
                 </table-format>

             <!-- $17 Application Busiest Business Hour:
                  This table determines the busiest business hour for the ENTIRE application, across all servers.
                   -->
                 <table-format heading="The Application's Busiest Business Hour, CPU%" date-format="HH:mm dd MMMM yy" number-format="##">
                       <topbottom-filter type="points" location="top" count="1">
                             <summarize-series type="AVERAGE" group-by="date">
                               <date-filter days="Weekdays" hours="Business Hours" include="true">
                                   <get-group-data  metric="/common/CPU/CPU Utilization" />
                               </date-filter>
                             </summarize-series>
                       </topbottom-filter>
                 </table-format>

      </report>
   </view>

   <view name="Sample 2 - Standard Charts">
    <report file="monthly2.html" template="Unable to open monthly2.html template">

      <!-- %0% - Calendar Overview -->
      <calendar weekends="true">
       <chart size="100x75" bgcolor="white" scales="0-100" y-labels="hide" x-label="hide" legend="none">
         <get-group-data  metric="/common/CPU/CPU Utilization" interval="$iterator" />
       </chart>
      </calendar>

      <!-- %1% - %4% - Application View -->
      <chart title="CPU Utilization" type="lines" size="370x250" bgcolor="white">
         <get-group-data  metric="/common/CPU/CPU Utilization"/>
      </chart>

      <chart title="I/O Rate" type="lines" size="370x250" bgcolor="white">
         <get-group-data  metric="/common/IO/Total IO Rate"/>
      </chart>

      <chart title="Memory Utilization" type="lines" size="370x250" bgcolor="white">
         <get-group-data  metric="/common/Memory/Memory Utilization"/>
      </chart>

      <chart title="Network Packets" type="lines" size="370x250" bgcolor="white">
         <get-group-data  metric="/common/Networking/Network Packets"/>
      </chart>

      <!-- %5% - Per System Details -->
      <for-each item="system" filter-type="none">
       <report file="monthlydet.html" template="Unable to load template file!">
         <chart title="$metric0.name"
                legend="none" type="line" bgcolor="white" fontsize="10" size="350x250">
            <get-data metric="/common/CPU/CPU Utilization" object="$iterator"/>
         </chart>
         <chart title="$metric0.name"
              legend="none" type="line" bgcolor="white" fontsize="10" size="350x250">
           <get-data metric="/common/IO/Total IO Rate" object="$iterator"/>
         </chart>
         <chart title="Memory Detail"
              type="line" bgcolor="white" fontsize="10" size="350x250" shared-axis="false">
           <get-data metric="/common/Memory/Memory Utilization" object="$iterator"/>
           <get-data metric="/common/Memory/Memory Paging" object="$iterator"/>
         </chart>
         <chart title="Network Detail"
              type="line" bgcolor="white" fontsize="10" size="350x250">
           <get-group-data  metric="/common/Networking/Network Packets"/>
           <!-- Note: if you add network packets in / out to Perceive, you should use these instead -->
           <!--       These are available from us, just ask                                         -->

           <!--get-data metric="/common/Networking/Network Packets In" object="$iterator"/>
           <get-data metric="/common/Networking/Network Packets Out" object="$iterator"/-->
         </chart>
         <chart title="Top 10 Disks - Utilization"
              type="line" bgcolor="white" fontsize="10" size="350x250">
           <get-data metric="/common/IO/Disk Utilization/Top 10 Disks - Chart" object="$iterator"/>
         </chart>
         <chart title="Top 10 Disks - Service Time"
              type="line" bgcolor="white" fontsize="10" size="350x250">
           <get-data metric="/common/IO/Disk Service Time/Top 10 Disks - Chart" object="$iterator"/>
         </chart>
         <chart title="Top 10 Network Interfaces - KBytes out"
              type="line" bgcolor="white" fontsize="10" size="350x250">
           <get-data metric="/common/Networking/Network Interface KBytes Out/Top 10 Interfaces - Chart" object="$iterator"/>
         </chart>
         <chart title="Top 10 Network Interfaces - KBytes in"
              type="line" bgcolor="white" fontsize="10" size="350x250">
           <get-data metric="/common/Networking/Network Interface KBytes In/Top 10 Interfaces - Chart" object="$iterator"/>
         </chart>

       </report>
    </for-each>


    </report>
   </view>

 </category>
</views>

