本文整理汇总了Python中pyrrd.rrd.RRD.getData方法的典型用法代码示例。如果您正苦于以下问题:Python RRD.getData方法的具体用法?Python RRD.getData怎么用?Python RRD.getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyrrd.rrd.RRD
的用法示例。
在下文中一共展示了RRD.getData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: graph
# 需要导入模块: from pyrrd.rrd import RRD [as 别名]
# 或者: from pyrrd.rrd.RRD import getData [as 别名]
def graph(req, rrd):
if os.path.isfile(rrdPath+rrd):
filename = rrd
rrd = RRD(rrdPath+rrd, mode='r')
info = rrd.getData()
info['filename'] = filename
return render_to_response('rrd/graph.html', {'info': info})
示例2: data
# 需要导入模块: from pyrrd.rrd import RRD [as 别名]
# 或者: from pyrrd.rrd.RRD import getData [as 别名]
def data(req, rrd, ds, rra):
if os.path.isfile(rrdPath+rrd):
rrd = RRD(rrdPath+rrd, mode='r')
info = rrd.getData()
step = info[rra]['step']
start = info['lastupdate'] - info[rra]['rows']*step
data = rrd.fetch(resolution=step, start=start, end=info['lastupdate'])
return HttpResponse(simplejson.dumps(data))
示例3: dumpfileinfo
# 需要导入模块: from pyrrd.rrd import RRD [as 别名]
# 或者: from pyrrd.rrd.RRD import getData [as 别名]
def dumpfileinfo(self):
#rrds = os.walk(self.path)
mylist = []
for root, dir, files in os.walk(self.path):
for sfile in files:
filename = os.path.join(root, sfile)
subpath = filename[len(self.path):]
rrd = RRD(filename, mode='r')
info = rrd.getData()
for i in rrd.ds:
mylist.append((self,subpath,sfile,i.name),)
return mylist
示例4: DEF
# 需要导入模块: from pyrrd.rrd import RRD [as 别名]
# 或者: from pyrrd.rrd.RRD import getData [as 别名]
myRRD.bufferValue('920805600', '12363')
myRRD.bufferValue('920805900', '12363')
myRRD.bufferValue('920806200', '12373')
myRRD.bufferValue('920806500', '12383')
myRRD.bufferValue('920806800', '12393')
myRRD.bufferValue('920807100', '12399')
myRRD.bufferValue('920807400', '12405')
myRRD.bufferValue('920807700', '12411')
myRRD.bufferValue('920808000', '12415')
myRRD.bufferValue('920808300', '12420')
myRRD.bufferValue('920808600', '12422')
myRRD.bufferValue('920808900', '12423')
myRRD.update()
print "myRRD info:",myRRD.info()
print "myRRD Data:",myRRD.getData()
def1 = DEF(rrdfile=myRRD.filename, vname='myspeed', dsName=dataSource.name)
cdef1 = CDEF(vname='kmh', rpn='%s,3600,*' % def1.vname)
cdef2 = CDEF(vname='fast', rpn='kmh,100,GT,kmh,0,IF')
cdef3 = CDEF(vname='good', rpn='kmh,100,GT,0,kmh,IF')
vdef1 = VDEF(vname='mymax', rpn='%s,MAXIMUM' % def1.vname)
vdef2 = VDEF(vname='myavg', rpn='%s,AVERAGE' % def1.vname)
#line1 = LINE(value=100, color='#990000', legend='Maximum Allowed')
area1 = AREA(defObj=cdef3, color='#006600', legend='Good Speed')
area2 = AREA(defObj=cdef2, color='#CC6633', legend='Too Fast')
line2 = LINE(defObj=vdef2, color='#000099', legend='My Average')
gprint1 = GPRINT(vdef2, '%6.3lf kph')