Skip to content

Instantly share code, notes, and snippets.

@rnewson
Created September 3, 2014 20:25
Show Gist options
  • Save rnewson/dc9c8dd3f456af8c31b7 to your computer and use it in GitHub Desktop.
Save rnewson/dc9c8dd3f456af8c31b7 to your computer and use it in GitHub Desktop.
var test_metrics = function(metrics) {
if (metrics.type === "counter") {
test_counter(metrics);
} else if (metrics.type === "histogram") {
test_histogram(metrics);
} else {
for (var k in metrics) {
test_metrics(metrics[k]);
}
}
};
(function() {
var summary = JSON.parse(CouchDB.request("GET", "/_stats", {
headers: {"Accept": "application/json"}
}).responseText);
T(typeof(summary) === 'object');
test_metrics(summary);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment