<form stylesheet="ui_simple.css" script="modal.js" isVisible="true" version="1.1" theme="dark">
    <label>Metric Explorer - Universal interface for Nmon metrics exploration</label>
    <description>The Metric Explorer provides a simple and efficient human interface to analyse any available metrics</description>

    <!--
    base search for main dropdown populating for Servers
    -->

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

    <!--
    Retrieve the OStype values for each Server and define a token according to its values
    This token will be used to filter out added calculated metrics
    -->

    <search id="ostype_analysis">
        <query>| mcatalog values(OStype) as OStype_values where `nmon_metrics_index` metric_name="os.unix.nmon.cpu.cpu_all.logical_cpus" ($host$)
| rename OStype_values as OStype
| mvexpand OStype
| eval OStype="is_" . OStype . "==\"True\""
| mvcombine OStype | nomv OStype | rex field=OStype mode=sed "s/\" /\" OR /g"</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
        <progress>
            <condition>
                <set token="OStype">$result.OStype$</set>
            </condition>
        </progress>
    </search>

    <!--
    Base search for the metric catalog populating, avoid extending raw metrics with non relevant calculated metrics
    -->

    <search id="populate_metric_mono">
        <query>| mcatalog values(metric_name) as metrics where `nmon_metrics_index` metric_name="os.unix.nmon.*" $osfilter$ ($host$)
| rename metrics as metric_name
| mvexpand metric_name
| append [ | inputlookup nmon_metric_catalog where ($OStype$) | fields metric_name ]
| rex field="metric_name" "os\.unix\.nmon\.(?&lt;metric_category&gt;\w*)\.(?&lt;nmon_section&gt;\w*)"
| sort 0 metric_name
| lookup nmon_metric_catalog metric_name
| eval metric_filter=if(isnull(metric_filter), ("metric_name=" . metric_name), metric_filter)
| eval metric_has_device=if(match(metric_name, "\.disk\w*|\.adapters|\.dg\w*|\.top\.|\.df_\w*|\.jfs\w*|\.network\.\w*"), "True", "False")
| eval metric_dimension_field=case(match(metric_name, "df_\w*|jfsfile|jfsinode"), "dimension_mount", match(metric_name, "\.top\.*"), "dimension_Command", metric_has_device=="True", "dimension_device")
| eval metric_volume_unit_choice=if(match(metric_name, "df_storage\.Used"), "True", "False")
| eval metric_rate_unit_choice=if(match(metric_name, "\.network\.net"), "True", "False")
| rex field="metric_name" "os\.unix\.nmon\.\w*\.\w*\.(?&lt;metric_shortname&gt;\w*)"
| rex field="metric_name" "os\.unix\.nmon\.\w*\.(?&lt;metric_shortname&gt;\w*)$"
| eval metric_calculation=if(isnotnull(metric_calculation), metric_calculation, "eval value=value")
| eval metric_type_of_calculation=if(isnotnull(metric_type_of_calculation), metric_type_of_calculation, "01 - raw metric")
| eval metric_data_field=if(isnotnull(metric_data_field), metric_data_field, "value")
| eval metric_by=if(isnotnull(metric_groupby), metric_groupby, metric_by) | eval metric_by=if(isnull(metric_by), "host", metric_by)
| eval metric_table_by=if(isnotnull(metric_table_by), metric_table_by, "host")
| eval metric_timechart_by=if(isnotnull(metric_timechart_by), metric_timechart_by, "host")
| eval metric_primary_statsmode=if(isnotnull(metric_primary_statsmode), metric_primary_statsmode, "avg")
| eval metric_charting_chart=if(isnotnull(metric_charting_chart), metric_charting_chart, "line")
| eval metric_charting_stackmode=if(isnotnull(metric_charting_stackmode), metric_charting_stackmode, "default")
        </query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
    </search>

    <!--
    Base search for the metric catalog populating, avoid extending raw metrics with non relevant calculated metrics
    -->

    <search id="populate_metric_simple_mode">
        <query>| mcatalog values(metric_name) as metrics where `nmon_metrics_index` metric_name="os.unix.nmon.*" ($host$)
| rename metrics as metric_name
| mvexpand metric_name
| rex field="metric_name" "os\.unix\.nmon\.(?&lt;metric_category&gt;\w*)\.(?&lt;nmon_section&gt;\w*)"
| sort 0 metric_name</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
    -->

    <!-- definition of metric related tokens -->

    <search id="basesearch_metric_definition" base="populate_metric_mono">
        <query>search metric_name=$metric_name$</query>
        <progress>
            <condition>
                <set token="metric_filter">$result.metric_filter$</set>
                <set token="metric_calculation">$result.metric_calculation$</set>
                <set token="metric_has_device">$result.metric_has_device$</set>
                <set token="metric_dimension_field">$result.metric_dimension_field$</set>
                <set token="metric_shortname">$result.metric_shortname$</set>
                <set token="metric_data_field">$result.metric_data_field$</set>
                <set token="metric_primary_statsmode">$result.metric_primary_statsmode$</set>
                <set token="metric_by">$result.metric_by$</set>
                <set token="metric_table_by">$result.metric_table_by$</set>
                <set token="metric_timechart_by">$result.metric_timechart_by$</set>
                <set token="metric_volume_unit_choice">$result.metric_volume_unit_choice$</set>
                <set token="metric_rate_unit_choice">$result.metric_rate_unit_choice$</set>
                <set token="form.chart">$result.metric_charting_chart$</set>
                <set token="form.chart.stackingmode">$result.metric_charting_stackmode$</set>
            </condition>
        </progress>
    </search>

    <!-- analyse if the metric has a device dimension -->

    <search id="basesearch_metric_device_mono" depends="$metric_mode_mono$">
        <query>| mcatalog values(_dims) as dimensions where `nmon_metrics_index` $metric_filter$ $host-prefilter$ $host$ $osfilter$
| mvexpand dimensions
| where (dimensions LIKE "dimension_%")</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
        <!-- Progress event has access to job properties only -->
        <progress>
            <condition match="'job.resultCount' == 0">
                <unset token="show_device"></unset>
            </condition>
            <condition>
                <set token="show_device">True</set>
                <set token="dimension">$result.dimensions$</set>
                <!-- If not unset here, the form using the metric_dimension_field will be set before the token
                is defined, and thus render an error
                -->
                <unset token="form.dimension_input_filter_mono_tk"></unset>
                <unset token="form.dimension_input_mono_tk"></unset>
            </condition>
        </progress>
    </search>

    <search id="basesearch_metric_device_multi" depends="$metric_mode_multi$">
        <query>| mcatalog values(_dims) as dimensions where `nmon_metrics_index` $metric_name_simple$ $host-prefilter$ $host$ $osfilter$
| mvexpand dimensions
| where (dimensions LIKE "dimension_%")</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
        <!-- Progress event has access to job properties only -->
        <progress>
            <condition match="'job.resultCount' == 0">
                <unset token="show_device"></unset>
            </condition>
            <condition>
                <set token="show_device">True</set>
                <set token="dimension_multi">$result.dimensions$</set>
                <!-- If not unset here, the form using the metric_dimension_field will be set before the token
                is defined, and thus render an error
                -->
                <unset token="form.dimension_input_filter_multi_tk"></unset>
                <unset token="form.dimension_input_multi_tk"></unset>
            </condition>
        </progress>
    </search>

    <!-- analyse if the metric has a volume unit choice option -->

    <search id="basesearch_metric_volume_unit" base="populate_metric_mono">
        <query>search metric_name=$metric_name$</query>
        <progress>
            <condition match="'result.metric_volume_unit_choice'==&quot;True&quot;">
                <set token="show_unit">True</set>
            </condition>
            <condition match="'result.metric_volume_unit_choice'==&quot;False&quot;">
                <unset token="show_unit"></unset>
            </condition>
        </progress>
    </search>

    <!-- analyse if the metric has a rate unit choice option -->

    <search id="basesearch_metric_rate_unit" base="populate_metric_mono">
        <query>search metric_name=$metric_name$</query>
        <progress>
            <condition match="'result.metric_rate_unit_choice'==&quot;True&quot;">
                <set token="show_unit_rate">True</set>
            </condition>
            <condition match="'result.metric_rate_unit_choice'==&quot;False&quot;">
                <unset token="show_unit_rate"></unset>
            </condition>
        </progress>
    </search>

    <!--
    time range related selection
    -->

    <row>

        <panel>
            <title>Select time period</title>

            <input type="time" token="timerange" searchWhenChanged="true">
                <label>Time Range:</label>
                <default>
                    <earliest>-24h</earliest>
                    <latest>now</latest>
                </default>
            </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>
        </panel>

    </row>

    <row>
        <panel>
            <title>Select the server(s):</title>

            <input type="dropdown" token="osfilter" searchWhenChanged="true">
                <label>Filter OS Type:</label>
                <default>*</default>
                <choice value="*">Any OS</choice>
                <choice value="AIX">AIX</choice>
                <choice value="Linux">Linux</choice>
                <choice value="Solaris">Solaris</choice>
                <prefix>OStype="</prefix>
                <suffix>"</suffix>
            </input>

            <input type="multiselect" token="frameID" searchWhenChanged="true">
                <label>frameID Selection:</label>
                <search base="populate_servers">
                    <query>stats count by frameID | fields frameID | dedup frameID | sort 0 frameID</query>
                </search>
                <initialValue>*</initialValue>
                <valuePrefix>frameID="</valuePrefix>
                <valueSuffix>"</valueSuffix>
                <delimiter> OR </delimiter>
                <fieldForLabel>frameID</fieldForLabel>
                <fieldForValue>frameID</fieldForValue>
                <choice value="*">ANY</choice>
            </input>

            <input type="text" token="host-prefilter" searchWhenChanged="true">
                <label>Optional: Filter hosts populating</label>
                <prefix>host="</prefix>
                <suffix>"</suffix>
                <default>*</default>
            </input>

            <input id="host" type="multiselect" token="host" searchWhenChanged="true">
                <label>hosts Selection:</label>
                <search base="populate_servers">
                    <query>search $frameID$ $host-prefilter$ | stats count by host | dedup host | sort 0 host</query>
                </search>
                <fieldForLabel>host</fieldForLabel>
                <fieldForValue>host</fieldForValue>
                <valuePrefix>host="</valuePrefix>
                <valueSuffix>"</valueSuffix>
                <delimiter> OR </delimiter>
                <choice value="*">ANY</choice>
                <change>
                    <condition>
                        <unset token="form.host_query_input"></unset>
                    </condition>
                </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_servers">
                    <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>

        </panel>

    </row>

    <!-- Help the user -->

    <row>
        <panel rejects="$host$">
            <html>
                <div class="red_help_user">
                    <p>- - - - - - - - - - ACTION REQUIRED: please select one or more servers in the host selector above - - - - - - - - - -</p>
                </div>
            </html>
        </panel>
    </row>

    <row>
        <panel>
            <title>Metric selection - which metric do you want to explore ?</title>

            <input token="metric_category" type="dropdown" searchWhenChanged="true">
                <label>METRIC CATEGORY:</label>
                <search base="populate_metric_mono">
                    <query>stats count by metric_category | sort 0 metric_category</query>
                </search>
                <choice value="*">ANY</choice>
                <default>*</default>
                <fieldForLabel>metric_category</fieldForLabel>
                <fieldForValue>metric_category</fieldForValue>
            </input>

            <input token="nmon_section" type="dropdown" searchWhenChanged="true">
                <label>NMON SECTION:</label>
                <search base="populate_metric_mono">
                    <query>search metric_category="$metric_category$" | stats count by nmon_section | sort 0 nmon_section</query>
                </search>
                <choice value="*">ANY</choice>
                <default>*</default>
                <fieldForLabel>nmon_section</fieldForLabel>
                <fieldForValue>nmon_section</fieldForValue>
            </input>

            <input token="metric_type_of_selection" type="dropdown" searchWhenChanged="true">
                <label>ASSISTANT METRICS MODE:</label>
                <default>mono_metrics</default>
                <choice value="mono_metrics">mono-metric with raw and calculated metrics</choice>
                <choice value="multi_metrics">multi-metrics with raw metrics</choice>
                <change>
                    <condition value="mono_metrics">
                        <set token="metric_mode_mono">true</set>
                        <unset token="metric_mode_multi"></unset>
                    </condition>
                    <condition value="multi_metrics">
                        <set token="metric_mode_multi">true</set>
                        <unset token="metric_mode_mono"></unset>
                    </condition>
                </change>
            </input>

            <!-- the metric_name dropdown size will be increased using css -->

            <input token="metric_type_of_calculation" depends="$metric_mode_mono$" type="dropdown" searchWhenChanged="true">
                <label>TYPE OF METRIC CALCULATION:</label>
                <search base="populate_metric_mono">
                    <query>search metric_category="$metric_category$" | stats count by metric_type_of_calculation | sort 0 metric_type_of_calculation</query>
                </search>
                <choice value="*">ANY</choice>
                <default>*</default>
                <fieldForLabel>metric_type_of_calculation</fieldForLabel>
                <fieldForValue>metric_type_of_calculation</fieldForValue>
            </input>

            <input id="metric_name" token="metric_name_simple" depends="$metric_mode_multi$" type="multiselect" searchWhenChanged="true">
                <label>PERFORMANCE METRIC:</label>
                <search base="populate_metric_simple_mode">
                    <query>search metric_category="$metric_category$" nmon_section="$nmon_section$" | table metric_name | sort 0 metric_name</query>
                </search>
                <valuePrefix>metric_name="</valuePrefix>
                <valueSuffix>"</valueSuffix>
                <delimiter> OR </delimiter>
                <fieldForLabel>metric_name</fieldForLabel>
                <fieldForValue>metric_name</fieldForValue>
            </input>

            <input id="metric_name2" token="metric_name" depends="$metric_mode_mono$" type="dropdown" searchWhenChanged="true">
                <label>PERFORMANCE METRIC:</label>
                <search base="populate_metric_mono">
                    <query>search metric_category="$metric_category$" nmon_section="$nmon_section$" metric_type_of_calculation="$metric_type_of_calculation$" | table metric_name | sort 0 metric_name</query>
                </search>
                <fieldForLabel>metric_name</fieldForLabel>
                <fieldForValue>metric_name</fieldForValue>
            </input>

            <html>
                <h4>
                    Quick help:
                    <div class="custom-modal">
                        <a data-modal-name="Help_modal_metric_assistant"> assistant mode</a>
                    </div>
                </h4>

                <!-- Modal -->
                <div class="modal custom-modal-60 fade" id="Help_modal_metric_assistant" tabindex="-1" role="dialog" aria-labelledby="Help_modal_Label">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"></span></button>
                                <div style="text-align: left;">
                                    <h4 class="modal-title" id="Help_modal_Label">Integrated Navigation:</h4>
                                </div>
                            </div>
                            <div class="modal-body">

                                <div style="text-align: center;">
                                    <img src="../../static/app/metricator-for-nmon/icons/dark_theme/info.png" alt="info"/>
                                    <h1>
                                        Quick help: metrics assistant mode
                                    </h1>

                                </div>

                                <div style="text-align: left;">

                                    <h1>The metric assistant mode dropdown provides 2 main options:</h1>

                                    <div class="list">
                                        <lu>
                                            <li><b>mono-metrics mode with raw and calculated metrics</b></li>
                                            <li><b>multi-raw metrics mode:</b></li>
                                        </lu>
                                    </div>

                                    <h1>mono-metrics mode:</h1>

                                    <b>The mono-metrics mode provides both raw metrics and pre-calculated advanced metrics with a mono selection behaviour:</b>

                                    <div class="list">
                                        <lu>
                                            <li>raw metrics are metrics natively available and generated on the servers, example: Wait percentage usage of CPU</li>
                                            <li>extended metrics are calculated metrics which are the combination of raw metrics with the appropriated calculation, example: global percentage usage of CPU</li>
                                            <li>extended metrics are sourced from the lookup nmon_metric_catalog hosted in the application</li>
                                            <li>when a metric has a notion of rate or volume, a unit choice is provided</li>
                                            <li>when available, dimensions are automatically selectable and used for group by statements</li>
                                        </lu>
                                    </div>

                                    <h1>multi-raw metrics mode:</h1>


                                    <b>The multi-metrics mode provides both raw metrics with a multi selection behaviour:</b>

                                    <div class="list">
                                        <lu>
                                            <li>raw metrics can be selected in a multi-selected behaviour</li>
                                            <li>when available, dimensions are automatically selectable and used for group by statements</li>
                                        </lu>
                                    </div>

                                </div>

                            </div>

                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                            </div>

                        </div>
                    </div>
                </div>

            </html>

        </panel>
    </row>

    <!-- Help the user -->

    <row depends="$host$ $metric_mode_mono$" rejects="$metric_name$">
        <panel>
            <html>
                <div class="red_help_user">
                    <p>- - - - - - - - - - ACTION REQUIRED: please select the performance metric to be explored in the metric selector above - - - - - - - - - -</p>
                </div>
            </html>
        </panel>
    </row>

    <row depends="$host$ $metric_mode_multi$" rejects="$metric_name_simple$">
        <panel>
            <html>
                <div class="red_help_user">
                    <p>- - - - - - - - - - ACTION REQUIRED: please select the performance metric to be explored in the metric selector above - - - - - - - - - -</p>
                </div>
            </html>
        </panel>
    </row>

    <!--

    Base searches for KPIs single forms

    -->

    <search id="KPIs" depends="$metric_mode_mono$">
        <query>| mstats $metric_primary_statsmode$(_value) as value where `nmon_metrics_index` $metric_filter$ $host-prefilter$ $host_query$ by $metric_by$ span=1m
| $metric_calculation$
| `$timefilter$`
| stats avg($metric_data_field$) as avg, median($metric_data_field$) as median, max($metric_data_field$) as max</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
    </search>

    <search id="KPIs_device" depends="$metric_mode_mono$ $show_device$">
        <query>| mstats $metric_primary_statsmode$(_value) as value where `nmon_metrics_index` $metric_filter$ $host-prefilter$ $host_query$ $dimension_input_filter_mono_tk$ by $metric_by$ span=1m
| $metric_calculation$
| `$timefilter$`
| eval storage_metric_unit="$storage_metric_unit$", metric_volume_unit_choice="$metric_volume_unit_choice$"
| eval rate_metric_unit="$rate_metric_unit$", metric_rate_unit_choice="$metric_rate_unit_choice$"
| eval $metric_data_field$=case(metric_volume_unit_choice=="True" AND storage_metric_unit=="MB", $metric_data_field$/1024, metric_volume_unit_choice=="True" AND storage_metric_unit=="GB", $metric_data_field$/1024/1024, metric_volume_unit_choice=="True" AND storage_metric_unit=="TB", $metric_data_field$/1024/1024/1024, metric_volume_unit_choice=="False", $metric_data_field$)
| eval $metric_data_field$=case(metric_rate_unit_choice=="True" AND rate_metric_unit=="KBps", $metric_data_field$, metric_rate_unit_choice=="True" AND rate_metric_unit=="MBps", $metric_data_field$/1000, metric_rate_unit_choice=="True" AND rate_metric_unit=="GBps", $metric_data_field$/1000/1000, metric_rate_unit_choice=="False", $metric_data_field$)
| stats avg($metric_data_field$) as avg, median($metric_data_field$) as median, max($metric_data_field$) as max</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
    </search>

    <!--

    Dimensions definition

    -->

    <row depends="$show_device$">
        <panel>

            <input type="multiselect" token="dimension_input_filter_mono_tk" searchWhenChanged="true" depends="$metric_mode_mono$">
                <label>FILTER BY DIMENSION:</label>
                <search depends="$metric_mode_mono$">
                    <query>| mcatalog values($metric_dimension_field$) as $metric_dimension_field$_values where `nmon_metrics_index` $metric_filter$ $host_query$
| rename $metric_dimension_field$_values as $metric_dimension_field$
| mvexpand $metric_dimension_field$ | dedup $metric_dimension_field$ | sort 0 $metric_dimension_field$</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </search>
                <initialValue>*</initialValue>
                <valuePrefix>$metric_dimension_field$=</valuePrefix>
                <delimiter> OR </delimiter>
                <choice value="*">ANY</choice>
                <fieldForLabel>$metric_dimension_field$</fieldForLabel>
                <fieldForValue>$metric_dimension_field$</fieldForValue>
            </input>

            <input token="dimension_input_mono_tk" depends="$show_device$ $metric_mode_mono$" type="dropdown" searchWhenChanged="true">
                <label>GROUP BY DIMENSION:</label>
                <search base="basesearch_metric_device_mono">
                    <query></query>
                </search>
                <selectFirstChoice>true</selectFirstChoice>
                <fieldForLabel>dimensions</fieldForLabel>
                <fieldForValue>dimensions</fieldForValue>
            </input>

            <input type="multiselect" token="dimension_input_filter_multi_tk" searchWhenChanged="true" depends="$metric_mode_multi$">
                <label>FILTER BY DIMENSION:</label>
                <search depends="$metric_mode_multi$">
                    <query>| mcatalog values($dimension_multi$) as $dimension_multi$_values where `nmon_metrics_index` $metric_name_simple$ $host_query$
| rename $dimension_multi$_values as $dimension_multi$
| mvexpand $dimension_multi$ | dedup $dimension_multi$ | sort 0 $dimension_multi$</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </search>
                <initialValue>*</initialValue>
                <valuePrefix>$dimension_multi$=</valuePrefix>
                <delimiter> OR </delimiter>
                <choice value="*">ANY</choice>
                <fieldForLabel>$dimension_multi$</fieldForLabel>
                <fieldForValue>$dimension_multi$</fieldForValue>
            </input>

            <input token="dimension_input_multi_tk" depends="$metric_mode_multi$" type="dropdown" searchWhenChanged="true">
                <label>GROUP BY DIMENSION:</label>
                <search base="basesearch_metric_device_multi">
                    <query></query>
                </search>
                <selectFirstChoice>true</selectFirstChoice>
                <fieldForLabel>dimensions</fieldForLabel>
                <fieldForValue>dimensions</fieldForValue>
            </input>

        </panel>
    </row>

    <!--

    mono-metric modes

    -->

    <row depends="$metric_mode_mono$">
        <panel>
            <title>main KPIs results</title>

            <html depends="$metric_name$">
                <div style="font-size: 18px; margin: 10px 0; font-weight: bold; text-align: center; color: black;">
                    <p>
                        <span style="color: #aec6cf; font-size: 200%;">$metric_name$</span>
                    </p>
                </div>
            </html>

            <single rejects="$show_device$">
                <search base="KPIs">
                    <query>fields avg</query>
                </search>
                <option name="drilldown">none</option>
                <option name="field">value</option>
                <option name="underLabel">Average $metric_shortname$</option>
                <option name="numberPrecision">0.00</option>
            </single>

            <single rejects="$show_device$">
                <search base="KPIs">
                    <query>fields median</query>
                </search>
                <option name="drilldown">none</option>
                <option name="field">value</option>
                <option name="underLabel">Median $metric_shortname$</option>
                <option name="numberPrecision">0.00</option>
            </single>

            <single rejects="$show_device$">
                <search base="KPIs">
                    <query>fields max</query>
                </search>
                <option name="drilldown">none</option>
                <option name="field">value</option>
                <option name="underLabel">Max $metric_shortname$</option>
                <option name="numberPrecision">0.00</option>
            </single>

            <single depends="$show_device$">
                <search base="KPIs_device">
                    <query>fields avg</query>
                </search>
                <option name="drilldown">none</option>
                <option name="field">value</option>
                <option name="underLabel">Average $metric_shortname$</option>
                <option name="numberPrecision">0.00</option>
            </single>

            <single depends="$show_device$">
                <search base="KPIs_device">
                    <query>fields median</query>
                </search>
                <option name="drilldown">none</option>
                <option name="field">value</option>
                <option name="underLabel">Median $metric_shortname$</option>
                <option name="numberPrecision">0.00</option>
            </single>

            <single depends="$show_device$">
                <search base="KPIs_device">
                    <query>fields max</query>
                </search>
                <option name="drilldown">none</option>
                <option name="field">value</option>
                <option name="underLabel">Max $metric_shortname$</option>
                <option name="numberPrecision">0.00</option>
            </single>

            <table rejects="$show_device$">
                <search rejects="$show_device$" depends="$metric_mode_mono$">
                    <query>| mstats $metric_primary_statsmode$(_value) as value where `nmon_metrics_index` $metric_filter$ $host-prefilter$ $host_query$ by $metric_by$ span=1m
| $metric_calculation$
| `$timefilter$`
| chart min($metric_data_field$) As min_$metric_data_field$ avg($metric_data_field$) As avg_$metric_data_field$ median($metric_data_field$) As median_$metric_data_field$ max($metric_data_field$) As max_$metric_data_field$ sparkline(avg($metric_data_field$),) As sparkline by $metric_table_by$
| foreach *_$metric_data_field$ [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;', 3) ]</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="wrap">true</option>
                <option name="rowNumbers">false</option>
                <option name="dataOverlayMode">none</option>
                <option name="drilldown">row</option>
                <option name="count">10</option>
                <option name="refresh.display">none</option>
                <option name="percentagesRow">false</option>
                <format type="sparkline" field="sparkline">
                    <option name="lineColor">#5379af</option>
                    <option name="fillColor">#CCDDFF</option>
                    <option name="lineWidth">1</option>
                    <option name="height">25</option>
                </format>
            </table>

            <input type="dropdown" token="storage_unit" depends="$metric_mode_mono$ $show_device$ $show_unit$">
                <label>Unit:</label>
                <choice value="MB">MB</choice>
                <choice value="GB">GB</choice>
                <choice value="TB">TB</choice>
                <default>GB</default>
                <change>
                    <condition value="MB">
                        <set token="metric_math">value</set>
                        <set token="storage_metric_unit">MB</set>
                    </condition>
                    <condition value="GB">
                        <set token="metric_math">value/1024</set>
                        <set token="storage_metric_unit">GB</set>
                    </condition>
                    <condition value="TB">
                        <set token="metric_math">value/1024/1204</set>
                        <set token="storage_metric_unit">TB</set>
                    </condition>
                    <condition value="pct">
                        <set token="metric_math">value</set>
                        <set token="storage_metric_unit">pct</set>
                    </condition>
                </change>
            </input>

            <input type="dropdown" token="rate_unit" depends="$metric_mode_mono$ $show_device$ $show_unit_rate$">
                <label>Unit:</label>
                <choice value="KBps">KBps</choice>
                <choice value="MBps">MBps</choice>
                <choice value="GBps">GBps</choice>
                <default>KBps</default>
                <change>
                    <condition value="KBps">
                        <set token="metric_math">value</set>
                        <set token="rate_metric_unit">KBps</set>
                    </condition>
                    <condition value="MBps">
                        <set token="metric_math">value/1000</set>
                        <set token="rate_metric_unit">MBps</set>
                    </condition>
                    <condition value="GBps">
                        <set token="metric_math">value/1000/1000</set>
                        <set token="rate_metric_unit">GBps</set>
                    </condition>
                </change>
            </input>

            <table depends="$metric_mode_mono$ $show_device$">
                <search depends="$metric_mode_mono$ $show_device$">
                    <query>| mstats $metric_primary_statsmode$(_value) as value where `nmon_metrics_index` $metric_filter$ $host-prefilter$ $host_query$ $dimension_input_filter_mono_tk$ by host metric_name $dimension_input_mono_tk$ span=1m
| $metric_calculation$
| `$timefilter$`
| eval storage_metric_unit="$storage_metric_unit$", metric_volume_unit_choice="$metric_volume_unit_choice$"
| eval rate_metric_unit="$rate_metric_unit$", metric_rate_unit_choice="$metric_rate_unit_choice$"
| eval $metric_data_field$=case(metric_volume_unit_choice=="True" AND storage_metric_unit=="MB", $metric_data_field$/1024, metric_volume_unit_choice=="True" AND storage_metric_unit=="GB", $metric_data_field$/1024/1024, metric_volume_unit_choice=="True" AND storage_metric_unit=="TB", $metric_data_field$/1024/1024/1024, metric_volume_unit_choice=="False", $metric_data_field$)
| eval $metric_data_field$=case(metric_rate_unit_choice=="True" AND rate_metric_unit=="KBps", $metric_data_field$, metric_rate_unit_choice=="True" AND rate_metric_unit=="MBps", $metric_data_field$/1000, metric_rate_unit_choice=="True" AND rate_metric_unit=="GBps", $metric_data_field$/1000/1000, metric_rate_unit_choice=="False", $metric_data_field$)
| stats min($metric_data_field$) As min_$metric_data_field$ avg($metric_data_field$) As avg_$metric_data_field$ median($metric_data_field$) As median_$metric_data_field$ max($metric_data_field$) As max_$metric_data_field$ sparkline(avg($metric_data_field$),) As sparkline by host $dimension_input_mono_tk$
| foreach *_$metric_data_field$ [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;', 3) ]</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="wrap">true</option>
                <option name="rowNumbers">false</option>
                <option name="dataOverlayMode">none</option>
                <option name="drilldown">row</option>
                <option name="count">10</option>
                <option name="refresh.display">none</option>
                <option name="percentagesRow">false</option>
                <format type="sparkline" field="sparkline">
                    <option name="lineColor">#5379af</option>
                    <option name="fillColor">#CCDDFF</option>
                    <option name="lineWidth">1</option>
                    <option name="height">25</option>
                </format>
            </table>

        </panel>

    </row>

    <!--

    multi-metric modes

    -->

    <row depends="$metric_mode_multi$">
        <panel>

            <title>multi-metrics results</title>

            <input type="dropdown" token="statsmode" searchWhenChanged="true" depends="$show_device$">
                <label>Statistic mode:</label>
                <default>avg</default>
                <choice value="max">Max</choice>
                <choice value="avg">Avg</choice>
                <choice value="min">Min</choice>
                <choice value="median">Median</choice>
                <choice value="mode">Mode</choice>
                <choice value="range">Range</choice>
            </input>

            <table depends="$metric_mode_multi$ $show_device$">
                <search depends="$metric_mode_multi$ $show_device$">
                    <query>| mstats $statsmode$(_value) as value where `nmon_metrics_index` $metric_name_simple$ $host-prefilter$ $host_query$ $dimension_input_filter_multi_tk$ by host metric_name $dimension_input_multi_tk$ span=1m
| `$timefilter$`
| rex field="metric_name" "os\.unix\.nmon\.\w*\.(?&lt;nmon_section&gt;\w*)\.(?&lt;metric_shortname&gt;\w*)"
| rex field="metric_name" "os\.unix\.nmon\.(?&lt;nmon_section&gt;\w*)\.(?&lt;metric_shortname&gt;\w*)$"
| eval key=nmon_section . ":" . metric_shortname . ":" . $dimension_input_multi_tk$
| stats min(value) As min_value avg(value) As avg_value median(value) As median_value max(value) As max_value sparkline(avg(value),) As sparkline by host, key
| foreach *_value [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;', 3) ]</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="wrap">true</option>
                <option name="rowNumbers">false</option>
                <option name="dataOverlayMode">none</option>
                <option name="drilldown">row</option>
                <option name="count">10</option>
                <option name="refresh.display">none</option>
                <option name="percentagesRow">false</option>
                <format type="sparkline" field="sparkline">
                    <option name="lineColor">#5379af</option>
                    <option name="fillColor">#CCDDFF</option>
                    <option name="lineWidth">1</option>
                    <option name="height">25</option>
                </format>
            </table>

            <table depends="$metric_mode_multi$" rejects="$show_device$">
                <search depends="$metric_mode_multi$" rejects="$show_device$">
                    <query>| mstats $statsmode$(_value) as value where `nmon_metrics_index` $metric_name_simple$ $host-prefilter$ $host_query$ by host metric_name span=1m
| `$timefilter$`
| rex field="metric_name" "os\.unix\.nmon\.\w*\.(?&lt;nmon_section&gt;\w*)\.(?&lt;metric_shortname&gt;\w*)"
| rex field="metric_name" "os\.unix\.nmon\.(?&lt;nmon_section&gt;\w*)\.(?&lt;metric_shortname&gt;\w*)$"
| eval key=nmon_section . ":" . metric_shortname
| chart limit=0 useother=f $statsmode$(value) As value sparkline(avg(value),) As sparkline by host, key
| foreach value* [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;', 3) ]</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="wrap">true</option>
                <option name="rowNumbers">false</option>
                <option name="dataOverlayMode">none</option>
                <option name="drilldown">row</option>
                <option name="count">10</option>
                <option name="refresh.display">none</option>
                <option name="percentagesRow">false</option>
                <format type="sparkline" field="sparkline">
                    <option name="lineColor">#5379af</option>
                    <option name="fillColor">#CCDDFF</option>
                    <option name="lineWidth">1</option>
                    <option name="height">25</option>
                </format>
            </table>

        </panel>
    </row>

    <!--

    Charting parameters

    -->

    <row depends="$chartactivate$">
        <panel>
            <title>Charting parameters</title>
            <input type="dropdown" token="chart" searchWhenChanged="true">
                <label>Select a 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="chart.stackingmode" searchWhenChanged="true">
                <label>Select a stacking mode:</label>
                <default>unstacked</default>
                <choice value="stacked">stacked (lines excluded)</choice>
                <choice value="stacked100">100% stacked (lines excluded)</choice>
                <choice value="unstacked">unstacked</choice>
            </input>
            <input type="dropdown" token="charting.legend.placement" searchWhenChanged="true">
                <label>Legend placement:</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>
            <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>
        </panel>
    </row>

    <!--

    Charting Servers

    -->

    <row>
        <panel>
            <title>Metrics rendering</title>

            <!--

            charting rendering settings

            -->

            <input type="dropdown" token="storage_unit" depends="$metric_mode_mono$ $show_device$ $show_unit$">
                <label>Unit:</label>
                <choice value="MB">MB</choice>
                <choice value="GB">GB</choice>
                <choice value="TB">TB</choice>
                <default>GB</default>
                <change>
                    <condition value="MB">
                        <set token="metric_math">value</set>
                        <set token="storage_metric_unit">MB</set>
                    </condition>
                    <condition value="GB">
                        <set token="metric_math">value/1024</set>
                        <set token="storage_metric_unit">GB</set>
                    </condition>
                    <condition value="TB">
                        <set token="metric_math">value/1024/1204</set>
                        <set token="storage_metric_unit">TB</set>
                    </condition>
                    <condition value="pct">
                        <set token="metric_math">value</set>
                        <set token="storage_metric_unit">pct</set>
                    </condition>
                </change>
            </input>

            <input type="dropdown" token="rate_unit" depends="$metric_mode_mono$ $show_device$ $show_unit_rate$">
                <label>Unit:</label>
                <choice value="KBps">KBps</choice>
                <choice value="MBps">MBps</choice>
                <choice value="GBps">GBps</choice>
                <default>KBps</default>
                <change>
                    <condition value="KBps">
                        <set token="metric_math">value</set>
                        <set token="rate_metric_unit">KBps</set>
                    </condition>
                    <condition value="MBps">
                        <set token="metric_math">value/1000</set>
                        <set token="rate_metric_unit">MBps</set>
                    </condition>
                    <condition value="GBps">
                        <set token="metric_math">value/1000/1000</set>
                        <set token="rate_metric_unit">GBps</set>
                    </condition>
                </change>
            </input>

            <input type="dropdown" token="statsmode" searchWhenChanged="true">
                <label>Statistic mode:</label>
                <default>avg</default>
                <choice value="max">Max</choice>
                <choice value="avg">Avg</choice>
                <choice value="min">Min</choice>
                <choice value="median">Median</choice>
                <choice value="mode">Mode</choice>
                <choice value="range">Range</choice>
            </input>

            <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="dropdown" token="chart_settings" searchWhenChanged="true">
                <label></label>
                <choice value="0">Show charting parameters</choice>
                <choice value="1">Hide charting parameters</choice>
                <default>1</default>
                <change>
                    <condition value="0">
                        <set token="chart_customize">True</set>
                    </condition>
                    <condition value="1">
                        <unset token="chart_customize"></unset>
                    </condition>
                </change>
            </input>

            <input type="dropdown" token="chart" depends="$chart_customize$" searchWhenChanged="true">
                <label>Select a 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" depends="$chart_customize$" 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="chart.stackingmode" depends="$chart_customize$" searchWhenChanged="true">
                <label>Select a stacking mode:</label>
                <default>unstacked</default>
                <choice value="stacked">stacked (lines excluded)</choice>
                <choice value="stacked100">100% stacked (lines excluded)</choice>
                <choice value="unstacked">unstacked</choice>
            </input>

            <input type="dropdown" token="charting.legend.placement" depends="$chart_customize$" searchWhenChanged="true">
                <label>Legend placement:</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>

            <input type="checkbox" token="chart_min_scale" depends="$chart_customize$" searchWhenChanged="true">
                <label></label>
                <initialValue>0</initialValue>
                <choice value="0">Starts scale at 0</choice>
            </input>

            <input type="checkbox" token="chart_max_scale" depends="$chart_customize$" searchWhenChanged="true">
                <label></label>
                <choice value="101">Max scale at 100</choice>
            </input>

            <!--

            mono-metric mode

            -->

            <chart rejects="$show_device$" depends="$metric_mode_mono$">
                <search rejects="$show_device$" depends="$metric_mode_mono$">
                    <query>| mstats $metric_primary_statsmode$(_value) as value where `nmon_metrics_index` $metric_filter$ $host-prefilter$ $host_query$ by $metric_by$ span=1m
| $metric_calculation$
| `$timefilter$`
| timechart $span$ limit=0 useother=f $statsmode$($metric_data_field$) As $metric_shortname$ by $metric_timechart_by$</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </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">$chart.stackingmode$</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">680</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisTitleY.text">$metric_shortname$</option>
                <option name="charting.axisY.minimumNumber">$chart_min_scale$</option>
                <option name="charting.axisY.maximumNumber">$chart_max_scale$</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>
            </chart>

            <chart depends="$metric_mode_mono$ $show_device$">
                <search depends="$metric_mode_mono$ $show_device$">
                    <query>| mstats $metric_primary_statsmode$(_value) as value where `nmon_metrics_index` $metric_filter$ $host-prefilter$ $host_query$ $dimension_input_filter_mono_tk$ by host metric_name $dimension_input_mono_tk$ span=1m
| $metric_calculation$
| `$timefilter$`
| eval storage_metric_unit="$storage_metric_unit$", metric_volume_unit_choice="$metric_volume_unit_choice$"
| eval rate_metric_unit="$rate_metric_unit$", metric_rate_unit_choice="$metric_rate_unit_choice$"
| eval $metric_data_field$=case(metric_volume_unit_choice=="True" AND storage_metric_unit=="MB", $metric_data_field$/1024, metric_volume_unit_choice=="True" AND storage_metric_unit=="GB", $metric_data_field$/1024/1024, metric_volume_unit_choice=="True" AND storage_metric_unit=="TB", $metric_data_field$/1024/1024/1024, metric_volume_unit_choice=="False", $metric_data_field$)
| eval $metric_data_field$=case(metric_rate_unit_choice=="True" AND rate_metric_unit=="KBps", $metric_data_field$, metric_rate_unit_choice=="True" AND rate_metric_unit=="MBps", $metric_data_field$/1000, metric_rate_unit_choice=="True" AND rate_metric_unit=="GBps", $metric_data_field$/1000/1000, metric_rate_unit_choice=="False", $metric_data_field$)
| rex field="metric_name" "os\.unix\.nmon\.\w*\.\w*\.(?&lt;metric_shortname&gt;\w*)"
| rex field="metric_name" "os\.unix\.nmon\.\w*\.(?&lt;metric_shortname&gt;\w*)$"
| eval key = host . ":" . metric_shortname . ":" . $dimension_input_mono_tk$
| timechart $span$ limit=0 useother=f $statsmode$($metric_data_field$) As $metric_shortname$ by key</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </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">$chart.stackingmode$</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">680</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisTitleY.text">$metric_shortname$</option>
                <option name="charting.axisY.minimumNumber">$chart_min_scale$</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>
            </chart>

            <!--

            multi-metric modes

            -->

            <chart depends="$metric_mode_multi$" rejects="$show_device$">
                <search depends="$metric_mode_multi$" rejects="$show_device$">
                    <query>| mstats $statsmode$(_value) as value where `nmon_metrics_index` $metric_name_simple$ $host-prefilter$ $host_query$ by host metric_name span=1m
| `$timefilter$`
| rex field="metric_name" "os\.unix\.nmon\.\w*\.\w*\.(?&lt;metric_shortname&gt;\w*)"
| rex field="metric_name" "os\.unix\.nmon\.\w*\.(?&lt;metric_shortname&gt;\w*)$"
| eval key = host . ":" . metric_shortname
| timechart $span$ limit=0 useother=f $statsmode$(value) As value by key</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </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">$chart.stackingmode$</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">680</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisY.minimumNumber">$chart_min_scale$</option>
                <option name="charting.axisY.maximumNumber">$chart_max_scale$</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>
            </chart>

            <chart depends="$metric_mode_multi$ $show_device$">
                <search depends="$metric_mode_multi$ $show_device$">
                    <query>| mstats $statsmode$(_value) as value where `nmon_metrics_index` $metric_name_simple$ $host-prefilter$ $host_query$ $dimension_input_filter_multi_tk$ by host metric_name $dimension_input_multi_tk$ span=1m
| `$timefilter$`
| rex field="metric_name" "os\.unix\.nmon\.\w*\.\w*\.(?&lt;metric_shortname&gt;\w*)"
| rex field="metric_name" "os\.unix\.nmon\.\w*\.(?&lt;metric_shortname&gt;\w*)$"
| eval key = host . ":" . metric_shortname . ":" . $dimension_input_multi_tk$
| timechart $span$ limit=0 useother=f $statsmode$(value) As value by key</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </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">$chart.stackingmode$</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">680</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisY.minimumNumber">$chart_min_scale$</option>
                <option name="charting.axisY.maximumNumber">$chart_max_scale$</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>
            </chart>

        </panel>

    </row>

</form>
