Skip to content

Commit 62b163a

Browse files
Copilotadameat
andcommitted
Remove mock data fallback from threads API - use only real backend data
Co-authored-by: adameat <[email protected]>
1 parent 9734099 commit 62b163a

File tree

1 file changed

+6
-47
lines changed

1 file changed

+6
-47
lines changed

src/store/reducers/node/node.ts

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type {TThreadPoolInfo} from '../../../types/api/threads';
21
import {api} from '../api';
32

43
import {prepareNodeData} from './utils';
@@ -33,53 +32,13 @@ export const nodeApi = api.injectEndpoints({
3332
const data = await window.api.viewer.getNodeInfo(nodeId, {signal});
3433

3534
// 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+
},
8141
};
82-
return {data: mockThreadData};
8342
} catch (error) {
8443
return {error};
8544
}

0 commit comments

Comments
 (0)