Skip to content

Commit

Permalink
add profile start time to tensorboard profiler overview
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 622975506
  • Loading branch information
zzzaries authored and copybara-github committed Apr 8, 2024
1 parent 30fc866 commit f7bf1c8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion frontend/app/common/interfaces/data_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ export declare interface TopOpsColumn {

/* tslint:disable enforce-name-casing */
/** The base interface for a property of run environment. */
declare interface RunEnvironmentProperty {
export declare interface RunEnvironmentProperty {
error_message?: string;
host_count?: string;
device_core_count?: string;
device_type?: string;
is_training?: string;
tpu_core_count?: string;
profile_start_time?: string;
}
/* tslint:enable */

Expand Down
9 changes: 8 additions & 1 deletion frontend/app/components/overview/overview.ng.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
[generalAnalysis]="generalAnalysis"
[inputPipelineAnalysis]="inputPipelineAnalysis">
</performance-summary>
<run-environment-view [runEnvironment]="runEnvironment"></run-environment-view>
<run-environment-view [runEnvironment]="runEnvironment">
<div profileDetail>
<p [hidden]="!profileStartTime">
<span class="key-label">Profile start time (local)</span>:
<span>{{profileStartTime}}</span>
</p>
</div>
</run-environment-view>
</div>

<div class="right-column">
Expand Down
11 changes: 10 additions & 1 deletion frontend/app/components/overview/overview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component, OnDestroy} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {Store} from '@ngrx/store';
import {OverviewDataTuple} from 'org_xprof/frontend/app/common/interfaces/data_table';
import {OverviewDataTuple, RunEnvironmentProperty} from 'org_xprof/frontend/app/common/interfaces/data_table';
import {NavigationEvent} from 'org_xprof/frontend/app/common/interfaces/navigation_event';
import {DataService} from 'org_xprof/frontend/app/services/data_service/data_service';
import {setLoadingStateAction} from 'org_xprof/frontend/app/store/actions';
Expand All @@ -20,6 +20,8 @@ export class Overview extends OverviewCommon implements OnDestroy {
/** Handles on-destroy Subject, used to unsubscribe. */
private readonly destroyed = new ReplaySubject<void>(1);

profileStartTime = '';

constructor(
route: ActivatedRoute, private readonly dataService: DataService,
private readonly store: Store<{}>) {
Expand Down Expand Up @@ -53,9 +55,16 @@ export class Overview extends OverviewCommon implements OnDestroy {

/** Transfer data to Overview DataTable type */
this.parseOverviewData((data || []) as OverviewDataTuple);
this.parseRunEnvironmentDetail();
});
}

parseRunEnvironmentDetail() {
const runEnvironmentProp: RunEnvironmentProperty =
(this.runEnvironment || {}).p || {};
this.profileStartTime = runEnvironmentProp.profile_start_time || '';
}

ngOnDestroy() {
// Unsubscribes all pending subscriptions.
this.destroyed.next();
Expand Down

0 comments on commit f7bf1c8

Please sign in to comment.