self.grapher = grapher
self.putChild('', self)
+
self.putChild('poolrate_day', Renderer('--lower-limit', '0', '--start', '-1d',
- 'DEF:A=%s.poolrate:poolrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Pool hash rate (last day)'))
+ 'DEF:A=%s.poolrate:poolrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Total (last day)',
+ 'DEF:B=%s.localrate:localrate:AVERAGE' % (self.grapher.path,), 'LINE1:B#0000FF:Local (last day)'))
self.putChild('poolrate_week', Renderer('--lower-limit', '0', '--start', '-1w',
- 'DEF:A=%s.poolrate:poolrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Pool hash rate (last week)'))
+ 'DEF:A=%s.poolrate:poolrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Total (last week)',
+ 'DEF:B=%s.localrate:localrate:AVERAGE' % (self.grapher.path,), 'LINE1:B#0000FF:Local (last week)'))
self.putChild('poolrate_month', Renderer('--lower-limit', '0', '--start', '-1m',
- 'DEF:A=%s.poolrate:poolrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Pool hash rate (last month)'))
+ 'DEF:A=%s.poolrate:poolrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Total (last month)',
+ 'DEF:B=%s.localrate:localrate:AVERAGE' % (self.grapher.path,), 'LINE1:B#0000FF:Local (last month)'))
+
self.putChild('localrate_day', Renderer('--lower-limit', '0', '--start', '-1d',
- 'DEF:A=%s.localrate:localrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Local hash rate (last day)'))
+ 'DEF:A=%s.localrate:localrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Total (last day)',
+ 'DEF:B=%s.localdeadrate:localdeadrate:AVERAGE' % (self.grapher.path,), 'LINE1:B#FF0000:Dead (last day)'))
self.putChild('localrate_week', Renderer('--lower-limit', '0', '--start', '-1w',
- 'DEF:A=%s.localrate:localrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Local hash rate (last week)'))
+ 'DEF:A=%s.localrate:localrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Total (last week)',
+ 'DEF:B=%s.localdeadrate:localdeadrate:AVERAGE' % (self.grapher.path,), 'LINE1:B#FF0000:Dead (last week)'))
self.putChild('localrate_month', Renderer('--lower-limit', '0', '--start', '-1m',
- 'DEF:A=%s.localrate:localrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Local hash rate (last month)'))
+ 'DEF:A=%s.localrate:localrate:AVERAGE' % (self.grapher.path,), 'LINE1:A#0000FF:Total (last month)',
+ 'DEF:B=%s.localdeadrate:localdeadrate:AVERAGE' % (self.grapher.path,), 'LINE1:B#FF0000:Dead (last month)'))
def render_GET(self, request):
if not request.path.endswith('/'):
'RRA:AVERAGE:0.5:7:288', # last week
'RRA:AVERAGE:0.5:30:288', # last month
)
+ if not os.path.exists(self.path + '.localdeadrate'):
+ rrdtool.create(self.path + '.localdeadrate', '--step', '300', '--no-overwrite',
+ 'DS:localdeadrate:ABSOLUTE:43200:U:U',
+ 'RRA:AVERAGE:0.5:1:288', # last day
+ 'RRA:AVERAGE:0.5:7:288', # last week
+ 'RRA:AVERAGE:0.5:30:288', # last month
+ )
def add_poolrate_point(self, poolrate):
rrdtool.update(self.path + '.poolrate', '-t', 'poolrate', 'N:%f' % (poolrate,))
- def add_localrate_point(self, hashes):
+ def add_localrate_point(self, hashes, dead):
rrdtool.update(self.path + '.localrate', '-t', 'localrate', 'N:%f' % (hashes,))
+ rrdtool.update(self.path + '.localdeadrate', '-t', 'localdeadrate', 'N:%f' % (hashes if dead else 0,))
def get_resource(self):
return Resource(self)