@@ -10,7 +10,6 @@ namespace VirtualClient.Actions
10
10
using MathNet . Numerics . Statistics ;
11
11
using VirtualClient ;
12
12
using VirtualClient . Contracts ;
13
- using VirtualClient . Contracts . Parser ;
14
13
15
14
/// <summary>
16
15
/// Parser for Redis Memtier benchmark output.
@@ -68,34 +67,29 @@ public static IList<Metric> Aggregate(IEnumerable<Metric> metrics)
68
67
// Create the set of metric aggregates.
69
68
//
70
69
// e.g.
71
- // GET_Bandwidth -> GET_Bandwidth-Avg
72
- // -> GET_Bandwidth-Min
73
- // -> GET_Bandwidth-Max
74
- // -> GET_Bandwidth-Stddev
75
- // -> GET_Bandwidth- P80
76
- // -> GET_Bandwidth-Total
70
+ // GET_Bandwidth -> GET-Bandwidth AVG
71
+ // -> GET-Bandwidth MIN
72
+ // -> GET-Bandwidth MAX
73
+ // -> GET-Bandwidth STDDEV
74
+ // -> GET-Bandwidth P80
75
+ // -> GET-Bandwidth TOTAL
77
76
List < Metric > metricAggregates = new List < Metric > ( ) ;
78
77
foreach ( MetricAggregate aggregate in aggregations . Values )
79
78
{
80
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } - Avg", aggregate . Average ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
81
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } - Min", aggregate . Min ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
82
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } - Max", aggregate . Max ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
83
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } - Stddev", aggregate . StandardDeviation ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
79
+ metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } Avg", aggregate . Average ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
80
+ metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } Min", aggregate . Min ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
81
+ metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } Max", aggregate . Max ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
82
+ metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } Stddev", aggregate . StandardDeviation ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
84
83
85
84
if ( MemtierMetricsParser . BandwidthExpression . IsMatch ( aggregate . Name ) )
86
85
{
87
86
// e.g.
88
- // GET_Bandwidth-P80
89
- // GET_Bandwidth-Total
90
- // GET_Throughput-P80
91
- // GET_Throughput-Total
92
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } -P50", aggregate . Percentile ( 50 ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
93
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } -P80", aggregate . Percentile ( 80 ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
94
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } -P90", aggregate . Percentile ( 90 ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
95
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } -P95", aggregate . Percentile ( 95 ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
96
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } -P99", aggregate . Percentile ( 99 ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
97
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } -P99.9", ArrayStatistics . QuantileInplace ( aggregate . ToArray ( ) , 0.999d ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
98
- metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } -Total", aggregate . Sum ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
87
+ // GET-Bandwidth P80
88
+ // GET-Bandwidth TOTAL
89
+ metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } P20", aggregate . Percentile ( 20 ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
90
+ metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } P50", aggregate . Percentile ( 50 ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
91
+ metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } P80", aggregate . Percentile ( 80 ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
92
+ metricAggregates . Add ( new Metric ( $ "{ aggregate . Name } Total", aggregate . Sum ( ) , aggregate . Unit , aggregate . Relativity , description : aggregate . Description ) ) ;
99
93
}
100
94
}
101
95
@@ -324,77 +318,77 @@ private static IDictionary<string, MetricAggregate> CreateMetricsBin(string metr
324
318
{
325
319
"Ops/sec" ,
326
320
new MetricAggregate (
327
- metricNamePrefix == null ? "Throughput" : $ "{ metricNamePrefix } _Throughput ",
321
+ metricNamePrefix == null ? "Throughput" : $ "{ metricNamePrefix } -Throughput ",
328
322
metricUnit : MetricUnit . RequestsPerSec ,
329
323
relativity : MetricRelativity . HigherIsBetter ,
330
324
description : "Total number of requests/operations per second during the period of time." )
331
325
} ,
332
326
{
333
327
"Hits/sec" ,
334
328
new MetricAggregate (
335
- metricNamePrefix == null ? "Hits/sec" : $ "{ metricNamePrefix } _Hits /sec",
329
+ metricNamePrefix == null ? "Hits/sec" : $ "{ metricNamePrefix } -Hits /sec",
336
330
relativity : MetricRelativity . HigherIsBetter ,
337
331
description : "Total number of cache hits per second during the period of time." )
338
332
} ,
339
333
{
340
334
"Misses/sec" ,
341
335
new MetricAggregate (
342
- metricNamePrefix == null ? "Misses/sec" : $ "{ metricNamePrefix } _Misses /sec",
336
+ metricNamePrefix == null ? "Misses/sec" : $ "{ metricNamePrefix } -Misses /sec",
343
337
relativity : MetricRelativity . LowerIsBetter ,
344
338
description : "Total number of cache misses per second during a period of time. This is an indication of data evictions due to reaching memory limits." )
345
339
} ,
346
340
{
347
341
"AvgLatency" ,
348
342
new MetricAggregate (
349
- metricNamePrefix == null ? "Latency-Avg" : $ "{ metricNamePrefix } _Latency -Avg",
343
+ metricNamePrefix == null ? "Latency-Avg" : $ "{ metricNamePrefix } -Latency -Avg",
350
344
metricUnit : MetricUnit . Milliseconds ,
351
345
relativity : MetricRelativity . LowerIsBetter ,
352
346
description : "Average latency for requests/operations during the period of time." )
353
347
} ,
354
348
{
355
349
"p50Latency" ,
356
350
new MetricAggregate (
357
- metricNamePrefix == null ? "Latency-P50" : $ "{ metricNamePrefix } _Latency -P50",
351
+ metricNamePrefix == null ? "Latency-P50" : $ "{ metricNamePrefix } -Latency -P50",
358
352
metricUnit : MetricUnit . Milliseconds ,
359
353
relativity : MetricRelativity . LowerIsBetter ,
360
354
description : "The latency for 50% of all requests was at or under this value." )
361
355
} ,
362
356
{
363
357
"p90Latency" ,
364
358
new MetricAggregate (
365
- metricNamePrefix == null ? "Latency-P90" : $ "{ metricNamePrefix } _Latency -P90",
359
+ metricNamePrefix == null ? "Latency-P90" : $ "{ metricNamePrefix } -Latency -P90",
366
360
metricUnit : MetricUnit . Milliseconds ,
367
361
relativity : MetricRelativity . LowerIsBetter ,
368
362
description : "The latency for 90% of all requests was at or under this value." )
369
363
} ,
370
364
{
371
365
"p95Latency" ,
372
366
new MetricAggregate (
373
- metricNamePrefix == null ? "Latency-P95" : $ "{ metricNamePrefix } _Latency -P95",
367
+ metricNamePrefix == null ? "Latency-P95" : $ "{ metricNamePrefix } -Latency -P95",
374
368
metricUnit : MetricUnit . Milliseconds ,
375
369
relativity : MetricRelativity . LowerIsBetter ,
376
370
description : "The latency for 95% of all requests was at or under this value." )
377
371
} ,
378
372
{
379
373
"p99Latency" ,
380
374
new MetricAggregate (
381
- metricNamePrefix == null ? "Latency-P99" : $ "{ metricNamePrefix } _Latency -P99",
375
+ metricNamePrefix == null ? "Latency-P99" : $ "{ metricNamePrefix } -Latency -P99",
382
376
metricUnit : MetricUnit . Milliseconds ,
383
377
relativity : MetricRelativity . LowerIsBetter ,
384
378
description : "The latency for 99% of all requests was at or under this value." )
385
379
} ,
386
380
{
387
381
"p99.9Latency" ,
388
382
new MetricAggregate (
389
- metricNamePrefix == null ? "Latency-P99.9" : $ "{ metricNamePrefix } _Latency -P99.9",
383
+ metricNamePrefix == null ? "Latency-P99.9" : $ "{ metricNamePrefix } -Latency -P99.9",
390
384
metricUnit : MetricUnit . Milliseconds ,
391
385
relativity : MetricRelativity . LowerIsBetter ,
392
386
description : "The latency for 99.9% of all requests was at or under this value." )
393
387
} ,
394
388
{
395
389
"KB/sec" ,
396
390
new MetricAggregate (
397
- metricNamePrefix == null ? "Bandwidth" : $ "{ metricNamePrefix } _Bandwidth ",
391
+ metricNamePrefix == null ? "Bandwidth" : $ "{ metricNamePrefix } -Bandwidth ",
398
392
metricUnit : MetricUnit . KilobytesPerSecond ,
399
393
relativity : MetricRelativity . HigherIsBetter ,
400
394
description : "Total amount of data transferred per second during the period of time." )
@@ -414,7 +408,7 @@ private static void AddAdditionalLatencyPercentileMetrics(string output, List<Me
414
408
p80LatencyOnGet = double . Parse ( getLatencyP80 . Groups [ 1 ] . Value ) ;
415
409
416
410
metrics . Add ( new Metric (
417
- "GET_Latency -P80" ,
411
+ "GET-Latency -P80" ,
418
412
p80LatencyOnGet ,
419
413
MetricUnit . Milliseconds ,
420
414
MetricRelativity . LowerIsBetter ,
@@ -427,7 +421,7 @@ private static void AddAdditionalLatencyPercentileMetrics(string output, List<Me
427
421
p80LatencyOnSet = double . Parse ( setLatencyP80 . Groups [ 1 ] . Value ) ;
428
422
429
423
metrics . Add ( new Metric (
430
- "SET_Latency -P80" ,
424
+ "SET-Latency -P80" ,
431
425
p80LatencyOnSet ,
432
426
MetricUnit . Milliseconds ,
433
427
MetricRelativity . LowerIsBetter ,
0 commit comments