<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How DBX decides dbmon interval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-DBX-decides-dbmon-interval/m-p/102602#M182998</link>
    <description>&lt;P&gt;Super late response but I thought I would post the answer as I was looking for the exact same information.&lt;/P&gt;

&lt;P&gt;The only answer I could find was&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;auto - The scheduler automatically chooses an interval based on the number of generated results.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Ref: &lt;A href="http://docs.splunk.com/Documentation/DBX/1.2.0/DeployDBX/inputsspec"&gt;http://docs.splunk.com/Documentation/DBX/1.2.0/DeployDBX/inputsspec&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I had a dig through the DatamaseMonitor.class in the dbx.jar which lead me to Scheduler.class which led me to this function which determines the time&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    private long getAutoDelay(DbmonResult result) {
        if (result.getResultCount() == 0) {
            long lastDelay = result.getMonitorDefintion().getLastDelay();
            if (lastDelay != -1) {
                return Math.max(this.autoMinDelay, Math.min(lastDelay + this.autoDecayIncrement, this.autoMaxDelay));
            }
            return this.autoMaxDelay;
        }
        return Math.min(Math.max(this.autoMinDelay, result.getDuration() / (long)result.getResultCount() * (long)this.autoDurationFactor), this.autoMaxDelay);
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this.autoMinDelay defaults to 5000&lt;BR /&gt;
this.autoMaxDelay defaults to 5000&lt;BR /&gt;
this.autoDecayIncrement defaults to 5000&lt;BR /&gt;
this.autoDurationFactor defaults to 100&lt;/P&gt;

&lt;P&gt;So it appears to be related to the number of factors such as &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Number of results returned&lt;/LI&gt;
&lt;LI&gt;How long the last delay was between queries&lt;/LI&gt;
&lt;LI&gt;How long the search took to run&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;So for a search that returned zero results the delay appears to be every 5000ms&lt;BR /&gt;
For a search with more than zero results it is based on this function          &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;return Math.min(Math.max(this.autoMinDelay, result.getDuration() / (long)result.getResultCount() * (long)this.autoDurationFactor), this.autoMaxDelay);&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2016 01:56:15 GMT</pubDate>
    <dc:creator>phoenixdigital</dc:creator>
    <dc:date>2016-06-16T01:56:15Z</dc:date>
    <item>
      <title>How DBX decides dbmon interval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-DBX-decides-dbmon-interval/m-p/102601#M182997</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am using DB Connect to pull data from my DB.&lt;BR /&gt;
I had configured dbmon interval manually (interval = 30s, for example).&lt;BR /&gt;
However, DBX can adjust interval automatically. (interval = auto) &lt;/P&gt;

&lt;P&gt;My question is, how DBX is deciding and adjusting the interval for dbmon.&lt;/P&gt;

&lt;P&gt;Could anyone comment and hopefully provide information in detail?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2013 08:12:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-DBX-decides-dbmon-interval/m-p/102601#M182997</guid>
      <dc:creator>melonman</dc:creator>
      <dc:date>2013-04-22T08:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: How DBX decides dbmon interval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-DBX-decides-dbmon-interval/m-p/102602#M182998</link>
      <description>&lt;P&gt;Super late response but I thought I would post the answer as I was looking for the exact same information.&lt;/P&gt;

&lt;P&gt;The only answer I could find was&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;auto - The scheduler automatically chooses an interval based on the number of generated results.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Ref: &lt;A href="http://docs.splunk.com/Documentation/DBX/1.2.0/DeployDBX/inputsspec"&gt;http://docs.splunk.com/Documentation/DBX/1.2.0/DeployDBX/inputsspec&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I had a dig through the DatamaseMonitor.class in the dbx.jar which lead me to Scheduler.class which led me to this function which determines the time&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    private long getAutoDelay(DbmonResult result) {
        if (result.getResultCount() == 0) {
            long lastDelay = result.getMonitorDefintion().getLastDelay();
            if (lastDelay != -1) {
                return Math.max(this.autoMinDelay, Math.min(lastDelay + this.autoDecayIncrement, this.autoMaxDelay));
            }
            return this.autoMaxDelay;
        }
        return Math.min(Math.max(this.autoMinDelay, result.getDuration() / (long)result.getResultCount() * (long)this.autoDurationFactor), this.autoMaxDelay);
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this.autoMinDelay defaults to 5000&lt;BR /&gt;
this.autoMaxDelay defaults to 5000&lt;BR /&gt;
this.autoDecayIncrement defaults to 5000&lt;BR /&gt;
this.autoDurationFactor defaults to 100&lt;/P&gt;

&lt;P&gt;So it appears to be related to the number of factors such as &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Number of results returned&lt;/LI&gt;
&lt;LI&gt;How long the last delay was between queries&lt;/LI&gt;
&lt;LI&gt;How long the search took to run&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;So for a search that returned zero results the delay appears to be every 5000ms&lt;BR /&gt;
For a search with more than zero results it is based on this function          &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;return Math.min(Math.max(this.autoMinDelay, result.getDuration() / (long)result.getResultCount() * (long)this.autoDurationFactor), this.autoMaxDelay);&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:56:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-DBX-decides-dbmon-interval/m-p/102602#M182998</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2016-06-16T01:56:15Z</dc:date>
    </item>
  </channel>
</rss>

