def get_metric_counter(slug): c = counter.get(slug) d = { 'name': slug, 'data': list(c.timestamp_items()) } return jsonify(d)
def index(): count = len(counter.get("index view")) render_metric = record.get("index render") minimum_val = render_metric.min() maximum_val = render_metric.max() counter.incr("index view") return """ %s<br/> <br/> %s - min<br/> %s - max """ % (count, minimum_val, maximum_val)