Revision d04b8a5c graphs/models.py
b/graphs/models.py | ||
---|---|---|
152 | 152 |
tempstack = tempstack + ':STACK' |
153 | 153 |
tempgraphargs.append(tempstack) |
154 | 154 |
if grds.legend != '': |
155 |
tempgraphargs.append('%s:%s%s:%s:%s' % ( 'GPRINT', grname, grds.args, 'MAX', '\tMax\: %4.2lf%s\g' )) |
|
156 |
tempgraphargs.append('%s:%s%s:%s:%s' % ( 'GPRINT', grname, grds.args, 'MIN', '\tMin\: %4.2lf%s\g' )) |
|
157 |
tempgraphargs.append('%s:%s%s:%s:%s' % ( 'GPRINT', grname, grds.args, 'AVERAGE', '\tAvg\: \t%4.2lf%s\g' )) |
|
158 |
tempgraphargs.append('%s:%s%s:%s:%s' % ( 'GPRINT', grname, grds.args, 'LAST', '\tLast\: %4.2lf%s\\n' )) |
|
159 |
|
|
155 |
tempgraphargs.append('%s:%s%s:%s:%s' % ( 'GPRINT', grname, grds.args, 'MAX', 'Max\: %6.2lf%s' )) |
|
156 |
tempgraphargs.append('%s:%s%s:%s:%s' % ( 'GPRINT', grname, grds.args, 'MIN', 'Min\: %6.2lf%s' )) |
|
157 |
tempgraphargs.append('%s:%s%s:%s:%s' % ( 'GPRINT', grname, grds.args, 'AVERAGE', 'Avg\: %6.2lf%s' )) |
|
158 |
tempgraphargs.append('%s:%s%s:%s:%s' % ( 'GPRINT', grname, grds.args, 'LAST', 'Last\: %6.2lf%s\\n' )) |
|
160 | 159 |
|
161 | 160 |
if self.pc95: |
162 | 161 |
pc95cdef = pc95cdef + grname + grds.args + ',' |
... | ... | |
186 | 185 |
if self.pc95: |
187 | 186 |
args.append('COMMENT: \\n') |
188 | 187 |
args.append('HRULE:pc95#ff0000a0:95th Percentile\::dashes') |
189 |
args.append('GPRINT:pc95:%4.2lf%s\\n') |
|
190 |
|
|
188 |
args.append('GPRINT:pc95:%6.2lf%s\\n') |
|
191 | 189 |
# This is for rrdtool which hates unicode |
192 | 190 |
args=[str(val) for val in args] |
193 | 191 |
try: |
... | ... | |
215 | 213 |
tojson['data'] = v |
216 | 214 |
tojson['graph'] = self.pk |
217 | 215 |
tojson['lunpk'] = Lun.objects.get(pk=int(self.tags.get(name__contains='lun').name.replace('lun:',''))).pk |
218 |
#tojson['ds'] = graphdss.get(name=k).tags.get(name__startswith='ds').name |
|
219 |
#tojson['avg'] = reduce(lambda x, y: x+y, map(lambda x:x[1], v)) / len(v) |
|
220 | 216 |
tojson['avg'] = na.mean() |
221 | 217 |
tojson['dev'] = na.std() |
222 | 218 |
json_ret.append(tojson) |
Also available in: Unified diff