forked from kubesphere/kubesphere
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubesphere#3526 from zhu733756/add-pod-level-metrics
Add pod level metrics for edge node
- Loading branch information
Showing
14 changed files
with
992 additions
and
267 deletions.
There are no files selected for viewing
638 changes: 475 additions & 163 deletions
638
pkg/simple/client/monitoring/metricsserver/metricsserver.go
Large diffs are not rendered by default.
Oops, something went wrong.
341 changes: 257 additions & 84 deletions
341
pkg/simple/client/monitoring/metricsserver/metricsserver_test.go
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
pkg/simple/client/monitoring/metricsserver/testdata/metrics-matrix-4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"metric_name": "pod_cpu_usage", | ||
"data": { | ||
"resultType": "matrix", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod1" | ||
}, | ||
"values":[ | ||
[ | ||
1616675696, | ||
"0.001" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"metric_name": "pod_memory_usage_wo_cache", | ||
"data": { | ||
"resultType": "matrix", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod1" | ||
}, | ||
"values": [ | ||
[ | ||
1616675696, | ||
"1" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] |
42 changes: 42 additions & 0 deletions
42
pkg/simple/client/monitoring/metricsserver/testdata/metrics-matrix-5.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"metric_name": "pod_cpu_usage", | ||
"data": { | ||
"resultType": "matrix", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod2" | ||
}, | ||
"values": [ | ||
[ | ||
1616675696, | ||
"0.002" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"metric_name": "pod_memory_usage_wo_cache", | ||
"data": { | ||
"resultType": "matrix", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod2" | ||
}, | ||
"values": [ | ||
[ | ||
1616675696, | ||
"2" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] |
42 changes: 42 additions & 0 deletions
42
pkg/simple/client/monitoring/metricsserver/testdata/metrics-matrix-6.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"metric_name": "pod_cpu_usage", | ||
"data": { | ||
"resultType": "matrix", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod1" | ||
}, | ||
"values":[ | ||
[ | ||
1616675696, | ||
"0.001" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"metric_name": "pod_memory_usage_wo_cache", | ||
"data": { | ||
"resultType": "matrix", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod1" | ||
}, | ||
"values": [ | ||
[ | ||
1616675696, | ||
"1" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
pkg/simple/client/monitoring/metricsserver/testdata/metrics-vector-4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"metric_name": "pod_cpu_usage", | ||
"data": { | ||
"resultType": "vector", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod1" | ||
}, | ||
"value": [ | ||
1616675696, | ||
"0.001" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"metric_name": "pod_memory_usage_wo_cache", | ||
"data": { | ||
"resultType": "vector", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod1" | ||
}, | ||
"value": [ | ||
1616675696, | ||
"1" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] |
38 changes: 38 additions & 0 deletions
38
pkg/simple/client/monitoring/metricsserver/testdata/metrics-vector-5.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"metric_name": "pod_cpu_usage", | ||
"data": { | ||
"resultType": "vector", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod2" | ||
}, | ||
"value": [ | ||
1616675696, | ||
"0.002" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"metric_name": "pod_memory_usage_wo_cache", | ||
"data": { | ||
"resultType": "vector", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"namespace": "kubeedge", | ||
"pod":"pod2" | ||
}, | ||
"value": [ | ||
1616675696, | ||
"2" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] |
Oops, something went wrong.