add percentile information if available

This commit is contained in:
2021-04-02 18:29:18 +02:00
parent f56744eb6b
commit a1b4c7006d
15 changed files with 322 additions and 168 deletions

View File

@@ -12,10 +12,38 @@ export class PlotDetailsComponent {
@Input()
stats: PlotResponseStats;
hasPercentiles = false;
valueFormat = "time";
percentilesToPlot : Map<string,string> = new Map();
constructor(public utils: UtilService){
}
ngOnInit() {
this.hasPercentiles = false;
this.percentilesToPlot.clear();
for (let i = 0; i < this.stats.dataSeriesStats.length; i++)
{
const stat = this.stats.dataSeriesStats[i];
if (stat.percentiles.hasOwnProperty("50.000"))
{
this.hasPercentiles = true;
this.percentilesToPlot.set('median','50.000');
this.percentilesToPlot.set('75th','75.000');
this.percentilesToPlot.set('95th','95.000');
this.percentilesToPlot.set('99th','99.000');
break;
}
}
}
percentile(value: number): string {
return this.utils.format(value, this.valueFormat);
}
pointTypeClass(typeAndColor: DashTypeAndColor): string {
return "plot-details-plotType"
+" plot-details-plotType_"+typeAndColor.pointType