Commit 93dfd6ad authored by GLYASAI's avatar GLYASAI
Browse files

[ADD] add debug messages

parent e1916809
Showing with 4 additions and 1 deletion
+4 -1
......@@ -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 {
......
......@@ -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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment