Skip to content

Commit

Permalink
Avoid trailing and leading _ in column names
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadu committed Sep 18, 2015
1 parent f8ec695 commit 25da17e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Influxer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,15 @@ private static async Task<bool> ProcessPerfMonLog(string InputFileName, HttpClie
//get the column headers
var column = 1;
var influxIdentifiers = new char[]{' ',';','_','(',')','%'};
var whiteSpace = new char[]{'_'};
pecrfCounters.AddRange (columns.Skip (1).Where (s => s.StartsWith ("\\")).Select (p =>
p.Replace (influxIdentifiers, "_").Split ('\\')).Select (p =>
new PerfmonCounter ()
{
ColumnIndex = column++,
Host = p[2],
PerformanceObject = p[3],
CounterName = p[4]
Host = p[2].Trim(whiteSpace),
PerformanceObject = p[3].Trim(whiteSpace),
CounterName = p[4].Trim(whiteSpace)
}));
perfGourp = pecrfCounters.GroupBy (p => p.PerformanceObject);

Expand Down

0 comments on commit 25da17e

Please sign in to comment.