Code

minor layout adjustments
[rrdtool-all.git] / tutorial / lisa2008 / rrd-by-example / body.tex
1 \mode<presentation>
2 {
3   \usetheme{default} % no fancy navigation or anything ... 
4   \usecolortheme{tobi}
5   \usefonttheme{serif}   
6   \usepackage{lmodern}
7   \newcommand{\addgraph}[1]{\includegraphics[width=\textwidth]{ex/#1}}
8   \setbeamercovered{transparent=25}
9 }
10 \mode<article>
11 {
12   \usepackage{url}
13   \usepackage{graphicx}
14   \usepackage[colorlinks,hyperindex,plainpages=false]{hyperref}
15   \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
16   \setlength{\parindent}{0pt}  
17   \usepackage{times}
18   \newcommand{\addgraph}[1]{\begin{center}\framebox{\includegraphics[width=0.9\textwidth]{ex/#1}}\end{center}}
19   \addtolength{\voffset}{-2.5cm}
20   \addtolength{\textheight}{4cm}
21 }
22 \usepackage{alltt}
23 \usepackage{listings}
24 \usepackage{svgcolor}
25 \usepackage[english]{babel}
26 \usepackage[latin1]{inputenc}
27 % or whatever
29 \usepackage[T1]{fontenc}
30 % Or whatever. Note that the encoding and the font should match. If T1
31 % does not look nice, try deleting the line with the fontenc.
33 \title
34 {RRDtool by Example}
36 \author
37 {Tobias Oetiker}
39 \institute
40 {OETIKER+PARTNER AG}
42 \date[LISA 2008] % (optional, should be abbreviation of conference name)
43 {21. Large Installation System Administration Conference}
45 \mode<presentation>{\subject{RRDtool tutorial based on example use}}
47 \mode<presentation>{
48  \lstset{%
49    language=Perl,%
50    numbers=left,%
51    basicstyle=\ttfamily\footnotesize\color{black},%
52    keywordstyle=\color{darkgreen},%
53 %  identifyerstyle=\color{brown},%
54    commentstyle=\color{mediumpurple},%
55    stringstyle=\color{dimgray},
56    numberstyle=\ttfamily\scriptsize\color{darkgray},
57    showstringspaces=false
58  }
59 }
60 \mode<article>{
61  \lstset{%
62    language=Perl,%
63    numbers=left,%
64    basicstyle=\ttfamily\footnotesize,%
65    keywordstyle=\bfseries,%
66    numberstyle=\ttfamily\scriptsize,
67 %  identifyerstyle=\color{brown},%
68    commentstyle=\itshape,%
69    stringstyle=\color{black},
70    showstringspaces=false
71  }
72 }
74 \begin{document}
76 \mode<article>{\maketitle}
78 \begin{frame}<presentation>
79   \titlepage
80 \end{frame}
82 \mode<articel>{\tableofcontents}
84 \section{A different kind of Database}
86 \begin{frame}{creating a simple rrd}
87 \lstinputlisting[language=bash,firstline=0,lastline=11]{ex/create-first.sh}
88 One Datasource, 4 Round Robin Archives
89 \end{frame}
91 \begin{frame}{feeding data}
92 \lstinputlisting[language=bash,firstline=13,lastline=21]{ex/create-first.sh}
93 Feed in some data. One or several updates at once.
94 \end{frame}
96 \begin{frame}[allowframebreaks]{inside the database}
97 \lstinputlisting[language=xml,basicstyle=\ttfamily\scriptsize]{ex/create-first.xml}
98 \end{frame}
100 \mode<article>{
101 The xml dump of the rrd file shows an approximation of the on-disk
102 structure of the database. The rra database sections are re-ordered, so that
103 they are in chronological order with the oldest at the top. Also the
104 cdp sections are stored right after the header. The idea behind this
105 design is that data that get written on every update is as close
106 together as possible.}
108 \begin{frame}{rrd features}
109 \begin{itemize}
110 \item optimized for time-series data
111 \item fixed size rotating data store
112 \item constant on-disk size
113 \item no maintenance
114 \item on the fly consolidation
115 \end{itemize}
116 \end{frame}
118 \begin{frame}[fragile]{on-disk structure}
119 \begin{alltt}
120 +-------------------------------+
121 | Static Header                 | \textrm{RRD cookie, DB cfg}
122 |-------------------------------|\pause 
123 : Data Source (DS) Definitions  : 
124 |-------------------------------|\pause
125 : RR Archive (RRA) Definitions  : 
126 |===============================|\pause
127 | Live Head                     | \textrm{last update time}
128 |-------------------------------|\pause 
129 : PDP Prep per DS               : \textrm{last value for diff}
130 |-------------------------------|\pause
131 : CDP Prep per RRA and DS       : \textrm{intermediate storage}
132 |-------------------------------|\pause
133 : RRA Pointers                  :
134 |===============================|\pause
135 : Round Robin Archives (RRA)    :
136 +-------------------------------+
137 \end{alltt}
138 \end{frame}
140 \begin{frame}{irregular data arrival intervals}
141 \lstinputlisting[language=bash,lastline=19]{ex/update-real.sh}
142 \end{frame}
144 \mode<article>{To try things out lets assume that data arrives at
145   irregular intervals. This is counter data. By synchronizing the
146   data values with the arrival time we should get a constant rate
147   stored in the database.}
149 \begin{frame}{database after the irregular updates}
150 \lstinputlisting[language=bash,firstline=20]{ex/update-real.sh}
151 \lstinputlisting[language=bash]{ex/update-real.txt}
153 \begin{itemize}
154 \item rrdtool re-binning at work
155 \item major difference to a normal db
156 \item all bins contain 1.0
157 \item the time is the 'end-time' of the bin.
158 \end{itemize}
159 \end{frame}
161 \mode<article>{\newpage}
162 \begin{frame}{optimizing your rrds}
163 \begin{itemize}
164 \item update of multi DS RRD is cheep
165 \item single update interval per RRD
166 \item RRD modification is expensive
167 \item RRD size and update performance are independent
168 \item RRA complexity affects update performance
169 \end{itemize}
170 \end{frame}
172 \mode<article>{As long as your system is small (a few hundred RRDs)
173   you should optimize for convenience. Only keep DSes together
174   in one RRD that are tightly bound. For everything else
175   create separate RRDs.}
177 \mode<article>{\newpage}
179 \begin{frame}{fetching data}
180 fetch is for reading data from an rrd
181 \lstinputlisting[language=bash,firstline=8,lastline=9]{ex/catch-fetch.sh}
182 \begin{itemize}
183 \item one RRA with two 300s entries
184 \item one RRA with three 600s entries
185 \end{itemize}
186 \end{frame}
188 \begin{frame}[fragile]{playing catch with fetch}
189 first pull 300 seconds
190 \begin{verbatim}
191 > rrdtool fetch x.rrd -r 300 \
192   -s 1200000600 -e 1200000900 AVERAGE
194 1200000900: 4.0000000000e+01
195 1200001200: 5.0000000000e+01
196 \end{verbatim}
198 then pull 900 seconds
199 \begin{verbatim}
200 > rrdtool fetch x.rrd -r300 \
201   -s 1200000000 -e 1200000900 AVERAGE
203 1200000600: 2.5000000000e+01
204 1200001200: 4.5000000000e+01
205 \end{verbatim}
206 \end{frame}
208 \begin{frame}{fetch recap}
209 \begin{itemize}
210 \item looking for complete coverage
211 \item resolution is only a suggestion
212 \item time stamp in output marks the END of the period
213 \item end-time differences caused problems
214 \item since 1.3, only the start-time is relevant for coverage
215 \item outside the rra everything is NaN
216 \end{itemize}
217 \end{frame}
219 \begin{frame}{the size of an rrd - code}
220 \lstinputlisting{ex/rrd-size.pl}
221 \end{frame}
223 \mode<article>{\newpage}
225 \begin{frame}{the size of an rrd - result}
226 \lstinputlisting{ex/rrd-size.txt}
227 \begin{itemize}
228 \item overhead is minimal
229 \item 8 byte per double 
230 \item \ldots per datasource
231 \item \ldots per RRA
232 \item \ldots per RRA row
233 \end{itemize}
234 \end{frame}
236 \mode<article>{The rrd format is highly efficient at storing non
237   sparse data. The overhead for an extra RRA or DS is normally a few
238   bytes on top of the 8 byte per double.}
240 \mode<article>{\newpage}
242 \section{Graphing}
243 \begin{frame}[fragile]{rrdgraph syntax 101}
244 for graph command syntax, there are two basic rules:\pause
245 \begin{enumerate}
246 \item \texttt{-{}-options} start with a double dash\pause
247 \item graphing instructions start with a letter
248 \end{enumerate}
250 \pause
251 \begin{center}
252 \renewcommand{\tabcolsep}{0.4cm}
253 \renewcommand{\arraystretch}{2}
255 \begin{tabular}{|l|}\hline
256 \begin{minipage}[t]{0.7\textwidth}
257 \begin{alltt}
258 rrdtool graph \textit{output}
259    DEF:var=\textit{rrd}:\textit{DS}:\textit{AVARAGE}
260    LINE:var#\textit{hex-rgb-color}:Comment
262 \end{alltt}
263 \end{minipage}\\\hline
264 \end{tabular}
265 \end{center}
267 \texttt{DEF} and \texttt{LINE} are \emph{graphing instructions}.
268 \end{frame}
270 \mode<article>{The rrd graph command is the most versatile of all rrdtool
271   commands. It comes with its own little language, optimized for
272   drawing graphs. There are two kinds of arguments. The options
273   which start with a double-dash and the graphing instructions that
274   start with an uppercase letter.}
276 \begin{frame}{normal line}
277 \addgraph{LINE}
278 \end{frame}
280 \begin{frame}{lower limit}
281 \addgraph{LINE-lower}
282 \end{frame}
284 \mode<article>{Unless you are a banker and are you drawing stock diagrams,
285   make sure your graph displays the zero-y-value. Otherwise it is
286   pretty difficult to judge the meaning of the graph since perspective
287   is limited to the numbers on the y-axis.}
289 \begin{frame}{slope mode}
290 \addgraph{LINE-slope}
291 \end{frame}
293 \mode<article>{RRD graphs are pretty blocky. This is on purpose, since
294   the data is blocky too. The slope mode is a little concession. It
295   tilts the vertical connections between the 'blocks' by one pixel.}
297 \begin{frame}{anti-anti-aliasing: graph}
298 \addgraph{LINE-graph-mono}
299 \end{frame}
301 \begin{frame}{anti-anti-aliasing: font}
302 \addgraph{LINE-font-mono}
303 \end{frame}
305 \mode<article>{\newpage}
306 \begin{frame}{line width}
307 \addgraph{LINE-width}
308 \end{frame}
310 \begin{frame}{dashed line}
311 \addgraph{LINE-dash}
312 \end{frame}
314 \mode<article>{The numbers are an ON-OFF-ON-OFF-\ldots pattern. The
315   \texttt{dash-offset} property lets you shift the dashing of the line
316   to the right.}
318 \begin{frame}{DEF with :step}
319 \addgraph{DEF-step}
320 \end{frame}
323 \begin{frame}{DEF with :start}
324 \addgraph{DEF-start}
325 \end{frame}
326 \mode<article>{\newpage}
328 \begin{frame}{DEF with :reduce}
329 \addgraph{DEF-reduce}
330 \end{frame}
332 \begin{frame}{AREA simple}
333 \addgraph{AREA-simple}
334 \end{frame}
336 \mode<article>{\newpage}
337 \begin{frame}{two AREAs}
338 \addgraph{AREA-two}
339 \end{frame}
341 \begin{frame}{transparent AREA}
342 \addgraph{AREA-trans}
343 \end{frame}
345 \mode<article>{RRDtool creates real alpha transparency. You can set
346   the whole graph to be transparent by setting the 
347   graph CANVAS and BACKGROUND colors to transparent.}
349 \mode<article>{\newpage}
350 \begin{frame}{stacked AREA}
351 \addgraph{AREA-stack}
352 \end{frame}
354 \mode<article>{\newpage}
356 \begin{frame}{time shift}
357 \addgraph{SHIFT-simple}
358 \end{frame}
360 \begin{frame}{shifting with extra data}
361 \addgraph{SHIFT-startdef}
362 \end{frame}
364 \mode<article>{A normal \texttt{DEF} line requests exactly as much data as it
365 requires for drawing the graph. If you \texttt{SHIFT} the data, you
366 may want to adjust the data fetched accordingly.}
368 \mode<article>{\newpage}
369 \section{Revers Polish Notation (RPN) Math}
371 \mode<article>{RRDtool lets you apply math operations to the data
372   prior to showing it to the user. It uses RPN math for this. If you
373   ever owned a classic HP calculator, you may still remember how RPN
374   math works. For all the others there is a little example below,
375   that shows how to do a little addition in RPN.}
377 \begin{frame}[fragile]{RPN basics: Step 0}
378 $15+23=38$
379 \begin{alltt}
380             1: NAN
381             2: NAN
382             3: NAN
383 \end{alltt}
384 \end{frame}
385 \begin{frame}[fragile]{RPN basics: Step 1}
386 $\mathbf{15}+23=38$
387 \begin{alltt}
388 [15]        1: \textbf{15}
389             2: NAN
390             3: NAN
391 \end{alltt}
392 \end{frame}
393 \begin{frame}[fragile]{RPN basics: Step 2}
394 $15+\mathbf{23}=38$
395 \begin{alltt}
396 [23]        1: \textbf{23}
397             2: 15
398             3: NAN
399 \end{alltt}
400 \end{frame}
401 \begin{frame}[fragile]{RPN basics: Step 3}
402 $15\mathbf{+}23=38$
403 \begin{alltt}
404 [+]         1: \textbf{38}
405             2: NAN
406             3: NAN
407 \end{alltt}
408 \end{frame}
411 \begin{frame}{math in the graph (+)}
412 \addgraph{RPN-simple}
413 \end{frame}
415 \mode<article>{A simple addition. We add a fixed value to a data
416   source. Note that at least one data source must appear inside a CDEF
417   expression. The input to a CDEF expression can come from another
418   CDEF expression.}
420 \begin{frame}{the MAX function}
421 \addgraph{RPN-max}
422 \end{frame}
424 \mode<article>{The MAX function operates on two values. In this example
425   the input comes from two different data sources.}
427 \begin{frame}{the LIMIT function}
428 \addgraph{RPN-limit}
429 \end{frame}
431 \mode<article>{The \texttt{LIMIT} function will return UNKNOWN as soon
432   as the input value is outside the given range. UNKNOWN data does not
433   get drawn.}
435 \begin{frame}{the TREND function}
436 \addgraph{RPN-trend}
437 \end{frame}
439 \mode<article>{If a data source varies massively, the TREND function
440   lets you smooth away by building a moving average. By calculating
441   the average, the output gets shifted by the length of the TREND
442   calculation.}
444 \begin{frame}{the TREND with early start}
445 \addgraph{RPN-trend-start}
446 \end{frame}
448 \mode<article>{In the previous graph there was a bit of data missing
449   at the left border of the graph. This was because rrdgraph loads
450   exactly the amount of data that is required in the graph (yes same
451   story as before). By loading more data, we can provide the TREND
452   function with enough input, so that it can calculate the first few
453   pixels as well.}
455 \mode<article>{\newpage}
457 \begin{frame}{the TREND and SHIFT}
458 \addgraph{RPN-trend-shift}
459 \end{frame}
461 \mode<article>{Another interesting option is to SHIFT the result of
462   the TREND calculation back in time, so that it matches with the
463   source data. This allows us to see more easily when there are
464   'outliners'}
466 \mode<article>{\newpage}
469 \begin{frame}{the IF function}
470 \addgraph{RPN-if}
471 \end{frame}
473 \mode<article>{The IF function requires three items on the stack. It
474   turns \texttt{a,b,c,IF} into \texttt{if a then b else c}. There is a
475   bunch  of operators that go along with the \texttt{IF}: \texttt{LT}
476   less, \texttt{LE} - less or equal, \texttt{EQ} - equal, \texttt{NE}
477   not equal, \texttt{GE} - greater or equal, \texttt{GT} - greater.}
479 \begin{frame}{about invisibility}
480 \addgraph{RPN-UNKN}
481 \end{frame}
483 \mode<article>{Unknown values are not drawn on the graph. Here we
484   use trick to only show the largest values.}
486 \begin{frame}{positional drawing count}
487 \addgraph{RPN-count}
488 \end{frame}
490 \mode<article>{If you are into bar charts, you might fake them with
491   this trick. COUNT, counts the values of the data set. We use this,
492   together with the modulo operator to suppress the drawing of every
493   third entry.}
495 \begin{frame}{access the previous value}
496 \addgraph{RPN-prev}
497 \end{frame}
499 \begin{frame}{positional drawing time}
500 \addgraph{RPN-time}
501 \end{frame}
503 \begin{frame}{positional drawing time-shifting}
504 \addgraph{RPN-time-minus}
505 \end{frame}
507 \mode<article>{There is also a function for accessing the Unix time
508   (seconds since 1970) associated with the graph data. With it, you
509   can make your stripes a fixed number of seconds wide.}
511 \begin{frame}{time and resolution issues}
512 \addgraph{RPN-time-odd}
513 \end{frame}
515 \mode<article>{\newpage}
517 \mode<article>{Whenever RRDtool graph has to do math with data sets
518   that come in different step sizes, it first to adjust the step sizes
519   so that they match. To do this, it finds the greatest common divisor
520   and uses it as the new step size.}
522 \begin{frame}[fragile]{CDEF internals}
523 \begin{itemize}
524 \item data may come in different resolutions
525 \item all items in a CDEF must have the same resolution
526 \item resolution is expanded to greatest common devisor (gcd)
527 \item example: gcd(6,9) = 3, gcd(1,6) = 1
528 \end{itemize}
530 trick: an rrd with one a second step.
531 \begin{alltt}
532 rrdtool create one.rrd --step=1
533    DS:one:GAUGE:2:U:U
534    RRA:AVERAGE:0.5:1:1
535 \end{alltt}
536 \end{frame}
538 \begin{frame}{step=1 trick: high resolution cdef}
539 \addgraph{RPN-time-odd-hires}
540 \end{frame}
542 \mode<article>{By introducing this special rrd with a ``one second
543   step'' the greatest common divisor (gcd) becomes one.}
545 \section{Consolidation functions}
547 \begin{frame}{finding the average}
548 \addgraph{VDEF-average}
549 \end{frame}
551 \begin{frame}{calculating min and max}
552 \addgraph{VDEF-minmax}
553 \end{frame}
556 \mode<article>{\newpage}
558 \begin{frame}[fragile]{min max code example}
559 \begin{alltt}
560 LINE:a#456:a
561 VDEF:max=a,MAXIMUM
562 LINE:max#123
563 VRULE:max#123:maximum
564 GPRINT:max:%.1lf
565 GPRINT:max:%H\(\backslash\):%M\textbf{:strftime}
566 \end{alltt}
567 A VDEF result has a value and a time assigned.
568 \end{frame}
570 \begin{frame}{Least Squares Line (y=x*m+b)}
571 \addgraph{VDEF-lsl}
572 \end{frame}
575 \mode<article>{\newpage}
576 \section{Holt Winters Aberrant Behaviour Detection}
578 \begin{frame}{about alert generation}
579 \begin{itemize}
580 \item when something unexpected happens send an alert\pause
581 \item fixed thresholds are too wide a net\pause
582 \item moving averages weigh all data equal\pause
583 \item holt winters can predict the future\pause
584 \item and no one considers himself clever enough to use it
585 \end{itemize}
586 \end{frame}
588 \begin{frame}{rrd - holt winters assumptions}
589 \begin{itemize}
590 \item data is periodic in nature
591 \item data has continuity 
592 \item data continuity is periodic
593 \item recent data is more important
594 \end{itemize}
595 \end{frame}
597 \begin{frame}{holt winters aberrant behavior}
598 \begin{itemize}
599 \item prediction of future value and confidence band
600 \item confidence band is like a standard deviation
601 \item real value compared to predicted value +/- confidence band
602 \end{itemize}
603 \end{frame}
605 \mode<article>{With holt winters RRDtool will calculate a prediction
606   and a confidence band (think of it as a standard deviation) for the
607   current value. It will then compare the prediction with the
608   actual value. If the actual value falls outside the confidence band
609   of the predicted value (or some multiple of it), then a confidence
610   band violation is registered. If multiple violations are registered
611   within a configurable interval, RRDtool logs a failure.}
613 \begin{frame}<presentation>{holt winters configuration}
614 \begin{itemize}
615 \item HWPREDICT for starters
616 \item tweaking required
617 \item know the knobs to turn
618 \item use real data to test
619 \item FAILURES very short
620 \item \texttt{rrdtool tune} and \texttt{resize}
621 \end{itemize}
622 \end{frame}
624 \mode<article>{
625 \begin{itemize}
626 \item Keep it simple, go for HWPREDICT only when you start using
627   holt winters in RRDtool.
628 \item Every data set is different, tweaking is required. 
629 \item Know which knobs to turn.
630 \item Use real data when experimenting.
631 \item Use \texttt{rrdtool tune} to tweak settings.
632 \item The FAILURES RRA is short!
633 \end{itemize}
636 \begin{frame}{holt winters parameters}
637 \texttt{RRA:HWPREDICT:}\emph{rows}\texttt{:}\emph{alpha}\texttt{:}\emph{beta}\texttt{:}\emph{period}
639 \begin{description}
640 \item[\emph{alpha}:] adaption rate of the baseline (1 fast, 0 slow)
641 \item[\emph{beta}:] adaption rate of the slope (1 fast, 0 slow)
642 \item[\emph{period}:] how many steps in a period (use 1 to  disable)
643 \item[\emph{gamma}:] seasonal adaption rate of the baseline\\(alpha by
644   default)
645 \item[\emph{dev\_gamma}:] seasonal adaption rate of the confidence
646   band\\
647  (gamma by default)
648 \end{description}
650 the gamma and confidence band are tunable with \texttt{rrdtool tune}
651 \end{frame}
653 \mode<article>{
654 Reading \href{http://cricket.sourceforge.net/aberrant/lisa2000_paper.pdf}{Brutlag's original paper}
655 I wrote down the formulas he uses for calculating holt winters. This
656 helped me quite a lot in understanding the relationships between
657 alpha, beta, gamma and delta.}
659 \begin{frame}[fragile]{the rrdtool holt winters formula}
660 \begin{small}
661 \begin{alltt}
662 a - baseline (RRA CDP Parameter)
663 b - slope (RRA CDP Parameter)
664 c - seasonal (SEASONAL RRA)
665 d - deviation (DEVSEASONAL RRA)
666 pred - predicted value
667 real - real value\pause
669 pred\{next\} = a\{now\} + b\{now\} + c\{next_prev_period\}\pause
671 a\{now\} = alpha * (real\{now\} - c\{now_prev_period\}) 
672          + (1-alpha) * ( a\{prev\} + b\{prev\})\pause
673 b\{now\} = beta  * (a\{now\} - a\{prev\}) 
674          + (1-beta) * b_prev\pause
675 c\{now\} = gamma * (real\{now\} - a\{now\}) 
676          + (1-gamma) * c\{now_prev_period\}\pause
677 d\{now\} = dev_gamma * abs(real\{now\} - pred\{now\}) 
678          + (1-dev_gamma) * d\{now_prev_period\}\pause
680 \end{alltt}
681 \end{small}
682 \end{frame}
684 % must be formatted like that
685 % to break gobbling mode!
686 %\mode
687 %<all>
689 \begin{frame}{hw demo: the test data}
690 \addgraph{HW-input}
692 traffic at a peering point
693 \end{frame}
695 \begin{frame}[fragile]{drawing a hw graph}
696 \begin{lstlisting}[language=xml]
697 DEF:in=hw.rrd:in:AVERAGE
698 DEF:pred=hw.rrd:in:HWPREDICT
699 DEF:conf=hw.rrd:in:DEVPREDICT
700 DEF:fail=hw.rrd:in:FAILURES
701 TICK:fail#ff8:1:Failures
702 CDEF:lowconf=pred,conf,2,*,-
703 LINE1:lowconf
704 CDEF:confwidth=conf,4,*
705 AREA:confwidth#cfc:Band:STACK
706 LINE0.1:0#3a1::STACK
707 LINE0.1:lowconf#3a1
708 LINE1:in#c00:InOctets
709 LINE1:pred#0a0:Prediction
710 \end{lstlisting}
711 \end{frame}  
713 \mode<article>{For starters we set the period to 1. This disables HW's
714   ability to adjust to periodic behavior in the data but it lets us
715   better observe the effects of the different parameter settings since
716   the adjustment period is much shorter.}
718 \begin{frame}{hw demo: alpha}
719 \addgraph{HW-p1-a0_5-b0_001}\\
720 \addgraph{HW-p1-a0_1-b0_001}
721 \end{frame}
723 \mode<article>{The smaller the alpha the slower the adaption. As the
724   prediction is now generally off by quite a bit, this causes the
725   confidence band to grow as well.}
727 \mode<article>{\newpage}
729 \begin{frame}{hw demo: beta}
730 \addgraph{HW-p1-a0_1-b0_001}\\
731 \addgraph{HW-p1-a0_1-b0_1}
732 \end{frame}
734 \mode<article>{The larger the beta the `heavier' the prediction
735   becomes.}
737 \begin{frame}{hw demo: period}
738 \addgraph{HW-p1-a0_5-b0_001}\\
739 \addgraph{HW-p48-a0_5-b0_001}
740 \end{frame}
742 \begin{frame}{hw demo: tuning}
743 \addgraph{HW-p48-a0_5-b0_001}\\
744 \addgraph{HW-p48-a0_2-b0_001}
745 \end{frame}
747 \begin{frame}{hw demo: tuning II}
748 \addgraph{HW-p48-a0_2-b0_001}\\
749 \addgraph{HW-p48-a0_03-b0_001}
750 \end{frame}
752 \begin{frame}{hw demo: tuning II}
753 \addgraph{HW-p48-a0_03-b0_001}\\
754 \addgraph{HW-p48-a0_03-b0_1}
755 \end{frame}
757 \section{Real Live Example}
759 \mode<article>{The following example shows how to create a simple
760   traffic grapher with a shell script for data acquisition, and an
761   rrdcgi script to draw the graphs.}
763 \begin{frame}
764 \includegraphics[width=\textwidth]{traffic/codewalk}
765 \end{frame}
767 \begin{frame}[allowframebreaks]{data acquisition}
768 \lstinputlisting[language=bash]{traffic/ifbyteget.sh}
769 \end{frame}
771 \mode<article>{This little bash script polls the network traffic
772   counter from the linux proc tree and reformats it so that it can be
773   fed to rrdtool.}
775 \begin{frame}[allowframebreaks]{rrdcgi: scripting for the poor}
776 \lstinputlisting[language=xml]{traffic/index.cgi}
777 \end{frame}
779 \begin{frame}[allowframebreaks]{rrdcgi: include file function}
780 \lstinputlisting[language=xml]{traffic/graph.inc}
781 \end{frame}
783 \mode<article>{RRDtool's rrdcgi is a very simple scripting engine, that can pick
784   up pseudo xml elements from an html file and execute the
785   coresponding rrdtool commands. In this example we use environment
786   variables and an include file to save us from typing in the same
787   graph definition over and over again.}
789 \mode<presentation>{
790 \begin{frame}
791 \begin{center}
792 \Huge ?
793 \end{center}
794 \end{frame}
795 \begin{frame}
796 \begin{center}
797 Tobi Oetiker <tobi@oetiker.ch>
798 \end{center}
799 \end{frame}
802 \mode<article>{
803 \vspace{\stretch{1}}
804 Tobias Oetiker <tobi@oetiker.ch>
806 \end{document}
807 %%% Local Variables:
808 %%% TeX-master: "presentation.tex"
809 %%% mode: flyspell
810 %%% TeX-PDF-mode: t
811 %%% End: