Browse Source

update p99

pull/2748/head
Jason Dove 7 months ago
parent
commit
7f095c3dc7
No known key found for this signature in database
  1. 5
      ErsatzTV.Infrastructure/ScanProfiler.cs

5
ErsatzTV.Infrastructure/ScanProfiler.cs

@ -35,7 +35,10 @@ public static class ScanProfiler @@ -35,7 +35,10 @@ public static class ScanProfiler
double avg = times.Average();
long min = times.Min();
long max = times.Max();
long p99 = times[(int)(times.Count * 0.99)];
int n = times.Count;
int idx = (int)Math.Ceiling(0.99 * n) - 1;
idx = Math.Clamp(idx, 0, n - 1);
long p99 = times[idx];
double totalSec = times.Sum() / 1000.0;
sb.AppendLine(FormattableString.Invariant($"{key,-25} | {times.Count,-6} | {avg,-8:F1} | {min,-6} | {max,-6} | {p99,-6} | {totalSec,-8:F2}"));

Loading…
Cancel
Save