From f6728cfbfe8b9f7ce4a7b9afa0db5131c0d8d85a Mon Sep 17 00:00:00 2001 From: oetiker Date: Sat, 4 Oct 2008 22:35:49 +0000 Subject: [PATCH] added v-interface example git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1577 a5681a0c-68f1-0310-ab6d-d61299d08faa --- tutorial/lisa2008/rrd-by-example/body.tex | 28 ++++++++++++++++++- .../rrd-by-example/ex/v-interfaces.pl | 16 +++++++++++ .../rrd-by-example/ex/v-interfaces.txt | 9 ++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 tutorial/lisa2008/rrd-by-example/ex/v-interfaces.pl create mode 100644 tutorial/lisa2008/rrd-by-example/ex/v-interfaces.txt diff --git a/tutorial/lisa2008/rrd-by-example/body.tex b/tutorial/lisa2008/rrd-by-example/body.tex index 6229a87d..461a7d5c 100644 --- a/tutorial/lisa2008/rrd-by-example/body.tex +++ b/tutorial/lisa2008/rrd-by-example/body.tex @@ -759,11 +759,37 @@ LINE1:pred#0a0:Prediction \addgraph{HW-p48-a0_03-b0_001} \end{frame} -\begin{frame}{hw demo: tuning II} +\begin{frame}{hw demo: tuning III} \addgraph{HW-p48-a0_03-b0_001}\\ \addgraph{HW-p48-a0_03-b0_1} \end{frame} +\newpage + +\section{The *v Interfaces} + +\begin{frame}{graphv script} +\lstinputlisting{ex/v-interfaces.pl} +\end{frame} + +\begin{frame}{graphv output} +\lstinputlisting{ex/v-interfaces.txt} +\end{frame} + +\mode
{The image key only shows up when the graph file name is '-'.} + +\begin{frame}{v-interfaces} +\begin{itemize} +\item rrdtool info +\item rrdtool update\textbf{v} +\item rrdtool graph\textbf{v} +\end{itemize} +\end{frame} + +\mode
{Using the output of updatev is much more efficient than +re-reading the rrd file after running normal update against them.} + +\newpage \section{Real Live Example} \mode
{The following example shows how to create a simple diff --git a/tutorial/lisa2008/rrd-by-example/ex/v-interfaces.pl b/tutorial/lisa2008/rrd-by-example/ex/v-interfaces.pl new file mode 100644 index 00000000..0dcdc0a6 --- /dev/null +++ b/tutorial/lisa2008/rrd-by-example/ex/v-interfaces.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl -w +use strict; +use lib qw( /scratch/rrd4/lib/perl ); +use RRDs; +my $out = RRDs::graphv( + '-', '--start' => '00:00 20080916', + '--end' => 'start+8d', + '--lower-limit' => 0, + '--imgformat' => 'PDF', + 'DEF:a=hw-demo.rrd:in:AVERAGE', + 'LINE1:a#c00:InOctets'); +my $ERROR = RRDs::error; +die "ERROR: $ERROR\n" if $ERROR; +map { + print $_.' = '.substr($out->{$_},0,8)."\n" +} sort keys %$out; diff --git a/tutorial/lisa2008/rrd-by-example/ex/v-interfaces.txt b/tutorial/lisa2008/rrd-by-example/ex/v-interfaces.txt new file mode 100644 index 00000000..452a4661 --- /dev/null +++ b/tutorial/lisa2008/rrd-by-example/ex/v-interfaces.txt @@ -0,0 +1,9 @@ +graph_height = 100 +graph_left = 51 +graph_top = 22 +graph_width = 400 +image = %PDF-1.4 +image_height = 163 +image_width = 481 +value_max = 60000000 +value_min = 0 -- 2.30.2