@@ -235,44 +235,42 @@ export class PerformanceSummary implements OnChanges, OnInit {
235
235
@Input ( ) inferenceLatencyData ?: GeneralAnalysis ;
236
236
237
237
title = 'Performance Summary' ;
238
- isTpu = true ;
239
- generalProps : GeneralProps = { } ;
240
- inputPipelineProps : GeneralProps = { } ;
241
- inferenceLatencyProps : GeneralProps = { } ;
242
238
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
+ }
245
263
246
264
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' ] || '' ;
254
265
this . parseSummaryData ( ) ;
255
266
}
256
267
257
268
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
- }
272
269
this . parseSummaryData ( ) ;
273
270
}
274
271
275
272
parseSummaryData ( ) {
273
+ this . summaryInfoCombined = [ ] ;
276
274
this . parseDataFromConfig (
277
275
GENERIC_SUMMARY_INFO_BEFORE , this . inputPipelineProps ,
278
276
this . summaryInfoCombined , 1 ) ;
0 commit comments