perf: adjust the log level of the rbd-node component part (#1696)

This commit is contained in:
张启航 2023-07-07 18:47:31 +08:00 committed by GitHub
parent 8644fcc95a
commit 128065c88b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -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
@ -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()
}
@ -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)

View File

@ -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))

View File

@ -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
}