<form stylesheet="ui_simple.css,hover.css,hide_timeindicator.css,panel_decoration.css" script="active_button.js,autodiscover.js" isVisible="true" version="1.1" theme="dark">
    <label>Bullet Dashboard - TOP servers by CPU/Memory, TOP Processes by CPU</label>
    <fieldset autoRun="false" submitButton="false">

        <input type="time" token="timerange" searchWhenChanged="true">
            <label>Time Range:</label>
            <default>
                <earliest>-4h</earliest>
                <latest>now</latest>
            </default>
            <change>
                <unset token="form.refresh"></unset>
            </change>
        </input>

        <input type="dropdown" token="timefilter" searchWhenChanged="true">
            <label>Time Filtering:</label>
            <choice value="No_Filter">No Filter (24/24, 7/7)</choice>
            <choice value="Day_BusinessDays_8h-19h">Day Business (08h-19h)</choice>
            <choice value="Day_WeekEnd_8h-19h">Day WE (08h-19h)</choice>
            <choice value="Day_AllDays_8h-19h">Day Week (08h-19h)</choice>
            <choice value="Night_BusinessDays_19h-8h">Night Business (19h-08h)</choice>
            <choice value="Night_WeekEnd_19h-8h">Night WE (19h-08h)</choice>
            <choice value="Night_AllDays_19h-8h">Night All Days (19h-08h)</choice>
            <default>No_Filter</default>
        </input>

        <input type="dropdown" token="osfilter" searchWhenChanged="true">
            <label>Filter OS Type:</label>
            <default>*</default>
            <prefix>OStype="</prefix>
            <suffix>"</suffix>
            <choice value="*">Any OS</choice>
            <choice value="AIX">AIX</choice>
            <choice value="Linux">Linux</choice>
            <choice value="Solaris">Solaris</choice>
            <!--
            Reset the form token changed
            -->
       		<change>
         		<unset token="drilldown_cpuhost"></unset>
                <unset token="drilldown_memhost"></unset>
                <unset token="drilldown_swaphost"></unset>
       		</change>
        </input>

        <input id="frameID" type="multiselect" token="frameID" searchWhenChanged="true">
            <label>Frame IDs:</label>
            <!-- Populating Data Model Search -->
            <search base="populate">
                <query>stats count by frameID | dedup frameID | sort 0 frameID</query>
            </search>
            <valuePrefix>frameID="</valuePrefix>
            <valueSuffix>"</valueSuffix>
            <delimiter> OR </delimiter>
            <choice value="*">Any</choice>
            <initialValue>*</initialValue>
            <fieldForLabel>frameID</fieldForLabel>
            <fieldForValue>frameID</fieldForValue>
            <!--
            Reset the form token changed
            -->
       		<change>
         		<unset token="drilldown_cpuhost"></unset>
                <unset token="drilldown_memhost"></unset>
                <unset token="drilldown_swaphost"></unset>
       		</change>
        </input>

        <input type="text" token="host-prefilter" searchWhenChanged="true">
            <label>Optional: Filter hosts populating</label>
            <default>*</default>
            <!--
            Reset the form token changed
            -->
       		<change>
         		<unset token="drilldown_cpuhost"></unset>
                <unset token="drilldown_memhost"></unset>
                <unset token="drilldown_swaphost"></unset>
       		</change>
        </input>

		<input id="host" type="multiselect" token="host" searchWhenChanged="true">
		    <label>Hosts Selection:</label>
		    <!-- Populating Data Model Search -->
		    <search base="populate">
		        <query>search $frameID$ host=$host-prefilter$
	| stats count by host | dedup host | sort 0 host</query>
		    </search>
		    <valuePrefix>host="</valuePrefix>
		    <valueSuffix>"</valueSuffix>
		    <delimiter> OR </delimiter>
		    <choice value="*">ALL Hosts</choice>
		    <fieldForLabel>host</fieldForLabel>
		    <fieldForValue>host</fieldForValue>
		    <change>
                <unset token="drilldown_cpuhost"></unset>
                <unset token="drilldown_memhost"></unset>
                <unset token="drilldown_swaphost"></unset>
                <unset token="form.host_query_input"></unset>
		    </change>
		</input>

		<!-- hidden form that handles the advanced definition of hosts selection -->

		<input id="host_query_input" type="dropdown" token="host_query" searchWhenChanged="true" depends="$hidden_form$">
		    <label>Hosts Selection:</label>
		    <search base="populate">
		        <query>search $host$ $frameID$
	| stats values(host) as host
	| format | fields - host | rename search as host</query>
		    </search>
		    <selectFirstChoice>true</selectFirstChoice>
		    <fieldForLabel>host</fieldForLabel>
		    <fieldForValue>host</fieldForValue>
		</input>

        <input type="dropdown" token="refresh" searchWhenChanged="true">
            <label>Auto-refresh:</label>
            <fieldForLabel>label</fieldForLabel>
            <fieldForValue>value</fieldForValue>
            <selectFirstChoice>true</selectFirstChoice>
            <search>
                <query>| `def_auto_refresh`</query>
                <earliest>$timerange.earliest$</earliest>
                <latest>$timerange.latest$</latest>
            </search>
        </input>

    </fieldset>

    <!-- Base Searches for PostProcessing -->

    <search id="populate">
        <query>| mcatalog values(metric_name) where `nmon_metrics_index` metric_name="os.unix.nmon.cpu.cpu_all.*" $osfilter$ by host
| `mapping_frameID`
| stats count by frameID, host | sort 0 host</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
    </search>

    <!--
    Dynamic configuration
    The following searches are being used to define various tokens using event handlers
    -->

    <!-- ############################# CPU stats ############################# -->

    <row>
        <panel>
            <html>
                <div class="dashseparator">
                    <h1>PROCESSOR - TOP servers by CPU / Physical and Virtual memory % utilization - Dynamic drilldown: Click on the server line to see over time statistics</h1>
                </div>
            </html>
        </panel>
    </row>

    <search id="main_cpu">
        <query>| mstats avg(_value) as value where `nmon_metrics_index` (metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT OR metric_name=os.unix.nmon.cpu.lpar.VP_User_PCT OR metric_name=os.unix.nmon.cpu.lpar.VP_Sys_PCT OR metric_name=os.unix.nmon.cpu.lpar.VP_Wait_PCT OR metric_name=os.unix.nmon.cpu.lpar.VP_Idle_PCT OR metric_name=os.unix.nmon.cpu.lpar.PhysicalCPU OR metric_name=os.unix.nmon.cpu.lpar.virtualCPUs OR metric_name=os.unix.nmon.cpu.lpar.partition_active_processors) host=$host-prefilter$ $host_query$ by metric_name, OStype, host span=1m
| `def_all_os_cpu_load_percent`
| stats max(cpu_load_percent) AS max_usage avg(cpu_load_percent) AS avg_usage median(cpu_load_percent) AS median_usage by host
| foreach *_usage [ eval &lt;&lt;FIELD&gt;&gt;=round('&lt;&lt;FIELD&gt;&gt;', 2) ]</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
        <refresh>$refresh$</refresh>
        <refreshType>delay</refreshType>
    </search>

    <search id="main_memory">
        <query>| mstats avg(_value) as value where `nmon_metrics_index` `def_memory_all_os_metric_filters` host=$host-prefilter$ $host_query$ by OStype, host, metric_name span=1m
| `def_memory_load_percent`
| stats avg(mem_used_effective_PCT) AS mem_usage_pct, avg(swap_used_effective_PCT) AS swap_usage_pct by host
| foreach *_usage_pct [ eval &lt;&lt;FIELD&gt;&gt;=round('&lt;&lt;FIELD&gt;&gt;', 2) ]</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
        <refresh>$refresh$</refresh>
        <refreshType>delay</refreshType>
    </search>

    <row>
        <panel>
            <title>TOP 5 hosts by Average CPU percentage usage (%)</title>
            <viz type="bullet_graph_app.bullet_graph">
                <search base="main_cpu">
                    <query>sort - avg_usage | head 5 | eval range_low=50,range_med=85,range_high=100,target=100 | table host,avg_usage,range_low,range_med,range_high,target | sort host</query>
                </search>
                <option name="bullet_graph_app.bullet_graph.bulletColor">#778899</option>
                <option name="bullet_graph_app.bullet_graph.targetMarkerColor">#ff0000</option>
                <option name="bullet_graph_app.bullet_graph.rangeLowColor">#77dd77</option>
                <option name="bullet_graph_app.bullet_graph.rangeMidColor">#f7bc38</option>
                <option name="bullet_graph_app.bullet_graph.rangeHighColor">#FF7878</option>
                <option name="height">300</option>
                <option name="refresh.display">preview</option>
                <drilldown>
                    <set token="drilldown_cpuhost">$row.host$</set>
                </drilldown>
            </viz>
        </panel>
        <panel>
            <title>TOP 5 hosts by Average physical memory usage (%)</title>
            <viz type="bullet_graph_app.bullet_graph">
                <search base="main_memory">
                    <query>sort - mem_usage_pct | head 5 | eval range_low=50,range_med=85,range_high=100,target=100 | table host,mem_usage_pct,range_low,range_med,range_high,target | sort host</query>
                </search>
                <option name="bullet_graph_app.bullet_graph.bulletColor">#778899</option>
                <option name="bullet_graph_app.bullet_graph.targetMarkerColor">#FF7878</option>
                <option name="bullet_graph_app.bullet_graph.rangeLowColor">#77dd77</option>
                <option name="bullet_graph_app.bullet_graph.rangeMidColor">#f7bc38</option>
                <option name="bullet_graph_app.bullet_graph.rangeHighColor">#FF7878</option>
                <option name="height">300</option>
                <option name="refresh.display">preview</option>
                <drilldown>
                    <set token="drilldown_memhost">$row.host$</set>
                </drilldown>
            </viz>
        </panel>
        <panel>
            <title>TOP 5 hosts by Average swap memory usage (%)</title>
            <viz type="bullet_graph_app.bullet_graph">
                <search base="main_memory">
                    <query>sort - swap_usage_pct | head 5 | eval range_low=50,range_med=85,range_high=100,target=100 | table host,swap_usage_pct,range_low,range_med,range_high,target | sort host</query>
                </search>
                <option name="bullet_graph_app.bullet_graph.bulletColor">#778899</option>
                <option name="bullet_graph_app.bullet_graph.targetMarkerColor">#FF7878</option>
                <option name="bullet_graph_app.bullet_graph.rangeLowColor">#77dd77</option>
                <option name="bullet_graph_app.bullet_graph.rangeMidColor">#f7bc38</option>
                <option name="bullet_graph_app.bullet_graph.rangeHighColor">#FF7878</option>
                <option name="height">300</option>
                <option name="refresh.display">preview</option>
                <drilldown>
                    <set token="drilldown_swaphost">$row.host$</set>
                </drilldown>
            </viz>
        </panel>
    </row>

    <row depends="$drilldown_cpuhost$">
        <panel>
            <title>Server $drilldown_cpuhost$ - % CPU utilization over time</title>
            <input type="dropdown" token="span" searchWhenChanged="true">
                <label>Span:</label>
                <default>`nmon_span`</default>
                <choice value="`nmon_span`">auto</choice>
                <choice value="span=1m">1 minute</choice>
                <choice value="span=2m">2 minutes</choice>
                <choice value="span=3m">3 minutes</choice>
                <choice value="span=4m">4 minutes</choice>
                <choice value="span=5m">5 minutes</choice>
                <choice value="span=10m">10 minutes</choice>
                <choice value="span=15m">15 minutes</choice>
                <choice value="span=30m">30 minutes</choice>
                <choice value="span=1h">1 hour</choice>
                <choice value="span=2h">2 hours</choice>
                <choice value="span=12h">12 hours</choice>
                <choice value="span=4h">4 hours</choice>
                <choice value="span=1d">1 day</choice>
                <choice value="span=2d">2 days</choice>
                <choice value="span=1w">7 days</choice>
                <choice value="span=1mon">1 month</choice>
            </input>
            <input type="checkbox" token="cpu_scale" searchWhenChanged="true">
                <label></label>
                <initialValue>0</initialValue>
                <choice value="0">Starts scale at 0 %</choice>
            </input>
            <input type="checkbox" token="cpu_scaleend" searchWhenChanged="true">
                <label></label>
                <choice value="100">Ends scale at 100 %</choice>
                <initialValue>100</initialValue>
            </input>
            <input type="dropdown" token="chart" searchWhenChanged="true" depends="$cpu_chart_options$">
                <label>Type of chart:</label>
                <default>line</default>
                <choice value="area">Area</choice>
                <choice value="line">Line</choice>
                <choice value="column">Column</choice>
                <choice value="bar">Bar</choice>
            </input>
            <input type="dropdown" token="charting.chart.nullValueMode" searchWhenChanged="true" depends="$cpu_chart_options$">
                <label>Missing Data:</label>
                <default>gaps</default>
                <choice value="gaps">Gaps</choice>
                <choice value="connect">Connect</choice>
                <choice value="zero">Zero</choice>
            </input>
            <input type="dropdown" token="charting.legend.placement" searchWhenChanged="true" depends="$cpu_chart_options$">
                <label>Legend:</label>
                <default>bottom</default>
                <choice value="bottom">Bottom</choice>
                <choice value="top">Top</choice>
                <choice value="left">left</choice>
                <choice value="right">right</choice>
                <choice value="none">none</choice>
            </input>
            <chart>
                <search depends="$drilldown_cpuhost$">
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` (metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT OR metric_name=os.unix.nmon.cpu.lpar.VP_User_PCT OR metric_name=os.unix.nmon.cpu.lpar.VP_Sys_PCT OR metric_name=os.unix.nmon.cpu.lpar.VP_Wait_PCT OR metric_name=os.unix.nmon.cpu.lpar.VP_Idle_PCT OR metric_name=os.unix.nmon.cpu.lpar.PhysicalCPU OR metric_name=os.unix.nmon.cpu.lpar.virtualCPUs OR metric_name=os.unix.nmon.cpu.lpar.partition_active_processors) host=$drilldown_cpuhost$ by metric_name, OStype, host span=1m
| `def_all_os_cpu_load_percent`
| timechart $span$ avg(cpu_load_percent) AS cpu_load_percent | trendline sma5(cpu_load_percent) AS trend</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="height">400</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisTitleY.text">% CPUs</option>
                <option name="charting.axisY.minimumNumber">$cpu_scale$</option>
                <option name="charting.axisY.maximumNumber">$cpu_scaleend$</option>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="refresh.display">none</option>
            </chart>
        </panel>
    </row>

    <row depends="$drilldown_memhost$">
        <panel>
            <title>Server $drilldown_memhost$ - % Physical memory utilization over time</title>
            <input type="dropdown" token="span" searchWhenChanged="true">
                <label>Span:</label>
                <default>`nmon_span`</default>
                <choice value="`nmon_span`">auto</choice>
                <choice value="span=1m">1 minute</choice>
                <choice value="span=2m">2 minutes</choice>
                <choice value="span=3m">3 minutes</choice>
                <choice value="span=4m">4 minutes</choice>
                <choice value="span=5m">5 minutes</choice>
                <choice value="span=10m">10 minutes</choice>
                <choice value="span=15m">15 minutes</choice>
                <choice value="span=30m">30 minutes</choice>
                <choice value="span=1h">1 hour</choice>
                <choice value="span=2h">2 hours</choice>
                <choice value="span=12h">12 hours</choice>
                <choice value="span=4h">4 hours</choice>
                <choice value="span=1d">1 day</choice>
                <choice value="span=2d">2 days</choice>
                <choice value="span=1w">7 days</choice>
                <choice value="span=1mon">1 month</choice>
            </input>
            <input type="checkbox" token="mem_scale" searchWhenChanged="true">
                <label></label>
                <initialValue>0</initialValue>
                <choice value="0">Starts scale at 0 %</choice>
            </input>
            <input type="checkbox" token="mem_scaleend" searchWhenChanged="true">
                <label></label>
                <choice value="100">Ends scale at 100 %</choice>
                <initialValue>100</initialValue>
            </input>
            <input type="dropdown" token="chart" searchWhenChanged="true">
                <label>Type of chart:</label>
                <default>line</default>
                <choice value="area">Area</choice>
                <choice value="line">Line</choice>
                <choice value="column">Column</choice>
                <choice value="bar">Bar</choice>
            </input>
            <input type="dropdown" token="charting.chart.nullValueMode" searchWhenChanged="true">
                <label>Missing Data:</label>
                <default>gaps</default>
                <choice value="gaps">Gaps</choice>
                <choice value="connect">Connect</choice>
                <choice value="zero">Zero</choice>
            </input>
            <input type="dropdown" token="charting.legend.placement" searchWhenChanged="true">
                <label>Legend:</label>
                <default>bottom</default>
                <choice value="bottom">Bottom</choice>
                <choice value="top">Top</choice>
                <choice value="left">left</choice>
                <choice value="right">right</choice>
                <choice value="none">none</choice>
            </input>
            <chart>
                <search depends="$drilldown_memhost$">
        <query>| mstats avg(_value) as value where `nmon_metrics_index` `def_memory_all_os_metric_filters` host=$drilldown_memhost$ by OStype, host, metric_name span=1m
| `def_memory_load_percent`
| timechart $span$ dedup_splitvals=t avg(mem_used_effective_PCT) AS avg_mem_used_pct | trendline sma5(avg_mem_used_pct) AS trend</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="height">400</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisTitleY.text">% physical memory</option>
                <option name="charting.axisY.minimumNumber">$mem_scale$</option>
                <option name="charting.axisY.maximumNumber">$mem_scaleend$</option>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="refresh.display">none</option>
            </chart>
        </panel>
    </row>

    <row depends="$drilldown_swaphost$">
        <panel>
            <title>Server $drilldown_swaphost$ - % Virtual memory utilization over time</title>
            <input type="dropdown" token="span" searchWhenChanged="true">
                <label>Span:</label>
                <default>`nmon_span`</default>
                <choice value="`nmon_span`">auto</choice>
                <choice value="span=1m">1 minute</choice>
                <choice value="span=2m">2 minutes</choice>
                <choice value="span=3m">3 minutes</choice>
                <choice value="span=4m">4 minutes</choice>
                <choice value="span=5m">5 minutes</choice>
                <choice value="span=10m">10 minutes</choice>
                <choice value="span=15m">15 minutes</choice>
                <choice value="span=30m">30 minutes</choice>
                <choice value="span=1h">1 hour</choice>
                <choice value="span=2h">2 hours</choice>
                <choice value="span=12h">12 hours</choice>
                <choice value="span=4h">4 hours</choice>
                <choice value="span=1d">1 day</choice>
                <choice value="span=2d">2 days</choice>
                <choice value="span=1w">7 days</choice>
                <choice value="span=1mon">1 month</choice>
            </input>
            <input type="checkbox" token="swap_scale" searchWhenChanged="true">
                <label></label>
                <initialValue>0</initialValue>
                <choice value="0">Starts scale at 0 %</choice>
            </input>
            <input type="checkbox" token="swap_scaleend" searchWhenChanged="true">
                <label></label>
                <choice value="100">Ends scale at 100 %</choice>
                <initialValue>100</initialValue>
            </input>
            <input type="dropdown" token="chart" searchWhenChanged="true">
                <label>Type of chart:</label>
                <default>line</default>
                <choice value="area">Area</choice>
                <choice value="line">Line</choice>
                <choice value="column">Column</choice>
                <choice value="bar">Bar</choice>
            </input>
            <input type="dropdown" token="charting.chart.nullValueMode" searchWhenChanged="true">
                <label>Missing Data:</label>
                <default>gaps</default>
                <choice value="gaps">Gaps</choice>
                <choice value="connect">Connect</choice>
                <choice value="zero">Zero</choice>
            </input>
            <input type="dropdown" token="charting.legend.placement" searchWhenChanged="true">
                <label>Legend:</label>
                <default>bottom</default>
                <choice value="bottom">Bottom</choice>
                <choice value="top">Top</choice>
                <choice value="left">left</choice>
                <choice value="right">right</choice>
                <choice value="none">none</choice>
            </input>
            <chart>
                <search depends="$drilldown_swaphost$">
        <query>| mstats avg(_value) as value where `nmon_metrics_index` `def_memory_all_os_metric_filters` host=$drilldown_swaphost$ by OStype, host, metric_name span=1m
| `def_memory_load_percent`
| timechart $span$ avg(swap_used_effective_PCT) AS avg_swap_used_pct | trendline sma5(avg_swap_used_pct) AS trend</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="height">400</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisTitleY.text">% virtual memory</option>
                <option name="charting.axisY.minimumNumber">$swap_scale$</option>
                <option name="charting.axisY.maximumNumber">$swap_scaleend$</option>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="refresh.display">none</option>
            </chart>
        </panel>
    </row>

    <!-- ############################# TOP stats ############################# -->

    <search id="TOPSearch_cpu">
        <query>| mstats max(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.processes.top.pct_CPU" host=$host-prefilter$ $host_query$ by host, metric_name, dimension_Command, dimension_PID span=1m
| stats sum(value) as value by _time, host, dimension_Command
| eval usage_per_core=(value/100)
| lookup nmon_inventory hostname as host OUTPUT cpu_logicalcores
| eval usage_pct=(usage_per_core/cpu_logicalcores)*100
| stats avg(usage_pct) as avg_usage_pct, max(usage_pct) as max_usage_pct by dimension_Command
| sort - avg_usage_pct</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
        <refresh>$refresh$</refresh>
        <refreshType>delay</refreshType>
    </search>

    <row>
        <panel>
            <html>
                <div class="dashseparator">
                    <h1>PROCESSES - TOP Commands in CPU % utilization - Dynamic drilldown: Click on the Command line to see over time statistics</h1>
                </div>
            </html>
        </panel>
    </row>

    <row>
        <panel>
            <title>TOP 5 Commands by Average CPU usage (% usage by sum of logical CPUs)</title>
            <viz type="bullet_graph_app.bullet_graph">
                <search base="TOPSearch_cpu">
                    <query>sort - avg_usage_pct | head 5 | eval range_low=50,range_med=85,range_high=100,target=100 | table dimension_Command,avg_usage_pct,range_low,range_med,range_high,target | sort dimension_Command</query>
                </search>
                <option name="bullet_graph_app.bullet_graph.bulletColor">#778899</option>
                <option name="bullet_graph_app.bullet_graph.targetMarkerColor">#FF7878</option>
                <option name="bullet_graph_app.bullet_graph.rangeLowColor">#77dd77</option>
                <option name="bullet_graph_app.bullet_graph.rangeMidColor">#f7bc38</option>
                <option name="bullet_graph_app.bullet_graph.rangeHighColor">#FF7878</option>
                <option name="height">300</option>
                <option name="refresh.display">preview</option>
                <drilldown>
                    <set token="drilldown_topcpu">$row.dimension_Command$</set>
                    <set token="top_statsmode">avg</set>
                    <set token="top_statsmode_label">Average</set>
                </drilldown>
            </viz>
        </panel>
        <panel>
            <title>TOP 5 Commands by Max CPU usage (% usage by sum of logical CPUs)</title>
            <viz type="bullet_graph_app.bullet_graph">
                <search base="TOPSearch_cpu">
                    <query>sort - max_usage_pct | head 5 | eval range_low=50,range_med=85,range_high=100,target=100 | table dimension_Command,max_usage_pct,range_low,range_med,range_high,target | sort dimension_Command</query>
                </search>
                <option name="bullet_graph_app.bullet_graph.bulletColor">#778899</option>
                <option name="bullet_graph_app.bullet_graph.targetMarkerColor">#FF7878</option>
                <option name="bullet_graph_app.bullet_graph.rangeLowColor">#77dd77</option>
                <option name="bullet_graph_app.bullet_graph.rangeMidColor">#f7bc38</option>
                <option name="bullet_graph_app.bullet_graph.rangeHighColor">#FF7878</option>
                <option name="height">300</option>
                <option name="refresh.display">preview</option>
                <drilldown>
                    <set token="drilldown_topcpu">$row.dimension_Command$</set>
                    <set token="top_statsmode">max</set>
                    <set token="top_statsmode_label">Max</set>
                </drilldown>
            </viz>
        </panel>
    </row>

    <row depends="$drilldown_topcpu$">
        <panel>
            <title>Command $drilldown_topcpu$ - $top_statsmode_label$ % CPU utilization over time</title>
            <input type="dropdown" token="span" searchWhenChanged="true">
                <label>Span:</label>
                <default>`nmon_span`</default>
                <choice value="`nmon_span`">auto</choice>
                <choice value="span=1m">1 minute</choice>
                <choice value="span=2m">2 minutes</choice>
                <choice value="span=3m">3 minutes</choice>
                <choice value="span=4m">4 minutes</choice>
                <choice value="span=5m">5 minutes</choice>
                <choice value="span=10m">10 minutes</choice>
                <choice value="span=15m">15 minutes</choice>
                <choice value="span=30m">30 minutes</choice>
                <choice value="span=1h">1 hour</choice>
                <choice value="span=2h">2 hours</choice>
                <choice value="span=12h">12 hours</choice>
                <choice value="span=4h">4 hours</choice>
                <choice value="span=1d">1 day</choice>
                <choice value="span=2d">2 days</choice>
                <choice value="span=1w">7 days</choice>
                <choice value="span=1mon">1 month</choice>
            </input>
            <input type="checkbox" token="top_scale" searchWhenChanged="true">
                <label></label>
                <initialValue>0</initialValue>
                <choice value="0">Starts scale at 0 %</choice>
            </input>
            <input type="checkbox" token="top_scaleend" searchWhenChanged="true">
                <label></label>
                <choice value="100">Ends scale at 100 %</choice>
                <initialValue>100</initialValue>
            </input>
            <input type="dropdown" token="chart" searchWhenChanged="true">
                <label>Type of chart:</label>
                <default>line</default>
                <choice value="area">Area</choice>
                <choice value="line">Line</choice>
                <choice value="column">Column</choice>
                <choice value="bar">Bar</choice>
            </input>
            <input type="dropdown" token="charting.chart.nullValueMode" searchWhenChanged="true">
                <label>Missing Data:</label>
                <default>gaps</default>
                <choice value="gaps">Gaps</choice>
                <choice value="connect">Connect</choice>
                <choice value="zero">Zero</choice>
            </input>
            <input type="dropdown" token="charting.legend.placement" searchWhenChanged="true">
                <label>Legend:</label>
                <default>bottom</default>
                <choice value="bottom">Bottom</choice>
                <choice value="top">Top</choice>
                <choice value="left">left</choice>
                <choice value="right">right</choice>
                <choice value="none">none</choice>
            </input>
            <chart>
                <search>
        <query>| mstats max(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.processes.top.pct_CPU" host=$host-prefilter$ $host_query$ dimension_Command=$drilldown_topcpu$ by host, metric_name, dimension_Command, dimension_PID span=1m
| stats sum(value) as value by _time, host, dimension_Command
| eval usage_per_core=(value/100)
| lookup nmon_inventory hostname as host OUTPUT cpu_logicalcores
| eval usage_pct=(usage_per_core/cpu_logicalcores)*100
| timechart $span$ $top_statsmode$(usage_pct) AS usage_pct by dimension_Command</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="height">400</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisTitleY.text">% CPU utilization</option>
                <option name="charting.axisY.minimumNumber">$top_scale$</option>
                <option name="charting.axisY.maximumNumber">$top_scaleend$</option>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="refresh.display">none</option>
            </chart>
        </panel>
    </row>

    <row depends="$drilldown_topcpu$">
        <panel>
            <title>Command $drilldown_topcpu$ - $top_statsmode_label$ % CPU utilization over time by server</title>
            <input type="dropdown" token="span" searchWhenChanged="true">
                <label>Span:</label>
                <default>`nmon_span`</default>
                <choice value="`nmon_span`">auto</choice>
                <choice value="span=1m">1 minute</choice>
                <choice value="span=2m">2 minutes</choice>
                <choice value="span=3m">3 minutes</choice>
                <choice value="span=4m">4 minutes</choice>
                <choice value="span=5m">5 minutes</choice>
                <choice value="span=10m">10 minutes</choice>
                <choice value="span=15m">15 minutes</choice>
                <choice value="span=30m">30 minutes</choice>
                <choice value="span=1h">1 hour</choice>
                <choice value="span=2h">2 hours</choice>
                <choice value="span=12h">12 hours</choice>
                <choice value="span=4h">4 hours</choice>
                <choice value="span=1d">1 day</choice>
                <choice value="span=2d">2 days</choice>
                <choice value="span=1w">7 days</choice>
                <choice value="span=1mon">1 month</choice>
            </input>
            <input type="checkbox" token="topserver_scale" searchWhenChanged="true">
                <label></label>
                <initialValue>0</initialValue>
                <choice value="0">Starts scale at 0 %</choice>
            </input>
            <input type="checkbox" token="topserver_scaleend" searchWhenChanged="true">
                <label></label>
                <choice value="100">Ends scale at 100 %</choice>
                <initialValue>100</initialValue>
            </input>
            <input type="dropdown" token="chart" searchWhenChanged="true">
                <label>Type of chart:</label>
                <default>line</default>
                <choice value="area">Area</choice>
                <choice value="line">Line</choice>
                <choice value="column">Column</choice>
                <choice value="bar">Bar</choice>
            </input>
            <input type="dropdown" token="charting.chart.nullValueMode" searchWhenChanged="true">
                <label>Missing Data:</label>
                <default>gaps</default>
                <choice value="gaps">Gaps</choice>
                <choice value="connect">Connect</choice>
                <choice value="zero">Zero</choice>
            </input>
            <input type="dropdown" token="charting.legend.placement" searchWhenChanged="true">
                <label>Legend:</label>
                <default>bottom</default>
                <choice value="bottom">Bottom</choice>
                <choice value="top">Top</choice>
                <choice value="left">left</choice>
                <choice value="right">right</choice>
                <choice value="none">none</choice>
            </input>
            <chart>
                <search>
        <query>| mstats max(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.processes.top.pct_CPU" host=$host-prefilter$ $host_query$ dimension_Command=$drilldown_topcpu$ by host, metric_name, dimension_Command, dimension_PID span=1m
| stats sum(value) as value by _time, host, dimension_Command
| eval usage_per_core=(value/100)
| lookup nmon_inventory hostname as host OUTPUT cpu_logicalcores
| eval usage_pct=(usage_per_core/cpu_logicalcores)*100
| eval key = host . ":" . dimension_Command
| timechart $span$ $top_statsmode$(usage_pct) AS usage_pct by key</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="height">400</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisTitleY.text">% CPU utilization</option>
                <option name="charting.axisY.minimumNumber">$topserver_scale$</option>
                <option name="charting.axisY.maximumNumber">$topserver_scaleend$</option>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="refresh.display">none</option>
            </chart>
        </panel>
    </row>

</form>
