1 6000122863 2015-09-03T12:24:18-04:00 6000191056 false Circonus Analytics Query Language (CAQL) 1 2015-09-03T12:24:18-04:00 1 1 2015-09-03T12:34:05-04:00 0 2 Circonus Analytics Query Language (CAQL) - Tutorial   Circonus has been offering a variety of powerful analytics tools as graph overlays for a while. With CAQL, we go one step further and give our users the flexibility to build customized analytics tailored for their needs. CAQL allows the user to formulate queries for complex transformations of collected data that can be used for graphing (and alerting, coming soon). Moreover, it exposes previously hidden parameters to allow more fine-tuning than ever before. Behind the scenes, CAQL expressions are compiled into a tree of processing units that process a stream of data in a push based computation model and maintain a state. This video provides a helpful introduction to using CAQL, which you can follow along. You can also get started with the written examples provided below. Getting Started To create your first CAQL statement, create a new graph and select "CAQL Statement" from the "Add Datapoint" menu. Expand the legend bar to see the CAQL input field. Clicking in the input field will bring up a tooltip that shows some of the most used CAQL functions. The first thing we have to do is add a metric data source. This is accomplished using the "metric" statement:     metric:<kind>(<checkuuid>, <metricname>) This requires you to input the metric kind (e.g. "average"), the uuid of the check, and the metric name. You can find this information on the check details page. An easier way to enter this information is using the tooltip: In the metric f(x) row, click the kind of metric you want to add. Double click on <checkuuid> to get a search box for the available checks. Type a key word, press enter, and select a corresponding check. The corresponding check uuid will be filled in. Double click on <metricname> to get a dropdown menu with the available metrics for this check: Congratulations, you have just entered your first complete CAQL statement! When the focus leaves the input field, the values for the selected metric should show up in the graph. If something went wrong, the UI will show an error message hinting at the source of the problem. Now, let’s look at some examples of some common scenarios, and how we can use the features of CAQL in those situations. Example 1: Peek latency over the last hour Let's say we are measuring the round trip time (rtt) of a DNS server, and we are interested in the peek rrt we've seen in the last hour. You can compute this value using CAQL as follows:        metric:average(<checkuuid>, "rtt") | rolling:max(1h) The screenshot below shows a graph with the original values and the computed maximum. Click the screenshot to view an interactive example: Let's break that down: metric:average(<checkuuid>, "rtt") -- This creates a stream of values of DNS rtts | -- The pipe character takes the output of metric and passes it as input to further processing units. rolling:max(1h) -- This function creates a processing unit, that computes the maximum value over a rolling window of 1h. You can supply arbitrary durations (e.g. `2h 3M`) as arguments to this function. The rolling:max(<duration>) function has a cousin, window:max(<duration>), that computes the maximum over the last fully completed window. A full list of all available functions in CAQL can be found in the user manual. Example 2: Working with Histograms With CAQL, it is possible to display properties of histograms that were not available in the UI before. Use this syntax:       metric:histogram(<checkuuid>, <metricname>)  This creates a stream of histogram values. (The histogram itself will not show in the UI.) The screenshot below shows a histogram of request latencies with the following transforms applied to it: histogram:mean() -- the mean value of the histogram (shown below in green) histogram:IQR() -- to inter-quartile-range (shown below in red) histogram:rate() -- the number of samples per second (shown below in blue) The last graph has furthermore been smoothed by applying a rolling mean. Example 3: Finding anomalies in low-frequency data   Performing anomaly detection on low-frequency data is challenging. The graph below shows the web request rate of a web server, which is mostly idle. The normal state of this metric is a flat 0, so any activity would be an anomaly for this metric.   The solution is to use windowed smoothing to identify a sensible “normal” state. The graph below shows the same data as above in green, a 12h rolling mean has been added in blue, and the anomaly score of the smoothed data is appears in red. The result is a more practical interpretation of where our anomalies are to be found.     This graph was produced with this query:   metric:counter('586d9436-27fa-4567-a6b9-cecaf49228e7','mobile`FRONTEND`req_tot') | rolling:mean(12h) | anomaly_detection(60)   Let’s break that down:   rolling:mean(12h) -- This is a processing unit that takes in data over one hour, and calculates the average. anomaly_detection(60) -- This processing unit detects anomalies with the specified sensitivity. The sensitivity value can be set between 0 and 100. Example 4: Monitoring uptime   In this example, let’s say we are monitoring uptime over the past day in order to verify an availability SLA. This will depend on our ability to account for missing data points, so we can use the following CAQL statement:   metric:<> | is_missing() | rolling:mean(1d)   Filling in the appropriate check uuid and metric name, this statement produces the following graph: Let’s break down this formula. We’re already familiar with the source metric:<> and the rolling:mean.   ismissing() -- This processing unit returns 1 if there is a missing datapoint in the preceding data, and returns a 0 otherwise.   So this CAQL statement identifies the missing data in the selected metric. In this example, we simply add "100 - (" to the front of the CAQL statement and ") * 100" to the back, and we have our uptime report, with the graph measuring availability over the past day.   Example 5: Monitoring the ratio between two data-points with a delay   Monitoring ratio between two data-points when one is delayed is accomplished with a relatively simply query of the form:   metric:<A> / (metric:<B> | delay(1d)) Let’s plug in some metrics and look at an example graph: Let’s breakdown this down.   delay -- This processing unit delays the stream by the specified number of samples.   The delay function supports duration literals. Internally we translate a duration to the number of samples within that duration, but you can use h, m, and s to specify hours, minutes, and seconds. For example, “1d” = 1 day, which is translated to the corresponding number of seconds / samples (“1d” is equivalent to “1440” samples).   Warning: Regarding the duration syntax, the units have to directly follow the number, without spaces. For example “5 M” is not supported, but “5m” is supported. Package CAQL - Functions   A table listing CAQL functions is maintained in the Circonus user manual. <p style="text-align: center;"><span style="font-family: 'Trebuchet MS'; font-size: 21.3333333333333px; color: rgb(0, 0, 0); line-height: 42.9000015258789px;">Circonus Analytics Query Language (CAQL) - Tutorial</span><br></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">Circonus has been offering </span></span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;">a variety of powerful analytics tools as </span><span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">graph overlays for a while. </span></span><font color="#000000" face="Arial"><span style="font-size: 14.6667px;">With CAQL, we go one step further and give our users the flexibility to build customized analytics tailored for their needs. </span></font><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;">CAQL allows the user to formulate queries for complex transformations of collected data that can be used for graphing (and </span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;">alerting,</span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;"> </span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;">coming soon).</span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;"> Moreover, it exposes previously hidden parameters to allow more fine-tuning than ever before.</span></p> <p dir="ltr"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;"><br></span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;">Behind the scenes, CAQL expressions are compiled into a tree of processing units that process a stream of data in a push based computation model and maintain a state.</span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;"><br></span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;">This video provides a helpful introduction to using CAQL, which you can follow along. You can also get started with the written examples provided below.</span></p> <p><br></p> <p style="text-align: center;"><iframe width="420" height="315" src="https://www.youtube.com/embed/bg0lDutQqdU" frameborder="0" allowfullscreen=""></iframe><br></p> <p><br></p> <p><span style="font-size: 1.17em; font-weight: bold; line-height: 25.0964984893799px;">Getting Started</span><br></p> <p><br></p> <p dir="ltr"><font color="#000000"><span style="font-size: 14.6666669845581px;">To create your first CAQL statement, create a new graph and select "CAQL Statement" from the "Add Datapoint" menu. Expand the legend bar to see the CAQL input field. Clicking in the input field will bring up a tooltip that shows some of the most used CAQL functions.<br></span></font></p> <p dir="ltr"><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;"><br></span></p> <p></p> <p style="text-align: center; font-size: medium;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6005869890/original/blob1443107064422.png?1443107065" class="inline-image" data-id="6005869890"></p> <p style="font-size: medium;"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;"><br></span></p> <p><font color="#000000" face="Arial"><span style="font-size: 14.6666669845581px;">The first thing we have to do is add a metric data source. This is accomplished using the "metric" statement:</span></font></p> <p><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;"><br></span></p> <p><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;">    </span><font color="#000000" face="Ubuntu Mono"><span style="font-size: 14.6666669845581px;">metric:&lt;kind&gt;(&lt;checkuuid&gt;, &lt;metricname&gt;)</span></font></p> <p><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;"><br></span></p> <p><font color="#000000"><span style="font-size: 14.6666669845581px;">This requires you to input the metric kind (e.g. "average"), the uuid of the check, and the metric name. You can find this information on the <a href="https://login.circonus.com/user/docs/Data/View/Checks" target="">check details</a> page. </span></font><span style="font-size: 14.6666669845581px; color: rgb(0, 0, 0);">An easier way to enter this information is using the tooltip:</span></p> <p></p> <ol> <li><span style="font-size: 14.6667px; color: rgb(0, 0, 0);">In the metric f(x) row, click the kind of metric you want to add.</span></li> <li><span style="font-size: 14.6667px; color: rgb(0, 0, 0);">Double click on &lt;checkuuid&gt; to get a search box for the available checks.</span></li> <li><span style="font-size: 14.6667px; color: rgb(0, 0, 0);">Type a key word, press enter, and select a corresponding check. The corresponding check uuid will be filled in.</span></li> <li><span style="font-size: 14.6667px; color: rgb(0, 0, 0);">Double click on &lt;metricname&gt; to get a dropdown menu with the available metrics for this check:</span></li> </ol> <p><br></p> <p style="font-size: medium;"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;"></span></p> <p style="text-align: center;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6005871446/original/blob1443108099863.png?1443108100" class="inline-image" data-id="6005871446"></p> <br><p></p> <p style="font-size: medium;"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6667px;">Congratulations, you have just entered your first complete CAQL statement!</span><br></p> <p style="font-size: medium;"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;"><br></span></p> <p style="font-size: medium;"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;">When the focus leaves the input field, the values for the selected metric should show up in the graph.</span></p> <p style="font-size: medium;"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;">If something went wrong, the UI will show an error message hinting at the source of the problem.</span></p> <p style="font-size: medium;"><br></p> <p style="font-size: medium;"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;">Now, let’s look at some examples of some common scenarios, and how we can use the features of CAQL in those situations.</span></p> <p style="font-size: medium;"><br></p> <h3 dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 15.210000038147px;"><span style="font-size: 16px; font-family: 'Trebuchet MS'; color: rgb(102, 102, 102);">Example 1: Peek latency over the last hour</span></span></h3> <p style="font-size: medium;"><span style="font-size: 14.6666669845581px; color: rgb(0, 0, 0);"><br></span></p> <p><span style="font-size: 14.6666669845581px; color: rgb(0, 0, 0);">Let's say we are measuring the </span><span style="font-size: 14.6666669845581px; color: rgb(0, 0, 0);">round trip time (rtt) of a D</span><span style="font-size: 14.6666669845581px; color: rgb(0, 0, 0);">NS server, and we are interested in the peek rrt we've seen in the last hour. You can compute this value using CAQL as follows:<br><br>       </span><font color="#000000" face="Ubuntu Mono"><span style="font-size: 14.6666669845581px;">metric:average(&lt;checkuuid&gt;, "rtt") | rolling:max(1h)</span></font></p> <p style="font-size: medium;"><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;"><br></span></p> <p style="font-size: medium;"><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;">The screenshot below shows a graph with the original values and the computed maximum. Click the screenshot to view an interactive example:</span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;"><br></span></p> <p></p> <p style="text-align: center;"><a href="https://share.circonus.com/shared/graphs/95ae3912-59d9-426b-9ab1-80c2e6b15a93/ZNnUbN"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6005872541/original/blob1443108909795.png?1443108910" class="inline-image" data-id="6005872541" data-height="427" style="height: 427px; float: none; margin: 0px;" alt=""></a></p> <p><br></p> <p dir="ltr"><font color="#000000" face="Arial"><span style="font-size: 14.6666669845581px;">Let's break that down:</span></font></p> <p dir="ltr"><span style="color: rgb(0, 0, 0); font-family: 'Ubuntu Mono'; font-size: 14.6667px;"><br></span></p> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><p dir="ltr"><span style="color: rgb(0, 0, 0); font-family: 'Ubuntu Mono'; font-size: 14.6667px;">metric:average(&lt;checkuuid&gt;, "rtt")</span><span style="color: rgb(0, 0, 0); font-size: 14.6667px;"><span style="font-family: Arial;"> -- This creates a stream of values of DNS rtts</span></span></p></blockquote> <p dir="ltr"><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;"><span style="font-family: Arial;"><br></span></span></p> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><p dir="ltr"><span style="color: rgb(0, 0, 0); font-family: 'Ubuntu Mono'; font-size: 14.6666669845581px;">| -- </span><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;">The pipe character takes the output of metric and passes it as input to further processing units.</span></p></blockquote> <p dir="ltr"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;"><br></span></p> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><p><span style="color: rgb(0, 0, 0); font-family: 'Ubuntu Mono'; font-size: 14.6666669845581px;">rolling:max(1h) -- </span><font face="Arial"><font color="#000000"><span style="font-size: 14.6667px;">This function creates a processing unit, that computes the maximum value over a rolling window of 1h. You can supply arbitrary durations (e.g. `2h 3M`) as arguments to this function.</span></font></font></p></blockquote> <p><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;"><font face="Arial"><br></font></span></p> <p><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;"><font face="Arial">The </font></span><span style="color: rgb(0, 0, 0); font-family: 'Ubuntu Mono'; font-size: 14.6666669845581px;">rolling:max(&lt;duration&gt;)</span><span style="color: rgb(0, 0, 0); font-size: 14.6666669845581px;"><font face="Arial"> function has a cousin, </font></span><span style="color: rgb(0, 0, 0); font-family: 'Ubuntu Mono'; font-size: 14.6666669845581px;">window:max(&lt;duration&gt;), </span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;">that computes the maximum over the last fully completed window. </span><span style="font-size: 14.6666669845581px;">A full list of all available functions in CAQL can be found in the <a href="https://login.circonus.com/user/docs/CAQL" target="" style="background-color: rgb(255, 255, 255);">user manual</a>.</span></p> <p><br></p> <h3 dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 15.210000038147px;"><span style="font-size: 16px; font-family: 'Trebuchet MS'; color: rgb(102, 102, 102);">Example 2: Working with Histograms</span></span></h3> <div><span style="font-size: 15.210000038147px;"><span style="font-size: 16px; font-family: 'Trebuchet MS'; color: rgb(102, 102, 102);"><br></span></span></div> <div> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;">With CAQL, it is possible to display properties of histograms that were not available in the UI before.</span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;">Use this syntax:</span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;"><br></span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;">      metric:histogram(&lt;checkuuid&gt;, &lt;metricname&gt;) </span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;"><br></span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;">This creates a stream of histogram values. (The histogram itself will not show in the UI.) </span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;">The screenshot below shows a histogram of request latencies with the following transforms applied to it:</span></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666669845581px;"><br></span></p> <p></p> <ul> <li><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6667px;">histogram:mean() -- the mean value of the histogram (shown below in green)</span></li> <li><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6667px;">histogram:IQR() -- to inter-quartile-range (shown below in red)</span></li> <li><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6667px;">histogram:rate() -- the number of samples per second (shown below in blue)</span></li> </ul> <p></p> <p><span style="font-size: 14.6666669845581px; font-family: Arial; color: rgb(0, 0, 0);"><br></span></p> <p><span style="font-size: 14.6666669845581px; font-family: Arial; color: rgb(0, 0, 0);">The last graph has furthermore been smoothed by applying a rolling mean.</span></p> <p><br></p> <p></p> <p></p> <p></p> <p style="text-align: center;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6005885129/original/blob1443120195862.png?1443120196" class="inline-image" data-id="6005885129"></p> <br><p></p> <p><br></p> </div> <h3 dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 15.210000038147px;"><span style="font-size: 16px; font-family: 'Trebuchet MS'; color: rgb(102, 102, 102);">Example 3: Finding anomalies in low-frequency data</span></span></h3> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">Performing anomaly detection on low-frequency data is challenging. The graph below shows the web request rate of a web server, which is mostly idle.</span></span></p> <p dir="ltr"><span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"><br>The normal state of this metric is a flat 0, so any activity would be an anomaly for this metric.</span></span></p> <p dir="ltr"><span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"><br></span></span></p> <p dir="ltr"><span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"></span></span></p> <p style="text-align: center;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6005887097/original/blob1443122179777.png?1443122180" class="inline-image" data-id="6005887097"></p> <br><p></p> <p dir="ltr"> <br></p> <p><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;">The solution is to use windowed smoothing to identify a sensible “normal” state. The graph below shows the same data as above in green, a 12h rolling mean has been added in blue, and the anomaly score of the smoothed data is appears in red. </span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px;">The result is a more practical interpretation of where our anomalies are to be found.</span></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr"></p> <p></p> <p style="text-align: center;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6005887257/original/blob1443122301083.png?1443122301" class="inline-image" data-id="6005887257"></p> <br> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">This graph was produced with this query:</span></span></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr" style="margin-left: 36pt;"><font color="#000000" face="Ubuntu Mono"><span style="font-size: 14.6666669845581px;">metric:counter('586d9436-27fa-4567-a6b9-cecaf49228e7','mobile`FRONTEND`req_tot')</span></font></p> <p dir="ltr" style="margin-left: 36pt;"><font color="#000000" face="Ubuntu Mono"><span style="font-size: 14.6666669845581px;">| rolling:mean(12h)</span></font></p> <p dir="ltr" style="margin-left: 36pt;"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a"><font color="#000000" face="Ubuntu Mono"><span style="font-size: 14.6666669845581px;">| anomaly_detection(60)</span></font><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);"></span></span></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">Let’s break that down:</span></span></p> <p><span> </span><br></p> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"> <p dir="ltr"><span style="color: rgb(0, 0, 0); font-family: 'Ubuntu Mono'; font-size: 14.6666669845581px; line-height: 1.3;">rolling:mean(12h) </span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px; line-height: 1.3;">-- This is a processing unit that takes in data over one hour, and calculates the average.</span></p> <p dir="ltr"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14.6666666666667px; line-height: 1.3;"><br></span></p> </blockquote> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><p><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">anomaly_detection(60)</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"> -- This processing unit detects anomalies with the specified sensitivity</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">. The sensitivity value </span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">can be set between 0 and 100.</span></p></blockquote> <p dir="ltr"><br></p> <p></p> <h3 dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 15.210000038147px;"><span style="font-weight: 700; font-size: 16px; font-family: 'Trebuchet MS'; color: rgb(102, 102, 102);">Example 4: Monitoring uptime</span></span></h3> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">In this example, let’s say we are monitoring uptime over the past day in order to verify an availability SLA. This will depend on our ability to account for missing data points, so we can use the following CAQL statement:</span></span></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr" style="text-indent: 36pt;"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">metric:&lt;&gt; | is_missing() | rolling:mean(1d)</span></span></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">Filling in the appropriate check uuid and metric name, this statement produces the following graph:</span></span></p> <p><br></p> <p></p> <p style="text-align: center;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6004756429/original/CAQL7.png?1441728259" class="inline-image" data-id="6004756429" style="cursor: default;"></p> <p><br> </p> <p></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">Let’s break down this formula. We’re already familiar with the source </span><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">metric:&lt;&gt;</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"> and the </span><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">rolling:mean</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">.</span></span></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a"><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">ismissing()</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"> -- This processing unit returns 1 if there is a missing datapoint in the preceding data, and returns a 0 otherwise.</span></span></p></blockquote> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">So this CAQL statement identifies the missing data in the selected metric. In this example, we simply add "</span><span style="font-size: 14.6667px; color: rgb(0, 0, 0);"><span style="font-family: 'Helvetica Neue';">100 - (</span><span style="font-family: Arial;">" to the front of the CAQL statement and "</span><span style="font-family: 'Helvetica Neue';">) * 100</span><span style="font-family: Arial;">" to the back, and we have our uptime report, with the graph measuring availability over the past day.</span></span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"></span></span></p> <p dir="ltr"><span style="font-size: 13px;"> </span></p> <h3 dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 15.210000038147px;"><span style="font-weight: 700; font-size: 16px; font-family: 'Trebuchet MS'; color: rgb(102, 102, 102);">Example 5: Monitoring the ratio between two data-points with a delay</span></span></h3> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">Monitoring ratio between two data-points when one is delayed is accomplished with a relatively simply query of the form:</span></span></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr" style="text-indent: 36pt;"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">metric:&lt;A&gt; / (metric:&lt;B&gt; | delay(1d))</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"><br><br></span></span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">Let’s plug in some metrics and look at an example graph:</span></span></p> <p><br></p> <p></p> <p><br></p> <p style="text-align: center;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6007790793/original/blob1445623809998.png?1445623811"></p> <p></p> <p></p> <br> <p><br> </p> <p></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">Let’s breakdown this down.</span></span></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a"><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">delay</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"> -- This processing unit delays the stream by the specified number of samples.</span></span></p></blockquote> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">The </span><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">delay</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"> function supports duration literals. Internally we translate a duration to the number of samples within that duration, but you can use </span><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">h</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">, </span><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">m</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">, and </span><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">s</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"> to specify hours, minutes, and seconds. For example, “</span><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">1d</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">” = 1 day, which is translated to the corresponding number of seconds / samples (“</span><span style="font-size: 14.6667px; color: rgb(0, 0, 0);"><span style="font-family: 'Helvetica Neue';">1d</span><span style="font-family: Arial;">” is equivalent to “1440” samples).</span></span></span></p> <p><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a"> </span></p> <p dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 13px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"><b>Warning:</b> Regarding the duration syntax, the units have to directly follow the number, without spaces. For example “</span><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">5 M</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">” is not supported, but “</span><span style="font-size: 14.6666666666667px; font-family: 'Ubuntu Mono'; color: rgb(0, 0, 0);">5m</span><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);">” is supported.</span></span></p> <p><br></p> <h2 dir="ltr"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 19.5px;"><span style="font-size: 14.6666666666667px; font-family: Arial; color: rgb(0, 0, 0);"></span></span></h2> <h2 dir="ltr" style="text-align: center;"><span id="docs-internal-guid-681c8694-8edb-bf64-de5e-267c84ae755a" style="font-size: 19.5px;"><span style="font-weight: 700; font-size: 17.3333333333333px; font-family: 'Trebuchet MS'; color: rgb(0, 0, 0);">Package CAQL - Functions</span></span></h2> <p> </p> <p><span style="font-size: 14.6666669845581px;"> </span></p> <p><span style="font-size: 14.6666669845581px;">A table listing CAQL functions is maintained in the Circonus <a href="https://login.circonus.com/user/docs/CAQL" target="" style="background-color: rgb(255, 255, 255);">user manual</a>.</span></p> 6000191056 904 6000055846 2015-11-16T14:56:24-05:00 6003691945 1 2 0 2 CAQL v1.0 Tutorial 2015-09-03T12:34:05-04:00 6003235491 1 2016-01-12T13:37:55-05:00 0 0 (Formerly titled "Exposing the Sum of NNT Lag") Currently, the Circonus Data Storage system does not expose the number of records by which it is behind its peers. However, even with the current way of exposing the average peer lag, there is a way to compute the expected catch up time of a Data Storage (Snowth) node, by using CAQL. Here is an example, in which we will expose the sum of NNT Lag: In the graph above, the black line is the average peer lag. The green line is the CAQL statement, that computes the expected time in hours until the peer lag reduces to 0. Note that the metric took around 4h to catch up (16:00 - 20:00) and the green line shows a value of 4-5 on the right axis at the beginning of the catch up phase. The formula used is a discrete variant of Newton's method for finding roots (see http://www.wikiwand.com/en/Newton's_method). This is the variant formula: dt = d / (y[t-d] / y[t] - 1) where: y[t] - is the value of the metric at time t t - is the current time dt - is the time until the 0 value is reached: x[t + dt]  ~ 0 In the example, we take d to be 10M in order to keep it from being too sensitive to occasional hiccups. This parameter can be tuned. This is not at all obvious, so we are working on simplifying this process and offering more robust means to estimate and alert on velocities of metrics. In the future, you should be able to use a CAQL statement like this to get the number of seconds until the metric reaches 0: metric:<> | forecast:time_to_zero() <div dir="ltr"><div class="gmail_quote"> <div><span>(Formerly titled "Exposing the Sum of NNT Lag")</span></div> <div><span><br></span></div> <div> <span>Currently, the Circonus Data Storage system does not expose the number of records by which it is behind its peers. However, </span><span>even with the current way of exposing the average peer lag, there is a way to compute the expected catch up time of a Data Storage (Snowth) node, by using CAQL.</span><br> </div> <div><br></div> <div>Here is an example, in which we will expose the sum of NNT Lag:</div> <div><br></div> <div></div> <div><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6013222470/original/blob1452608161458.png?1452608162"></div> <br><div></div> <div>In the graph above, the black line is the average peer lag. The green line is the CAQL statement, that computes the expected time in hours until the peer lag reduces to 0.</div> <div><br></div> <div>Note that the metric took around 4h to catch up (16:00 - 20:00) and the green line shows a value of 4-5 on the <span>right axis at the beginning of the catch up phase.</span> </div> <div><br></div> <div>The formula used is a discrete variant of Newton's method for finding roots (see <a href="http://www.wikiwand.com/en/Newton's_method" target="_blank">http://www.wikiwand.com/en/Newton's_method</a>). This is the variant formula:</div> <div><span><br></span></div> </div></div> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div dir="ltr"><div class="gmail_quote"><div><div><div><div><span>dt = d / (y[t-d] / y[t] - 1)</span></div></div></div></div></div></div></blockquote> <div dir="ltr"><div class="gmail_quote"><div><div><div> <div><br></div> <div>where:</div> </div></div></div></div></div> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div dir="ltr"><div class="gmail_quote"><div><div><div><div>y[t] - is the value of the metric at time t</div></div></div></div></div></div></blockquote> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div dir="ltr"><div class="gmail_quote"><div><div><div><div>t - is the current time</div></div></div></div></div></div></blockquote> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div dir="ltr"><div class="gmail_quote"><div><div><div><div>dt - is the time until the 0 value is reached: <span>x[t + dt]  ~ 0</span> </div></div></div></div></div></div></blockquote> <div dir="ltr"><div class="gmail_quote"> <div></div> <div></div> <div></div> <div><br></div> <div>In the example, we take d to be 10M in order to keep it from being too sensitive to occasional hiccups. <span>This parameter can be tuned.</span> </div> <div><br></div> <div>This is not at all obvious, so we are working on simplifying this process <span>and offering more robust </span><span>means to estimate and alert on velocities of metrics. In the future, you should be able to use a CAQL </span><span>statement like this </span><span>to get the number of seconds until the metric reaches 0</span><span>:</span> </div> </div></div> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div dir="ltr"><div class="gmail_quote"><div><div><div><div>metric:&lt;&gt; | forecast:time_to_zero()</div></div></div></div></div></div></blockquote> 6000191056 117 6000104611 2016-03-31T11:27:01-04:00 6003235491 5 2 0 0 [recipe] Determine Catch Up Duration 2016-03-31T11:27:01-04:00 6002695175 1 2015-11-16T12:55:03-05:00 0 1 Circonus Histogram datapoints allow you to store, visualize, and reason about high-velocity data. Sometimes, you also want to apply those histogram analytics to numeric data that is sampled at a low (1 sample/minute) frequency. With the following CAQL function, you now have the possibility to do so:     window:histogram(<duration>) This function will aggregate the incoming stream of data for a time of `<duration>` and output a stream of histograms of the latest completed window. Example: Latency histogram. The following graph was generated by the following query:      metric:average(<id>,<name>) | window:histogram(1h) Of course, you can then apply other histogram methods, for further analysis:     metric:average(<>,<>) | window:histogram(1h) | histogram:IQR() Histogram Aggregation When zooming to large view ranges of weeks or years, numeric data gets aggregated by mean values, which leads to peak erosion (cf. See our article Avoid Peak Erosion using Max-aggregation). As histograms are naturally aggregated by summing the bin counts, we can use histogram synthesis for viewing numeric data at large view ranges:     metric:average(<>,<>) | window:histogram(1) Note, that the black histogram points, are much higher than the peaks of the original metric. <div> <p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px;"><br></p> <div class="freshdesk_quote"> <span style="color: rgb(102, 102, 102);">Circonus Histogram datapoints allow you to store, visualize, and reason about high-velocity data. Sometimes, you also want to apply those histogram analytics to numeric data that is sampled at a low (1 sample/minute) frequency. With the following CAQL function, you now have the possibility to do so:</span><br><font color="#666666"><br></font><span style="color: rgb(102, 102, 102);">    window:histogram(&lt;duration&gt;)</span><br><font color="#666666"><br></font><span style="color: rgb(102, 102, 102);">This function will aggregate the incoming stream of data for a time of `&lt;duration&gt;` and output a stream of histograms of the latest completed window.</span><br><font color="#666666"><br></font><span style="color: rgb(102, 102, 102);">Example: Latency histogram. The following graph was generated by</span><br><span style="color: rgb(102, 102, 102);">the following query:</span><br><font color="#666666"><br></font><span style="color: rgb(102, 102, 102);">     metric:average(&lt;id&gt;,&lt;name&gt;) | window:histogram(1h)</span><br><font color="#666666"><br></font><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6007771900/original/blob1445607866182.png?1445607866" class="inline-image fr-dii fr-draggable" data-id="6007771900" style="color: rgb(102, 102, 102);"><br><font color="#666666"><br></font><span style="color: rgb(102, 102, 102);">Of course, you can then apply other histogram methods, for further analysis:</span><br><font color="#666666"><br></font><span style="color: rgb(102, 102, 102);">    metric:average(&lt;&gt;,&lt;&gt;) | window:histogram(1h) | histogram:IQR()</span><br><font color="#666666"><br></font><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6007772714/original/blob1445608499560.png?1445608499" class="inline-image fr-dii fr-draggable" data-id="6007772714" style="color: rgb(102, 102, 102);"><br><font color="#666666"><br><br></font><b style="color: rgb(102, 102, 102);">Histogram Aggregation</b><br><span style="color: rgb(102, 102, 102);">When zooming to large view ranges of weeks or years, numeric data gets aggregated by mean values, which leads to peak erosion (cf. </span>See our article <a href="6000056404" style="background-color: rgb(255, 255, 255);">Avoid Peak Erosion using Max-aggregation</a><span style="color: rgb(102, 102, 102);">).</span><br><font color="#666666"><br></font><span style="color: rgb(102, 102, 102);">As histograms are naturally aggregated by summing the bin counts, we can use histogram synthesis for viewing numeric data at large view ranges:</span><br><font color="#666666"><br></font><span style="color: rgb(102, 102, 102);">    metric:average(&lt;&gt;,&lt;&gt;) | window:histogram(1)</span><br><font color="#666666"><br></font><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6007772480/original/blob1445608299240.png?1445608299" class="inline-image fr-dii fr-draggable" data-id="6007772480" style="color: rgb(102, 102, 102);"><br><font color="#666666"><br></font><span style="color: rgb(102, 102, 102);">Note, that the black histogram points, are much higher than the peaks of the original metric.</span> </div> </div> 6000191056 249 6000089114 2017-09-20T16:53:17-04:00 6003235491 9 2 0 1 [recipe] Synthesizing Histograms from numeric data 2015-11-16T12:57:04-05:00 6002695175 1 2015-11-16T13:03:15-05:00 1 0   Say we have a metric of web request rates and are interested in how much traffic we have compared to last week. The following diagram shows how such a comparison might look like with CAQL: The three line-plots are generated as follows: [green] web request metric, generated by:     metric:average(<check_id>, <metric_name>) [black] web request metric delayed by 7 days:     metric:average(<check_id>, <metric_name>) | delay(7d) [red, right axis] Growth compared to last week     metric:average(<check_id>, <metric_name>) /      (metric:average(<check_id>, <metric_name>) | delay(7d)) Variant: With windowed smoothing To make the method more robust against small traffic spikes, we can smooth the initial metric with this:     metric:average(<check_id>, <metric_name>) | rolling:mean(3h) The results looks like this: <p> </p> <p style="" align="left">Say we have a metric of web request rates and are interested in how much traffic we have compared to last week. <span style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;">The following diagram shows how such a comparison might look like with CAQL:</span></p> <p style="" align="left"><br></p> <p style="" align="left"><img style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;" src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6007790793/original/blob1445623809998.png?1445623811" data-id="6007790793"></p> <p style="" align="left"><br>The three line-plots are generated as follows:</p> <ol align="left" style=""> <li style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;">[green] web request metric, generated by:<br><br>    metric:average(&lt;check_id&gt;, &lt;metric_name&gt;)<br><br> </li> <li style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;">[black] web request metric delayed by 7 days:<br><br>    metric:average(&lt;check_id&gt;, &lt;metric_name&gt;) | delay(7d)<br><br> </li> <li style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;">[red, right axis] Growth compared to last week<br><br>    metric:average(&lt;check_id&gt;, &lt;metric_name&gt;) / <br>    (metric:average(&lt;check_id&gt;, &lt;metric_name&gt;) | delay(7d))</li> </ol> <p style="" align="left"><br></p> <p style="" align="left"><b style="margin: 0px; padding: 0px; border: 0px none; font-weight: bold; font-size: 13px; font-family: inherit;">Variant: With windowed smoothing</b></p> <p style="" align="left"><br></p> <p style="" align="left">To make the method more robust against small traffic spikes, we can <span style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;">smooth the initial metric with this:</span></p> <p style="" align="left"><br></p> <p style="" align="left">    metric:average(&lt;check_id&gt;, &lt;metric_name&gt;) | rolling:mean(3h)</p> <p style="" align="left"><br></p> <p style="" align="left">The results looks like this:</p> <p style="" align="left"><br></p> <p style="" align="left"><img style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;" src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6007791038/original/blob1445624129431.png?1445624130" data-id="6007791038"></p> <br align="left" style=""><br> 6000191056 119 6000089117 2015-11-16T13:03:15-05:00 10 2 1 0 [recipe] Monitor growth rates with delayed ratios 2015-11-16T13:03:15-05:00 6002695175 1 2015-11-16T13:05:25-05:00 0 0   Problem: How many samples are contained in a histogram datapoint? CAQL Soution:     metric:histogram(<>,<>) | histogram:rate() shows the numeber of samples per second as a numeric data point. <p> </p> <p style="" align="left"><b style="margin: 0px; padding: 0px; border: 0px none; font-weight: bold; font-size: 13px; font-family: inherit;">Problem:</b> How many samples are contained in a histogram datapoint?</p> <p style="" align="left"><br></p> <p style="" align="left"><b style="margin: 0px; padding: 0px; border: 0px none; font-weight: bold; font-size: 13px; font-family: inherit;">CAQL Soution:</b></p> <p style="" align="left"><br></p> <p style="" align="left">    metric:histogram(&lt;&gt;,&lt;&gt;) | histogram:rate()</p> <p style="" align="left"><br></p> <p style="" align="left">shows the numeber of samples per second as a numeric data point.</p> <p style="" align="left"><br></p> <p style="" align="left"><img style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;" src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6005889415/original/blob1443124751477.png?1443124752" data-id="6005889415"></p> <br> 6000191056 140 6000089118 2015-11-16T13:05:25-05:00 11 2 0 0 [recipe] Compute Sample Rate On Histograms 2015-11-16T13:05:25-05:00 6002695175 1 2015-11-16T13:06:10-05:00 0 0   Problem: Compute the 90% quantile of a numeric duration metric over the last hour. Solution:     metric:average(<>,<>) | window:percentile(1h, 90)   How it looks:   Note that the windows seem 1h delayed behind the actual data. This is because the quantiles are computed over the last fully completed window. <p> </p> <p style="" align="left"><b style="margin: 0px; padding: 0px; border: 0px none; font-weight: bold; font-size: 13px; font-family: inherit;">Problem</b>: Compute the 90% quantile of a numeric duration metric over the last hour.</p> <p style="" align="left"><br></p> <p style="" align="left"><b style="margin: 0px; padding: 0px; border: 0px none; font-weight: bold; font-size: 13px; font-family: inherit;">Solution:</b></p> <p style="" align="left"><br></p> <p style="" align="left"><span style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;">    metric:average(&lt;&gt;,&lt;&gt;) | window:percentile(1h, 90)</span><br></p> <p style="" align="left"><span style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;"> </span></p> <p style="" align="left"><b style="margin: 0px; padding: 0px; border: 0px none; font-weight: bold; font-size: 13px; font-family: inherit;">How it looks:</b></p> <p style="" align="left"><span style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;"> </span></p> <p style="" align="left"><img style="margin: 0px; padding: 0px; border: 0px none; font-weight: inherit; font-size: 13px; font-family: inherit;" src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6005891441/original/blob1443126821000.png?1443126821" data-id="6005891441"></p> <br align="left" style=""> <p style="" align="left">Note that the windows seem 1h delayed behind the actual data. This is because the quantiles are computed over the last fully completed window.</p> <p style="" align="left"><br></p> <br><p></p> 6000191056 95 6000089119 2015-11-16T13:06:10-05:00 12 2 0 0 [recipe] Latency Quantiles over 1h windows 2015-11-16T13:06:10-05:00 6002695175 1 2015-11-16T13:07:10-05:00 0 0 In the following example, we will compute the downtime of a service over the last hour. To do so, we will probe our service API with an external check every minute to see if the service is running. We can use a HTTP check and a duration metric for that purpose: As you can see there are several times where the service not reachable during the view period. We can isolate those times using the `is_missing()` CAQL function. It returns 1 if the value was missing and 0 if it was available: Now, the downtime of a service during a reporing period is the number of times the service was not available divided by the length of the reporing period. This is precisely the average of the values of the is missing function. Hence we can calculate the downtime over a reporting period as a rolling mean value: The peek value of the green line at 0.25 tells you that over the last hour of time 20:07 to 21:07, your service was down 0.25 = 25% of the time. To clean up the graph, we remove the second line and multiply the downtime ratio by 100 to get a percentage. The result looks as follows, and can be inspected live here. Not using Circonus,yet? Get a free account here: circonus.com/free-account. <div dir="ltr"> <div dir="ltr"> <div dir="ltr"> <p>In the following example, we will compute the downtime of a service over the last hour.</p> <p><br></p> <p>To do so, we will probe our service API with an external check every minute to see if the service is running.</p> <p>We can use a HTTP check and a duration metric for that purpose:</p> <p><br></p> <p></p> <p><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6026853884/original/Screenshot%202016-07-06%2014.10.07.png?1467829087" class="inline-image" data-id="6026853884"></p> <br><p></p> <p>As you can see there are several times where the service not reachable during the view period.</p> <p>We can isolate those times using the `is_missing()` CAQL function. It returns 1 if the value was missing and 0 if it was available:</p> <p><br></p> <p></p> <p><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6026854046/original/Screenshot%202016-07-06%2014.10.22.png?1467829187" class="inline-image" data-id="6026854046"></p> <br><p></p> <p>Now, the downtime of a service during a reporing period is the number of times the service was not available divided by the length of the reporing period.</p> <p>This is precisely the average of the values of the is missing function. Hence we can calculate the downtime over a reporting period as a rolling mean value:</p> <p><br></p> <p></p> <p><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6026854414/original/Screenshot%202016-07-06%2014.11.20.png?1467829425" class="inline-image" data-id="6026854414"></p> <p><br></p> <p>The peek value of the green line at 0.25 tells you that over the last hour of time 20:07 to 21:07, your service was down 0.25 = 25% of the time.</p> <p><br></p> <p>To clean up the graph, we remove the second line and multiply the downtime ratio by 100 to get a percentage. The result looks as follows, and can be inspected live <a href="https://share.circonus.com/shared/graphs/b0c83677-117f-606a-ce0d-980a3729c110/nOjuXH" target="">here</a>.</p> <p></p> <p><br></p> <p></p> <p><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6026854400/original/Screenshot%202016-07-06%2014.17.19.png?1467829409" class="inline-image" data-id="6026854400"></p> <p><br></p> <p>Not using Circonus,yet? Get a free account here: <a href="http://www.circonus.com/free-account/" target="" style="">circonus.com/free-account</a>.</p> <br><p></p> <p><br></p> <p><br></p> <p style="" align="left"><br></p> <br><p></p> </div> </div> </div> 6000191056 78 6000089120 2016-07-06T15:12:06-04:00 6003691945 13 2 0 0 [recipe] Downtime percentage over 1h windows 2015-11-16T13:07:10-05:00 6002695175 1 2016-03-08T11:33:07-05:00 0 2 CAQL has recently been augmented with two new forecasting methods: forecasting:slope(forecast_duration) forecasting:regression(forecast_duration) Both methods are functionally very similar, and can be applied in similar situations. They can both be used to forecast linear or exponential trends, like disk usage or user growth. As we will see, parameters and output values are very similar. As the slope method is simple and more performant, this should be the default in these scenarios. These methods are not suitable for forecasting periodic trends like page views. While the idea behind the forecasting methods is rather simple, the emitted output values can be non-obvious to interpret. This post should give you all the information needed to get you started. Slope Method The slope forecasting method fits a line through a window of historic data, and projects a forecast based on the data in that window. The line is set to match the most recent data point, `y[t]`, and a second pivot-point that is delayed by model_duration into the past, `y[t - model_duration]`. This line is then used to extrapolate the data into the future by an amount of time equal to the specified `forecast_duration`. The forecasted value can be read off the graph as indicated in Figure 1. A mathematical formula for the forecasted value `F[t]` can be given as follows: F[t] = y[t] + (y[t] - y[t - model_duration]) * forecast_duration / model_duration Figure 1: Construction of forecasted values using the Slope-method. Regression Method As in the slope method, the regression method uses a line to forecast the data into the future. Instead of only using two points for the forecast, the regression method uses a regression line that fits all samples that were recorded during the most recent model_duration. Again, we use this line to extrapolate the data an amount of forecast_duration into the future and arrive at the forecasted value, cf. Figure 2. By default, the regression line is updated once every time an amount of time equal to the specified model duration has passed. This is in contrast to the slope method, which gets updated with every new sample. Figure 2: Construction of forecasted values using the Regression method. Configuration Slope- and Regression-forecasting offer the following parameters. `forecast_duration` the target duration to forecast into the future. `model_duration` is an optional second parameter, that specifies the time duration to base the model on. A large model duration gives a more stable estimate, but at the same time slows down the uptake of new trends. The model duration should reflect the amount of time you expect the trends to be stable. Usual settings are 10M - 2h. By setting `model = "linear"`, you can use an exponential graph for the forecasting instead of a straight line. This can be used to forecast exponential trends, like user growth. The optional `step` parameter allows you to set an explicit update interval for the model. For the regression model, the minimal step duration is the model_duration. For alerting, you want to keep this parameter low (the default value). A high step value can be used in graphs to make the interpolated lines visible (cf. Figure 3). Further details about parameters and invocation can be found in the CAQL Manual. Figure 3: Slope and Regression-forecasting applied to random metric. <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">CAQL has recently been augmented with two new forecasting methods:</span></span></p> <p><span style="color: rgb(0, 0, 0); font-family: 'Ubuntu Mono', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14.6667px; white-space: pre-wrap; line-height: 1.38;"><br></span></p> <p></p> <ul> <li><span style="font-family: 'Courier New';"><span style="color: rgb(0, 0, 0); font-size: 13.6667px; line-height: 1.38; white-space: pre-wrap;">forecasting:slope(forecast_duration)</span><br></span></li> <li> <span style="color: rgb(0, 0, 0); font-size: 13.6667px; line-height: 1.38; white-space: pre-wrap;"><span style="font-family: 'Courier New';">forecasting:regression(forecast_duration)</span></span><br> </li> </ul> <p><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><br> </span></p> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">Both methods are functionally very similar, and can be applied in similar situations. They can both be used to forecast linear or exponential trends, like disk usage or user growth. As we will see, parameters and output values are very similar. As the slope method is simple and more performant, this should be the default in these scenarios. These methods are not suitable for forecasting periodic trends like page views.</span></span></p> <p><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><br> </span></p> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">While the idea behind the forecasting methods is rather simple, the emitted output values can be non-obvious to interpret. This post should give you all the information needed to get you started. </span></span></p> <h2 dir="ltr" style="line-height: 1.38; margin-top: 18pt; margin-bottom: 6pt;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5" style="font-weight: normal;"><span style="font-size: 21.3333px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">Slope Method</span></span></h2> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">The slope forecasting method fits a line through a window of historic data, and projects a forecast based on the data in that window. The line is set to match the most recent data point, `y[t]`, and a second pivot-point that is delayed by model_duration into the past, `y[t - model_duration]`. This line is then used to extrapolate the data into the future by an amount of time equal to the specified `forecast_duration`. The forecasted value can be read off the graph as indicated in Figure 1.</span></span></p> <p><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><br> </span></p> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">A mathematical formula for the forecasted value `F[t]` can be given as follows:</span></span></p> <p><span style="font-family: "><br></span></p> <blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><p><span style="font-family: 'Courier New';"><span style="color: rgb(0, 0, 0); font-size: 13.6667px; white-space: pre-wrap; line-height: 1.38;">F[t] = y[t] + (y[t] - y[t - model_duration]) * forecast_duration / model_duration</span></span></p></blockquote> <p><br></p> <p dir="ltr"></p> <p style="color: rgb(0, 0, 0); font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14.6667px; line-height: 1.38; white-space: pre-wrap;"></p> <p style="color: rgb(0, 0, 0); font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14.6667px; line-height: 1.38; white-space: pre-wrap; text-align: center;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6017542154/original/Forecast_Slope.png?1457455841" class="inline-image" data-id="6017542154" data-height="315" style="height: 315px;"></p> <div style="text-align: center;"> <span style="color: rgb(0, 0, 0); font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14.6667px; white-space: pre-wrap; line-height: 1.38;"><b>Figure 1:</b> Construction of forecasted values using the Slope-method.</span><br> </div> <h3 dir="ltr" style="line-height: 1.38; margin-top: 16pt; margin-bottom: 4pt;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5" style="font-weight: normal;"><span style="font-size: 18.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(67, 67, 67); white-space: pre-wrap;">Regression Method</span></span></h3> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">As in the slope method, the regression method uses a line to forecast the data into the future.</span></span></p> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">Instead of only using two points for the forecast, the regression method uses a regression line</span></span></p> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">that fits all samples that were recorded during the most recent model_duration. Again, we use this line to extrapolate the data an amount of forecast_duration into the future and arrive at the forecasted value, cf. Figure 2.</span></span></p> <p><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><br> </span></p> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">By default, the regression line is updated once every time an amount of time equal to the specified model duration has passed. This is in contrast to the slope method, which gets updated with every new sample.</span></span></p> <p><br></p> <p dir="ltr"></p> <p style="color: rgb(0, 0, 0); font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14.6667px; line-height: 1.38; white-space: pre-wrap; text-align: center;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6017542301/original/Forecast_Regression.png?1457455920" class="inline-image" data-id="6017542301" data-height="319" style="height: 319px;"></p> <div style="text-align: center;"> <span style="color: rgb(0, 0, 0); font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14.6667px; white-space: pre-wrap; line-height: 1.38;"><b>Figure 2:</b> Construction of forecasted values using the Regression method.</span><br> </div> <h3 dir="ltr" style="line-height: 1.38; margin-top: 16pt; margin-bottom: 4pt;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5" style="font-weight: normal;"><span style="font-size: 18.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(67, 67, 67); white-space: pre-wrap;">Configuration</span></span></h3> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0); white-space: pre-wrap;">Slope- and Regression-forecasting offer the following parameters.</span></span></p> <p><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><br> </span></p> <ul><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"> <li dir="ltr" style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0);"> <p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400; font-style: normal; white-space: pre-wrap; background-color: transparent;">`forecast_duration` the target duration to forecast into the future.</span><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400; font-style: normal; white-space: pre-wrap; background-color: transparent;"><br><br></span></p> </li> <li dir="ltr" style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0);"> <p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 14.6667px; white-space: pre-wrap;">`model_duration` is an optional second parameter, that specifies the time duration to base the model on. A large model duration gives a more stable estimate, but at the same time slows down the uptake of new trends. The model duration should reflect the amount of time you expect the trends to be stable. Usual settings are 10M - 2h.</span></p> </li></span></ul> <p><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><br> </span></p> <ul><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"> <li dir="ltr" style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0);"> <p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400; font-style: normal; white-space: pre-wrap; background-color: transparent;">By setting `model = "linear"`, you can use an exponential graph for the forecasting instead of a straight line. This can be used to forecast exponential trends, like user growth.</span><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400; font-style: normal; white-space: pre-wrap; background-color: transparent;"><br><br></span></p> </li> <li dir="ltr" style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: rgb(0, 0, 0);"> <p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400; font-style: normal; white-space: pre-wrap; background-color: transparent;">The optional `step` parameter allows you to set an explicit update interval for the model.</span><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400; font-style: normal; white-space: pre-wrap; background-color: transparent;"><br></span><span style="font-size: 14.6667px; font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400; font-style: normal; white-space: pre-wrap; background-color: transparent;">For the regression model, the minimal step duration is the model_duration. For alerting, you want to keep this parameter low (the default value). A high step value can be used in graphs to make the interpolated lines visible (cf. Figure 3).</span></p> </li></span></ul> <p><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><br> </span></p> <p dir="ltr" style="line-height: 1.38;"><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><span style="font-family: Arial;"><span style="font-size: 14.6667px; color: rgb(0, 0, 0); white-space: pre-wrap;">Further details about parameters and invocation can be found in the </span><a href="https://login.circonus.com/user/docs/CAQL" target="">CAQL Manual</a></span><span style="font-size: 14.6667px; color: rgb(0, 0, 0); white-space: pre-wrap;"><span style="font-family: Arial;">.</span></span></span></p> <p><span id="docs-internal-guid-5a7634f0-570c-2f35-ff9f-4d2239021ce5"><br></span></p> <p><span></span></p> <p style="text-align: center;"><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/6017542355/original/Slope_and_Regression_random_metric.png?1457455963" class="inline-image" data-id="6017542355" data-height="307" style="height: 307px;"></p> <div style="text-align: center;"> <span style="color: rgb(0, 0, 0); font-family: Arial, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14.6667px; white-space: pre-wrap; line-height: 1.38;"><b>Figure 3:</b> Slope and Regression-forecasting applied to random metric.</span><br> </div> <p></p> <p><br></p> 6000191056 121 6000116508 2016-03-08T12:53:15-05:00 6003235491 14 2 0 2 Forecasting Values with CAQL 2016-03-08T12:53:15-05:00 6003235491