Skip to content

Commit 372a686

Browse files
zzzariescopybara-github
authored andcommitted
Enable module_name query parameter for Memory Viewer.
- The Memory Viewer now supports specifying the module via the `module_name` query parameter. - The component's parameter processing has been updated to combine both path parameters and query parameters. PiperOrigin-RevId: 819381009
1 parent 94f53b8 commit 372a686

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

frontend/app/components/memory_viewer/memory_viewer.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {NavigationEvent} from 'org_xprof/frontend/app/common/interfaces/navigati
77
import {setLoadingState} from 'org_xprof/frontend/app/common/utils/utils';
88
import {DATA_SERVICE_INTERFACE_TOKEN, DataServiceV2Interface} from 'org_xprof/frontend/app/services/data_service_v2/data_service_v2_interface';
99
import {setCurrentToolStateAction} from 'org_xprof/frontend/app/store/actions';
10-
import {ReplaySubject} from 'rxjs';
10+
import {combineLatest, ReplaySubject} from 'rxjs';
1111
import {takeUntil} from 'rxjs/operators';
1212

1313
/** A memory viewer component. */
@@ -43,10 +43,13 @@ export class MemoryViewer implements OnDestroy {
4343
route: ActivatedRoute,
4444
private readonly store: Store<{}>,
4545
) {
46-
route.params.pipe(takeUntil(this.destroyed)).subscribe((params) => {
47-
this.processQuery(params);
48-
this.load();
49-
});
46+
combineLatest([route.params, route.queryParams])
47+
.pipe(takeUntil(this.destroyed))
48+
.subscribe(([params, queryParams]) => {
49+
this.sessionId = params['sessionId'] || this.sessionId;
50+
this.processQuery(queryParams);
51+
this.load();
52+
});
5053
this.store.dispatch(
5154
setCurrentToolStateAction({currentTool: 'memory_viewer'}),
5255
);
@@ -56,7 +59,8 @@ export class MemoryViewer implements OnDestroy {
5659
this.sessionId = params['run'] || params['sessionId'] || this.sessionId;
5760
this.tool = params['tag'] || this.tool;
5861
this.host = params['host'] || this.host;
59-
this.selectedModule = params['moduleName'] || this.selectedModule;
62+
this.selectedModule =
63+
params['moduleName'] || params['module_name'] || this.selectedModule;
6064
}
6165

6266
load() {

0 commit comments

Comments
 (0)