File tree Expand file tree Collapse file tree 3 files changed +20
-16
lines changed Expand file tree Collapse file tree 3 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export class ViewerAPI extends BaseYdbAPI {
6666 this . getPath ( '/viewer/json/sysinfo?enums=true' ) ,
6767 {
6868 node_id : id ,
69+ fields_required : - 1 ,
6970 } ,
7071 { concurrentId, requestConfig : { signal} , timeout} ,
7172 ) ;
@@ -600,17 +601,4 @@ export class ViewerAPI extends BaseYdbAPI {
600601 { concurrentId, requestConfig : { signal} } ,
601602 ) ;
602603 }
603-
604- getNodeThreads ( nodeId : string | number , { concurrentId, signal} : AxiosOptions = { } ) {
605- // TODO: This endpoint needs to be implemented in the YDB backend
606- // For now, we'll use the existing sysinfo endpoint and extract thread data
607- // In the future, this should be a dedicated /viewer/json/threads endpoint
608- return this . get < TEvSystemStateResponse > (
609- this . getPath ( '/viewer/json/sysinfo?enums=true' ) ,
610- {
611- node_id : nodeId ,
612- } ,
613- { concurrentId : concurrentId || `getNodeThreads|${ nodeId } ` , requestConfig : { signal} } ,
614- ) ;
615- }
616604}
Original file line number Diff line number Diff line change @@ -30,9 +30,22 @@ export const nodeApi = api.injectEndpoints({
3030 getNodeThreads : build . query ( {
3131 queryFn : async ( { nodeId} : { nodeId : string } , { signal} ) => {
3232 try {
33- const data = await window . api . viewer . getNodeThreads ( nodeId , { signal} ) ;
34- // TODO: Transform the data to extract detailed thread information
35- // For now, return mock data matching the issue requirements
33+ const data = await window . api . viewer . getNodeInfo ( nodeId , { signal} ) ;
34+
35+ // Extract thread information from the response
36+ // If the backend provides Threads field with detailed info, use it
37+ // Otherwise, fall back to mock data for development
38+ if ( data . Threads && data . Threads . length > 0 ) {
39+ return {
40+ data : {
41+ Threads : data . Threads ,
42+ ResponseTime : data . ResponseTime ,
43+ ResponseDuration : data . ResponseDuration ,
44+ } ,
45+ } ;
46+ }
47+
48+ // Fallback to mock data for development until backend is fully implemented
3649 const mockThreadData = {
3750 Threads : [
3851 {
Original file line number Diff line number Diff line change 11import type { TSystemStateInfo } from './nodes' ;
2+ import type { TThreadPoolInfo } from './threads' ;
23
34/**
45 * endpoint: /viewer/json/sysinfo
@@ -7,6 +8,8 @@ import type {TSystemStateInfo} from './nodes';
78 */
89export interface TEvSystemStateResponse {
910 SystemStateInfo ?: TSystemStateInfo [ ] ;
11+ /** Detailed thread information when fields_required=-1 is used */
12+ Threads ?: TThreadPoolInfo [ ] ;
1013 /** uint64 */
1114 ResponseTime ?: string ;
1215 ResponseDuration ?: number ;
You can’t perform that action at this time.
0 commit comments