Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test to verify metric name sanitizing in Graphite.

  • Loading branch information...
commit c89fcb25c3a44732061db339197fc69c01603b09 1 parent 44106cc
@mheffner authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 test/graphite_tests.js
View
19 test/graphite_tests.js
@@ -358,5 +358,24 @@ module.exports = {
});
});
});
+ },
+
+ metric_names_are_sanitized: function(test) {
+ var me = this;
+ this.acceptor.once('connection', function(c) {
+ statsd_send('fo/o:250|c',me.sock,'127.0.0.1',8125,function(){
+ statsd_send('b ar:250|c',me.sock,'127.0.0.1',8125,function(){
+ statsd_send('foo+bar:250|c',me.sock,'127.0.0.1',8125,function(){
+ collect_for(me.acceptor, me.myflush, function(strings){
+ var str = strings.join();
+ test.ok(str.indexOf('fo-o') !== -1, "Did not map 'fo/o' => 'fo-o'");
+ test.ok(str.indexOf('b_ar') !== -1, "Did not map 'b ar' => 'b_ar'");
+ test.ok(str.indexOf('foobar') !== -1, "Did not map 'foo+bar' => 'foobar'");
+ test.done();
+ });
+ });
+ });
+ });
+ });
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.