def metrics(request): """Add metrics to the context.""" if 'djangojs' in request.path: return {} else: return { 'grouped_metrics': registry.by_group(), 'registered_metrics': registry, }
def get_metrics(self): metrics_grouped = registry.by_group() new_metrics = OrderedDict() for name, metrics in metrics_grouped.items(): new_metrics[name] = [m['name'] for m in metrics] return new_metrics