Skip to content

Commit

Permalink
perf: adjust the log level of the rbd-node component part (#1696)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangSetSail authored Jul 7, 2023
1 parent 8644fcc commit 128065c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions builder/sources/container_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
CONTAINER_ACTION_DIE = "die"
)

//ContainerDesc -
type ContainerDesc struct {
ContainerRuntime string
// Info is extra information of the Container. The key could be arbitrary string, and
Expand All @@ -50,21 +51,23 @@ type ContainerDesc struct {
*types.ContainerJSON
}

//GetLogPath -
func (c *ContainerDesc) GetLogPath() string {
if c.ContainerRuntime == ContainerRuntimeDocker {
logrus.Infof("docker container log path %s", c.ContainerJSON.LogPath)
logrus.Debugf("docker container log path %s", c.ContainerJSON.LogPath)
return c.ContainerJSON.LogPath
}
logrus.Infof("containerd container log path %s", c.ContainerStatus.GetLogPath())
logrus.Debugf("containerd container log path %s", c.ContainerStatus.GetLogPath())
return c.ContainerStatus.GetLogPath()
}

//GetId -
func (c *ContainerDesc) GetId() string {
if c.ContainerRuntime == ContainerRuntimeDocker {
logrus.Infof("docker container id %s", c.ContainerJSON.ID)
logrus.Debugf("docker container id %s", c.ContainerJSON.ID)
return c.ContainerJSON.ID
}
logrus.Infof("containerd container id %s", c.ContainerStatus.GetId())
logrus.Debugf("containerd container id %s", c.ContainerStatus.GetId())
return c.ContainerStatus.GetId()
}

Expand Down Expand Up @@ -110,6 +113,7 @@ type ContainerEvent struct {
Container *ContainerDesc
}

//CacheContainer cache container
func CacheContainer(cchan chan ContainerEvent, cs ...ContainerEvent) {
for _, container := range cs {
logrus.Debugf("found a container %s %s", container.Container.GetMetadata().GetName(), container.Action)
Expand Down
2 changes: 1 addition & 1 deletion node/api/controller/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func getFinalRate(cpu bool, value string, capCPU, capMemMB string) (result strin

u, err := strconv.Atoi(value)
if err != nil {
logrus.Infof("err occurred details:%s", err.Error())
logrus.Errorf("err occurred details:%s", err.Error())
}

result = strconv.Itoa(u * 100 / (capMemMBInt))
Expand Down
2 changes: 1 addition & 1 deletion node/monitormessage/udpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (u *UDPServer) UpdateEndpoints(endpoints ...*config.Endpoint) {
logrus.Error(err)
continue
}
logrus.Infof("Update event server address is %s", u.eventServerEndpoint[i])
logrus.Debugf("Update event server address is %s", u.eventServerEndpoint[i])
u.client = conn
break
}
Expand Down

0 comments on commit 128065c

Please sign in to comment.