diff --git a/frontend/app/components/trace_viewer/BUILD b/frontend/app/components/trace_viewer/BUILD index af372e5a..c2f53627 100644 --- a/frontend/app/components/trace_viewer/BUILD +++ b/frontend/app/components/trace_viewer/BUILD @@ -24,6 +24,7 @@ xprof_ng_module( "@org_xprof//frontend/app/common/angular:angular_material_progress_bar", "@org_xprof//frontend/app/common/constants", "@org_xprof//frontend/app/common/interfaces", + "@org_xprof//frontend/app/components/diagnostics_view", "@org_xprof//frontend/app/components/trace_viewer_container", "@org_xprof//frontend/app/components/trace_viewer_v2:app_bundle_ts", "@org_xprof//frontend/app/pipes", diff --git a/frontend/app/services/data_service_v2/data_service_v2.ts b/frontend/app/services/data_service_v2/data_service_v2.ts index 1b12b847..90831bcc 100644 --- a/frontend/app/services/data_service_v2/data_service_v2.ts +++ b/frontend/app/services/data_service_v2/data_service_v2.ts @@ -6,6 +6,7 @@ import {API_PREFIX, CAPTURE_PROFILE_API, CONFIG_API, DATA_API, DATA_CSV_API, GRA import {FileExtensionType} from 'org_xprof/frontend/app/common/constants/enums'; import {CaptureProfileOptions, CaptureProfileResponse, ProfilerConfig, } from 'org_xprof/frontend/app/common/interfaces/capture_profile'; import {DataTable} from 'org_xprof/frontend/app/common/interfaces/data_table'; +import {type Diagnostics} from 'org_xprof/frontend/app/common/interfaces/diagnostics'; import {HostMetadata} from 'org_xprof/frontend/app/common/interfaces/hosts'; import {type SmartSuggestionReport} from 'org_xprof/frontend/app/common/interfaces/smart_suggestion.jsonpb_decls'; import * as utils from 'org_xprof/frontend/app/common/utils/utils'; @@ -56,7 +57,8 @@ export class DataServiceV2 implements DataServiceV2Interface { console.log(error); let errorMessage = ''; if (error.status === 0) { - errorMessage = 'Request failed : Unable to get the profile data'; + errorMessage = + 'Request failed : Unable to get the profile data'; } else { const urlObj = new URL(error.url || ''); const errorString = typeof error.error === 'object' ? @@ -210,7 +212,8 @@ export class DataServiceV2 implements DataServiceV2Interface { if (runPath) { linkParams.set('run_path', runPath); } - return `${window.parent.location.origin}?${linkParams.toString()}#profile`; + return `${window.parent.location.origin}?${ + linkParams.toString()}#profile`; } return ''; } @@ -407,6 +410,12 @@ export class DataServiceV2 implements DataServiceV2Interface { return of(''); } + getTraceViewerDiagnostics(sessionId: string, host?: string): + Observable { + // Not implemented for 3P. + return of({info: [], warnings: [], errors: []}); + } + getSearchParams(): URLSearchParams { return new URLSearchParams( window.sessionStorage.getItem('searchParams') || '', diff --git a/frontend/app/services/data_service_v2/data_service_v2_interface.ts b/frontend/app/services/data_service_v2/data_service_v2_interface.ts index 2527240e..5bbff6b6 100644 --- a/frontend/app/services/data_service_v2/data_service_v2_interface.ts +++ b/frontend/app/services/data_service_v2/data_service_v2_interface.ts @@ -6,6 +6,7 @@ import {InjectionToken} from '@angular/core'; import {ProfilerConfig} from 'org_xprof/frontend/app/common/interfaces/capture_profile'; import {DataTable} from 'org_xprof/frontend/app/common/interfaces/data_table'; +import {type Diagnostics} from 'org_xprof/frontend/app/common/interfaces/diagnostics'; import {GraphTypeObject} from 'org_xprof/frontend/app/common/interfaces/graph_viewer'; import {HostMetadata} from 'org_xprof/frontend/app/common/interfaces/hosts'; import {type SmartSuggestionReport} from 'org_xprof/frontend/app/common/interfaces/smart_suggestion.jsonpb_decls'; @@ -32,9 +33,8 @@ export interface DataServiceV2Interface { parameters?: Map, ): string; - getSmartSuggestions( - sessionId: string, - parameters?: Map): Observable; + getSmartSuggestions(sessionId: string, parameters?: Map): + Observable; // Returns a string of comma separated module names. getModuleList(sessionId: string, graphType?: string): Observable; @@ -79,6 +79,8 @@ export interface DataServiceV2Interface { sessionId: string, host: string, params: Map): Observable; + getTraceViewerDiagnostics(sessionId: string, host?: string): + Observable; getOpProfileSummary(data: OpProfileData): OpProfileSummary[]; // TODO(b/429042977): Do not include Custom Call text for provenance nodes. getCustomCallTextLink(