Differences

This shows you the differences between two versions of the page.

Link to this comparison view

saisp:labs:03:contents:05 [2014/04/04 10:55]
razvan.deaconescu [05. [20p] Baze de date Round Robin (RRD)]
saisp:labs:03:contents:05 [2014/04/05 12:08] (current)
mihai.carabas [05. [20p] Baze de date Round Robin (RRD)]
Line 42: Line 42:
 rm -rf target.rrd rm -rf target.rrd
  
-#obtinem data de inceput +Init timestamp. 
-data=$(date +%s)+timestamp=$(date +%s)
  
-#o facem multiplu de +Align timestamp to multiple of seconds. 
-data=$(($data/5*5)) +timestamp=$(($timestamp/5*5)) 
-data_init=$data+init_timestamp=$timestamp
  
 rrdtool create target.rrd \ rrdtool create target.rrd \
-         ​--start $data \+         ​--start $timestamp ​\
          ​--step 5 \          ​--step 5 \
          ​DS:​speedIn:​COUNTER:​10:​U:​U \          ​DS:​speedIn:​COUNTER:​10:​U:​U \
Line 59: Line 59:
 for i in $(seq 1 24); do for i in $(seq 1 24); do
    sleep 5    sleep 5
-   data=$(($data + 5))+   timestamp=$(($timestamp ​+ 5))
  
    ​outOctets=$(...)    ​outOctets=$(...)
    ​inOctets=$(...)    ​inOctets=$(...)
  
-   ​rrdtool update target.rrd ​ $data:​$inOctets:​$outOctets+   ​rrdtool update target.rrd ​ $timestamp:​$inOctets:​$outOctets
 done done
  
-echo --start $data_init ​--end $data+echo --start $init_timestamp ​--end $timestamp
 </​file>​ </​file>​
 <​solution -hidden> <​solution -hidden>
saisp/labs/03/contents/05.1396598141.txt.gz · Last modified: 2014/04/04 10:55 by razvan.deaconescu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0