Skip to content

Commit c2937fb

Browse files
zzzariescopybara-github
authored andcommitted
Fix the bug that performance summary keeps appending data switch runs.
Reset summary data each time before re-parsing. PiperOrigin-RevId: 721637801
1 parent 47f3e44 commit c2937fb

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

frontend/app/components/overview_page/performance_summary/performance_summary.ts

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -235,44 +235,42 @@ export class PerformanceSummary implements OnChanges, OnInit {
235235
@Input() inferenceLatencyData?: GeneralAnalysis;
236236

237237
title = 'Performance Summary';
238-
isTpu = true;
239-
generalProps: GeneralProps = {};
240-
inputPipelineProps: GeneralProps = {};
241-
inferenceLatencyProps: GeneralProps = {};
242238
summaryInfoCombined: SummaryInfo[] = [];
243-
remarkText = '';
244-
remarkColor = '';
239+
240+
get isTpu() {
241+
return this.inputPipelineProps['hardware_type'] === 'TPU';
242+
}
243+
244+
get generalProps() {
245+
return (this.generalAnalysis || {}).p as GeneralProps || {};
246+
}
247+
248+
get inputPipelineProps() {
249+
return (this.inputPipelineAnalysis || {}).p as GeneralProps || {};
250+
}
251+
252+
get inferenceLatencyProps() {
253+
return (this.inferenceLatencyData || {}).p as GeneralProps || {};
254+
}
255+
256+
get remarkText() {
257+
return this.generalProps['remark_text'] || '';
258+
}
259+
260+
get remarkColor() {
261+
return this.generalProps['remark_color'] || '';
262+
}
245263

246264
ngOnInit() {
247-
this.inputPipelineProps =
248-
(this.inputPipelineAnalysis || {}).p as GeneralProps || {};
249-
this.isTpu = this.inputPipelineProps['hardware_type'] === 'TPU';
250-
this.generalProps = (this.generalAnalysis || {}).p as GeneralProps || {};
251-
this.inferenceLatencyProps = (this.inferenceLatencyData || {}).p || {};
252-
this.remarkText = this.generalProps['remark_text'] || '';
253-
this.remarkColor = this.generalProps['remark_color'] || '';
254265
this.parseSummaryData();
255266
}
256267

257268
ngOnChanges(changes: SimpleChanges) {
258-
if (changes['inputPipelineAnalysis'] && this.inputPipelineAnalysis) {
259-
this.inputPipelineProps =
260-
(this.inputPipelineAnalysis || {}).p as GeneralProps || {};
261-
this.isTpu = this.inputPipelineProps['hardware_type'] === 'TPU';
262-
}
263-
if (changes['generalAnalysis'] && this.generalAnalysis) {
264-
this.generalProps = (this.generalAnalysis || {}).p as GeneralProps || {};
265-
this.remarkText = this.generalProps['remark_text'] || '';
266-
this.remarkColor = this.generalProps['remark_color'] || '';
267-
}
268-
if (changes['inferenceLatencyData'] && this.inferenceLatencyData) {
269-
this.inferenceLatencyProps =
270-
(this.inferenceLatencyData || {}).p as GeneralProps || {};
271-
}
272269
this.parseSummaryData();
273270
}
274271

275272
parseSummaryData() {
273+
this.summaryInfoCombined = [];
276274
this.parseDataFromConfig(
277275
GENERIC_SUMMARY_INFO_BEFORE, this.inputPipelineProps,
278276
this.summaryInfoCombined, 1);

0 commit comments

Comments
 (0)