~heckj/pyrrd/devtest

« back to all changes in this revision

Viewing changes to sandbox/oubiwann/file-format/1ds1rra2entry.py

  • Committer: Duncan McGreggor
  • Date: 2009-12-18 07:54:04 UTC
  • Revision ID: duncan@canonical.com-20091218075404-ow2wg9sli4qjss7w
2009.12.18
* Added a sandbox with some files for exploring Python-native RRD-read support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
 
 
3
from pyrrd.rrd import RRD, RRA, DS
 
4
from pyrrd.graph import DEF, CDEF, VDEF
 
5
from pyrrd.graph import LINE, AREA, GPRINT
 
6
from pyrrd.graph import ColorAttributes, Graph
 
7
 
 
8
 
 
9
filename = '%s.rrd' % os.path.splitext(os.path.basename(__file__))[0]
 
10
 
 
11
# Let's create and RRD file and dump some data in it
 
12
dss = []
 
13
rras = []
 
14
ds1 = DS(dsName='speed', dsType='COUNTER', heartbeat=600)
 
15
dss.append(ds1)
 
16
rra1 = RRA(cf='AVERAGE', xff=0.5, steps=1, rows=24)
 
17
rras.extend([rra1])
 
18
myRRD = RRD(filename, ds=dss, rra=rras, start=920804400)
 
19
myRRD.create()
 
20
myRRD.bufferValue('920805600', '12363')
 
21
myRRD.bufferValue('920806100', '12364')
 
22
myRRD.update()