Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rainbond2
Commits
93dfd6ad
Commit
93dfd6ad
authored
6 years ago
by
GLYASAI
Browse files
Options
Download
Email Patches
Plain Diff
[ADD] add debug messages
parent
e1916809
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/handler/service.go
+2
-1
api/handler/service.go
worker/server/server.go
+2
-0
worker/server/server.go
with
4 additions
and
1 deletion
+4
-1
api/handler/service.go
+
2
-
1
View file @
93dfd6ad
...
...
@@ -1428,6 +1428,7 @@ func (s *ServiceAction) GetPods(serviceID string) ([]*K8sPodInfo, error) {
podInfo
.
PodIP
=
v
.
PodIp
podInfo
.
PodStatus
=
v
.
PodStatus
for
_
,
container
:=
range
v
.
Containers
{
logrus
.
Debugf
(
"container name: %s; memory limit: %d"
,
container
.
ContainerName
,
container
.
MemoryLimit
)
containerInfos
[
container
.
ContainerName
]
=
map
[
string
]
string
{
"memory_limit"
:
fmt
.
Sprintf
(
"%d"
,
container
.
MemoryLimit
),
"memory_usage"
:
"0"
,
...
...
@@ -1438,7 +1439,7 @@ func (s *ServiceAction) GetPods(serviceID string) ([]*K8sPodInfo, error) {
podsInfoList
=
append
(
podsInfoList
,
&
podInfo
)
}
containerMemInfo
,
_
:=
s
.
GetPodContainerMemory
(
podNames
)
fmt
.
Println
(
containerMemInfo
)
logrus
.
Debugf
(
"container memory info: %v"
,
containerMemInfo
)
for
_
,
c
:=
range
podsInfoList
{
for
k
:=
range
c
.
Container
{
if
info
,
exist
:=
containerMemInfo
[
c
.
PodName
][
k
];
exist
{
...
...
This diff is collapsed.
Click to expand it.
worker/server/server.go
+
2
-
0
View file @
93dfd6ad
...
...
@@ -121,6 +121,8 @@ func (r *RuntimeServer) GetAppPods(ctx context.Context, re *pb.ServiceRequest) (
ContainerName
:
container
.
Name
,
MemoryLimit
:
int32
(
container
.
Resources
.
Limits
.
Memory
()
.
Value
()),
}
logrus
.
Debugf
(
"raw data;container name: %s; memory limit: %d"
,
container
.
Name
,
containers
[
container
.
Name
]
.
MemoryLimit
)
}
Pods
=
append
(
Pods
,
&
pb
.
ServiceAppPod
{
ServiceId
:
app
.
ServiceID
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help