|
1 | | -import type {TThreadPoolInfo} from '../../../types/api/threads'; |
2 | 1 | import {api} from '../api'; |
3 | 2 |
|
4 | 3 | import {prepareNodeData} from './utils'; |
@@ -33,53 +32,13 @@ export const nodeApi = api.injectEndpoints({ |
33 | 32 | const data = await window.api.viewer.getNodeInfo(nodeId, {signal}); |
34 | 33 |
|
35 | 34 | // 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 |
49 | | - const mockThreadData = { |
50 | | - Threads: [ |
51 | | - { |
52 | | - Name: 'AwsEventLoop', |
53 | | - Threads: 64, |
54 | | - SystemUsage: 0, |
55 | | - UserUsage: 0, |
56 | | - MinorPageFaults: 0, |
57 | | - MajorPageFaults: 0, |
58 | | - States: {S: 64}, |
59 | | - }, |
60 | | - { |
61 | | - Name: 'klktmr.IC', |
62 | | - Threads: 3, |
63 | | - SystemUsage: 0.2917210162, |
64 | | - UserUsage: 0.470575124, |
65 | | - MinorPageFaults: 0, |
66 | | - MajorPageFaults: 0, |
67 | | - States: {R: 2, S: 1}, |
68 | | - }, |
69 | | - { |
70 | | - Name: 'klktmr.IO', |
71 | | - Threads: 1, |
72 | | - SystemUsage: 0.001333074062, |
73 | | - UserUsage: 0.001333074062, |
74 | | - MinorPageFaults: 0, |
75 | | - MajorPageFaults: 0, |
76 | | - States: {S: 1}, |
77 | | - }, |
78 | | - ] as TThreadPoolInfo[], |
79 | | - ResponseTime: data.ResponseTime, |
80 | | - ResponseDuration: data.ResponseDuration, |
| 35 | + return { |
| 36 | + data: { |
| 37 | + Threads: data.Threads || [], |
| 38 | + ResponseTime: data.ResponseTime, |
| 39 | + ResponseDuration: data.ResponseDuration, |
| 40 | + }, |
81 | 41 | }; |
82 | | - return {data: mockThreadData}; |
83 | 42 | } catch (error) { |
84 | 43 | return {error}; |
85 | 44 | } |
|
0 commit comments