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
1a149673
Unverified
Commit
1a149673
authored
Jun 14, 2023
by
zhu-mingye
Committed by
GitHub
Jun 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added flink job metrics layout (#2072)
parent
a1302cc6
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
127 additions
and
8 deletions
+127
-8
index.tsx
dinky-web/src/pages/Metrics/Job/index.tsx
+107
-0
index.tsx
dinky-web/src/pages/Metrics/Server/CPU/index.tsx
+1
-1
index.tsx
dinky-web/src/pages/Metrics/Server/Heap/index.tsx
+1
-1
index.tsx
dinky-web/src/pages/Metrics/Server/OutHeap/index.tsx
+1
-1
index.tsx
dinky-web/src/pages/Metrics/Server/Thread/index.tsx
+1
-1
index.tsx
dinky-web/src/pages/Metrics/Server/index.tsx
+2
-2
index.tsx
dinky-web/src/pages/Metrics/index.tsx
+12
-1
constants.tsx
dinky-web/src/services/constants.tsx
+2
-1
No files found.
dinky-web/src/pages/Metrics/Job/index.tsx
0 → 100644
View file @
1a149673
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import
{
useState
}
from
"react"
;
import
{
PageLoading
,
ProFormSelect
}
from
"@ant-design/pro-components"
;
import
{
Tag
}
from
"antd"
;
type
JobMetrics
=
{
taskId
:
number
flinkJobId
:
string
jobName
:
string
}
const
templateData
:
JobMetrics
[]
=
[
{
taskId
:
1
,
flinkJobId
:
'6327183eghjshajdkahsjdhasjkdhksjageqyw'
,
jobName
:
'job1'
,
},
{
taskId
:
2
,
flinkJobId
:
'6327132893829shajdkahsjdhashksjageqyw'
,
jobName
:
'job2'
,
}
]
const
Job
=
()
=>
{
const
[
data
,
setData
]
=
useState
<
JobMetrics
[]
>
(
templateData
);
const
[
selectTaskId
,
setSelectTaskId
]
=
useState
<
number
>
(
0
);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
// useEffect(() => {
// getDataByParams(API_CONSTANTS.JOB_METRICS, {taskId: selectTaskId}).then((res) => {
// setData(res.data);
// });
// }, []);
const
buildSelectDataOptions
=
(
metrics
:
JobMetrics
[])
=>
metrics
.
map
((
item
)
=>
{
let
label
=
<
div
style=
{
{
alignItems
:
'center'
,
alignContent
:
'center'
}
}
>
<
Tag
color=
{
'processing'
}
>
Flink JobId:
{
item
.
flinkJobId
}
</
Tag
>
<
Tag
color=
{
'success'
}
>
TaskId:
{
item
.
taskId
}
</
Tag
>
<
Tag
color=
{
'success'
}
>
TaskName:
{
item
.
jobName
}
</
Tag
>
</
div
>;
return
{
key
:
item
.
taskId
,
label
:
label
,
value
:
item
.
taskId
,
};
})
const
handleSelectChange
=
(
value
:
number
)
=>
{
setLoading
(
true
);
setSelectTaskId
(
value
);
setTimeout
(()
=>
{
setLoading
(
false
);
},
2000
);
};
return
<>
<
ProFormSelect
name=
"job"
label=
"Job"
placeholder=
{
'Select a job'
}
options=
{
buildSelectDataOptions
(
data
)
}
fieldProps=
{
{
onChange
:
(
value
)
=>
handleSelectChange
(
value
)
}
}
/>
<>
{
(
selectTaskId
!==
0
&&
selectTaskId
!==
undefined
)
&&
<>
{
loading
?
<
PageLoading
/>
:
<>
you choose the task id:
{
selectTaskId
}
</>
}
</>
}
</>
</>
}
export
default
Job
;
\ No newline at end of file
dinky-web/src/pages/Metrics/Server/CPU/index.tsx
View file @
1a149673
...
@@ -41,7 +41,7 @@ const CPU: React.FC<CpuProps> = (props) => {
...
@@ -41,7 +41,7 @@ const CPU: React.FC<CpuProps> = (props) => {
const
config
:
AreaConfig
=
{
const
config
:
AreaConfig
=
{
animation
:
false
,
animation
:
false
,
data
:
dataList
,
data
:
dataList
,
height
:
20
0
,
height
:
15
0
,
yField
:
'value'
,
yField
:
'value'
,
xField
:
'time'
,
xField
:
'time'
,
xAxis
:
{
xAxis
:
{
...
...
dinky-web/src/pages/Metrics/Server/Heap/index.tsx
View file @
1a149673
...
@@ -39,7 +39,7 @@ const Heap: React.FC<HeapProps> = (props) => {
...
@@ -39,7 +39,7 @@ const Heap: React.FC<HeapProps> = (props) => {
const
config
:
AreaConfig
=
{
const
config
:
AreaConfig
=
{
data
:
dataList
,
data
:
dataList
,
animation
:
false
,
animation
:
false
,
height
:
20
0
,
height
:
15
0
,
yField
:
'value'
,
yField
:
'value'
,
xField
:
'time'
,
xField
:
'time'
,
xAxis
:
{
xAxis
:
{
...
...
dinky-web/src/pages/Metrics/Server/OutHeap/index.tsx
View file @
1a149673
...
@@ -39,7 +39,7 @@ const NonHeap: React.FC<NonHeapProps> = (props) => {
...
@@ -39,7 +39,7 @@ const NonHeap: React.FC<NonHeapProps> = (props) => {
const
config
:
AreaConfig
=
{
const
config
:
AreaConfig
=
{
data
:
dataList
,
data
:
dataList
,
animation
:
false
,
animation
:
false
,
height
:
20
0
,
height
:
15
0
,
yField
:
'value'
,
yField
:
'value'
,
xField
:
'time'
,
xField
:
'time'
,
xAxis
:
{
xAxis
:
{
...
...
dinky-web/src/pages/Metrics/Server/Thread/index.tsx
View file @
1a149673
...
@@ -44,7 +44,7 @@ const Thread: React.FC<ThreadProps> = (props) => {
...
@@ -44,7 +44,7 @@ const Thread: React.FC<ThreadProps> = (props) => {
const
config
:
AreaConfig
=
{
const
config
:
AreaConfig
=
{
data
:
dataListAll
,
data
:
dataListAll
,
animation
:
false
,
animation
:
false
,
height
:
20
0
,
height
:
15
0
,
xField
:
'time'
,
xField
:
'time'
,
yField
:
'value'
,
yField
:
'value'
,
seriesField
:
'name'
,
seriesField
:
'name'
,
...
...
dinky-web/src/pages/Metrics/Server/index.tsx
View file @
1a149673
...
@@ -166,8 +166,8 @@ const Server = () => {
...
@@ -166,8 +166,8 @@ const Server = () => {
<
GlobalFilter
custom=
{
custom
}
dateRange=
{
dateRange
}
endTime=
{
endTime
}
startTime=
{
startTime
}
<
GlobalFilter
custom=
{
custom
}
dateRange=
{
dateRange
}
endTime=
{
endTime
}
startTime=
{
startTime
}
handleDateRadioChange=
{
handleDateRadioChange
}
handleRangeChange=
{
handleRangeChange
}
/>
handleDateRadioChange=
{
handleDateRadioChange
}
handleRangeChange=
{
handleRangeChange
}
/>
</
ProCard
>
</
ProCard
>
<
ProCard
style=
{
{
height
:
'88vh'
}
}
ghost
wrap
size=
{
'small'
}
split=
{
'vertical'
}
>
<
ProCard
ghost
wrap
size=
{
'small'
}
split=
{
'vertical'
}
>
<
ProCard
style=
{
{
height
:
'
20
vh'
}
}
split=
{
'vertical'
}
>
<
ProCard
style=
{
{
height
:
'
16
vh'
}
}
split=
{
'vertical'
}
>
<
ProCard
title=
{
<
Space
><
CPUIcon
style=
{
imgStyle
}
/>
CPU
</
Space
>
}
extra=
{
dataRecord
?.
cpuLastValue
+
"%"
}
>
<
ProCard
title=
{
<
Space
><
CPUIcon
style=
{
imgStyle
}
/>
CPU
</
Space
>
}
extra=
{
dataRecord
?.
cpuLastValue
+
"%"
}
>
<
CPU
data=
{
data
}
/>
<
CPU
data=
{
data
}
/>
</
ProCard
>
</
ProCard
>
...
...
dinky-web/src/pages/Metrics/index.tsx
View file @
1a149673
...
@@ -20,10 +20,21 @@
...
@@ -20,10 +20,21 @@
import
React
from
"react"
;
import
React
from
"react"
;
import
Server
from
"@/pages/Metrics/Server"
;
import
Server
from
"@/pages/Metrics/Server"
;
import
{
PageContainer
}
from
"@ant-design/pro-components"
;
import
{
PageContainer
,
ProCard
}
from
"@ant-design/pro-components"
;
import
Job
from
"./Job"
;
export
default
()
=>
{
export
default
()
=>
{
return
<
PageContainer
title=
{
false
}
>
return
<
PageContainer
title=
{
false
}
>
<
ProCard
style=
{
{
height
:
'93vh'
}
}
split=
{
'horizontal'
}
size=
{
'small'
}
wrap
>
<
ProCard
split=
{
'horizontal'
}
style=
{
{
height
:
'22vh'
}
}
>
<
Server
/>
<
Server
/>
</
ProCard
>
<
ProCard
.
Divider
/>
<
ProCard
split=
{
'horizontal'
}
wrap
>
<
Job
/>
</
ProCard
>
</
ProCard
>
</
PageContainer
>;
</
PageContainer
>;
}
}
dinky-web/src/services/constants.tsx
View file @
1a149673
...
@@ -198,7 +198,8 @@ export const API_CONSTANTS = {
...
@@ -198,7 +198,8 @@ export const API_CONSTANTS = {
// monitor
// monitor
MONITOR_GET_SYSTEM_DATA
:
"/api/monitor/getSysData"
,
MONITOR_GET_SYSTEM_DATA
:
"/api/monitor/getSysData"
,
MONITOR_GET_LAST_DATA
:
"/api/monitor/getLastUpdateData"
MONITOR_GET_LAST_DATA
:
"/api/monitor/getLastUpdateData"
,
JOB_METRICS
:
"/api/monitor/jobMetrics"
,
};
};
...
...
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