From 893fa59aa642b06be60af729ddc6d43cbd1527c1 Mon Sep 17 00:00:00 2001
From: Lauri Niskanen <ape@ape3000.com>
Date: Mon, 11 Jan 2016 00:31:45 +0200
Subject: [PATCH] Use 1 second data points

- Previously 10 second data points were used.
- This commit also sets smoothing and wantlist scaling to work well with the
  new interval.
---
 ipfs-collect | 4 ++--
 ipfs-graph   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ipfs-collect b/ipfs-collect
index 972b48c..f404ebf 100755
--- a/ipfs-collect
+++ b/ipfs-collect
@@ -5,7 +5,7 @@ rrd_file=ipfs.rrd
 data_file=data
 
 if ! [ -e "$rrd_file" ]; then
-  rrdtool create "$rrd_file" -s 10 --no-overwrite \
+  rrdtool create "$rrd_file" -s 1 --no-overwrite \
     DS:data_in:DERIVE:10:0:U \
     DS:bw_total_in:DERIVE:10:0:U \
     DS:bw_total_out:DERIVE:10:0:U \
@@ -18,7 +18,7 @@ if ! [ -e "$rrd_file" ]; then
     RRA:LAST:0.5:1:8640
 fi
 
-while printf '\n'; sleep 5; do :; done | while read l; do
+while printf '\n'; sleep 0.5; do :; done | while read l; do
   data_in=U
   bw_total_in=U
   bw_total_out=U
diff --git a/ipfs-graph b/ipfs-graph
index c3eaf79..5c61a97 100755
--- a/ipfs-graph
+++ b/ipfs-graph
@@ -3,8 +3,8 @@ set -eu
 
 rrd_file=ipfs.rrd
 graph_file=ipfs.png
-smoothing=120
-wantlist_scale=0.001
+smoothing=0
+wantlist_scale=0.00002
 
 rrdtool graph "$graph_file" -e now -s 'end-2h' -w 800 -h 400 -a PNG -E -Y \
   --vertical-label "B/s" \