From 70574e07b333dfbeb9ad799a4e55a5fb96bbe809 Mon Sep 17 00:00:00 2001 From: Cheolgoo Kang Date: Sat, 16 Nov 2013 00:49:57 +0000 Subject: [PATCH] Fix to specify more than one index of metrics separated with comma as the "index" parameter. --- README.md | 2 +- lib/dusk/public/js/dusk.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ff8807f..7c49888 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This project should still be considered beta software. There are known performan Dusk is designed to be simple and purpose-driven. Any string passed to the `/metrics/` endpoint (including wildcards) will be used as the search context. All metrics found by the Graphite server will be returned and rendered live. -For example, loading `/metrics/collectd.*.load.load.shortterm` will render the `shortterm` metric for all servers in your Graphite instance. Adding the `index` param to your URL defines which (zero-indexed) node should be used as the metric alias. +For example, loading `/metrics/collectd.*.load.load.shortterm` will render the `shortterm` metric for all servers in your Graphite instance. Adding the `index` param to your URL defines which (zero-indexed) node should be used as the metric alias. (You can also specify multiple nodes with comma like `?index=1,3,5`.) ![usage](https://github.com/obfuscurity/dusk/raw/master/lib/dusk/public/img/screenshot-usage.png) diff --git a/lib/dusk/public/js/dusk.js b/lib/dusk/public/js/dusk.js index 5eeeba9..526cd58 100644 --- a/lib/dusk/public/js/dusk.js +++ b/lib/dusk/public/js/dusk.js @@ -38,8 +38,14 @@ var Dusk = function(target) { var metrics = [] for (var i=0; i 0) { alias += '.'; } + alias += resultsArr[parseInt(ind,10)]; + }); + metric.alias(alias); metrics.push(metric) } d3.select('div.wrapper').selectAll('.horizon')