Skip to content
Browse files

Filter out some server names

  • Loading branch information...
1 parent e5b2ee2 commit 0e43814114b50f7386df7f36585bddd74109dc14 @oli99sc committed Aug 13, 2012
Showing with 8 additions and 10 deletions.
  1. +8 −10 stats.js
View
18 stats.js
@@ -9,26 +9,24 @@ var debugInt, flushInt, server;
function measureForKey (key, fields){
var sampleRate = 1;
+ var prefix = 'other.unknownHosts' ;
var finalKey = key;
if (fields[1] === undefined) {
sys.log('Bad line: ' + fields);
} else {
+ if (!(fields[3] === undefined)) {
+ prefix = fields[3].replace(/devbui([0-9]{2})_[a-zA-Z0-9_]*?/g, 'bui')
+ .replace(/dev([0-9]{4})_[a-zA-Z0-9_]*?/g, 'localdev')
+ .replace(/isdebln[a-zA-Z]{2}([0-9]{2})_[a-zA-Z0-9_]*?/ig, 'localdev')
+ }
if (fields[1].trim() == "ms") {
- if (!(fields[3] === undefined)) {
- finalKey = fields[3] + '.timers.' + key ;
- } else {
- finalKey = 'other.unknownHosts.timers.' + key ;
- }
+ finalKey = prefix + '.timers.' + key ;
if (! timers[finalKey]) {
timers[finalKey] = [];
}
timers[finalKey].push(Number(fields[0] || 0));
} else {
- if (!(fields[3] === undefined)) {
- finalKey = fields[3] + "." + key ;
- } else {
- finalKey = 'other.unknownHosts.' + key ;
- }
+ finalKey = prefix + '.' + key ;
if (fields[2] && fields[2].match(/^@([\d\.]+)/)) {
sampleRate = Number(fields[2].match(/^@([\d\.]+)/)[1]);
}

0 comments on commit 0e43814

Please sign in to comment.
Something went wrong with that request. Please try again.