Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
3d217dd1
Unverified
Commit
3d217dd1
authored
Nov 21, 2023
by
gaoyan
Committed by
GitHub
Nov 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix footer jvm info (#2559)
* Optimize the process * fix footer jvm info
parent
f4c05373
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
MonitorController.java
...src/main/java/org/dinky/controller/MonitorController.java
+7
-0
index.tsx
dinky-web/src/pages/DataStudio/FooterContainer/index.tsx
+15
-12
endpoints.tsx
dinky-web/src/services/endpoints.tsx
+1
-0
No files found.
dinky-admin/src/main/java/org/dinky/controller/MonitorController.java
View file @
3d217dd1
...
...
@@ -23,6 +23,7 @@ import org.dinky.data.annotations.Log;
import
org.dinky.data.dto.MetricsLayoutDTO
;
import
org.dinky.data.enums.BusinessType
;
import
org.dinky.data.enums.MetricsType
;
import
org.dinky.data.metrics.Jvm
;
import
org.dinky.data.model.Metrics
;
import
org.dinky.data.model.job.JobInstance
;
import
org.dinky.data.result.ProTableResult
;
...
...
@@ -133,4 +134,10 @@ public class MonitorController {
public
Result
<
List
<
Metrics
>>
getMetricsLayoutByName
(
@RequestParam
String
layoutName
)
{
return
Result
.
succeed
(
monitorService
.
getMetricsLayoutByName
(
layoutName
));
}
@GetMapping
(
"/getJvmInfo"
)
@ApiOperation
(
"Get Jvm Data Display"
)
public
Result
<
Jvm
>
getJvmInfo
()
{
return
Result
.
succeed
(
Jvm
.
of
());
}
}
dinky-web/src/pages/DataStudio/FooterContainer/index.tsx
View file @
3d217dd1
...
...
@@ -21,7 +21,8 @@ import useThemeValue from '@/hooks/useThemeValue';
import
JobRunningModal
from
'@/pages/DataStudio/FooterContainer/JobRunningModal'
;
import
{
getCurrentTab
}
from
'@/pages/DataStudio/function'
;
import
{
StateType
,
TabsPageType
,
VIEW
}
from
'@/pages/DataStudio/model'
;
import
{
getSseData
}
from
'@/services/api'
;
import
{
getData
}
from
'@/services/api'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
}
from
'@@/exports'
;
import
{
Button
,
GlobalToken
,
Space
}
from
'antd'
;
...
...
@@ -59,18 +60,20 @@ const FooterContainer: React.FC<FooterContainerProps & StateType> = (props) => {
const
currentTab
=
getCurrentTab
(
tabs
.
panes
??
[],
tabs
.
activeKey
);
useEffect
(()
=>
{
const
eventSource
=
getSseData
(
'/api/sse/getJvmInfo'
);
eventSource
.
onmessage
=
(
event
)
=>
{
const
data
=
JSON
.
parse
(
event
.
data
);
setMemDetailInfo
(
Number
(
data
[
'heapUsed'
]
/
1024
/
1024
).
toFixed
(
0
)
+
'/'
+
Number
(
data
[
'max'
]
/
1024
/
1024
).
toFixed
(
0
)
+
'M'
);
};
const
t
=
setInterval
(()
=>
{
getData
(
API_CONSTANTS
.
MONITOR_GET_JVM_INFO
)
.
then
((
res
)
=>
{
setMemDetailInfo
(
Number
(
res
.
data
[
'heapUsed'
]
/
1024
/
1024
).
toFixed
(
0
)
+
'/'
+
Number
(
res
.
data
[
'max'
]
/
1024
/
1024
).
toFixed
(
0
)
+
'M'
);
})
.
catch
((
e
)
=>
{});
},
3000
);
return
()
=>
{
eventSource
.
close
(
);
clearTimeout
(
t
);
};
},
[]);
...
...
dinky-web/src/services/endpoints.tsx
View file @
3d217dd1
...
...
@@ -267,6 +267,7 @@ export enum API_CONSTANTS {
MONITOR_GET_SYSTEM_DATA
=
'/api/monitor/getSysData'
,
MONITOR_GET_FLINK_DATA
=
'/api/monitor/getFlinkData'
,
MONITOR_GET_LAST_DATA
=
'/api/monitor/getLastUpdateData'
,
MONITOR_GET_JVM_INFO
=
'/api/monitor/getJvmInfo'
,
METRICS_LAYOUT_GET_BY_NAME
=
'/api/monitor/getMetricsLayoutByName'
,
JOB_METRICS
=
'/api/monitor/jobMetrics'
,
SAVE_FLINK_METRICS
=
'/api/monitor/saveFlinkMetrics/'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment