Skip to content

Commit

Permalink
Switch stat logging to debugf() (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwneisen authored Oct 16, 2023
1 parent a6fd175 commit cd730ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/imagefs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (ds *dockerService) imageFsInfo() (*runtimeapi.ImageFsInfoResponse, error)
}
usedBytes := (stat.Blocks - stat.Bfree) * uint64(stat.Bsize)
iNodesUsed := stat.Files - stat.Ffree
logrus.Infof("Filesystem usage containing '%s': usedBytes=%v, iNodesUsed=%v", ds.dockerRootDir, usedBytes, iNodesUsed)
logrus.Debugf("Filesystem usage containing '%s': usedBytes=%v, iNodesUsed=%v", ds.dockerRootDir, usedBytes, iNodesUsed)

// compute total used bytes by docker images
images, err := ds.client.ListImages(types.ImageListOptions{All: true, SharedSize: true})
Expand All @@ -61,7 +61,7 @@ func (ds *dockerService) imageFsInfo() (*runtimeapi.ImageFsInfoResponse, error)
for k := range sharedSizeMap {
totalImageSize += uint64(k)
}
logrus.Infof("Total used bytes by docker images: %v", totalImageSize)
logrus.Debugf("Total used bytes by docker images: %v", totalImageSize)

return &runtimeapi.ImageFsInfoResponse{
ImageFilesystems: []*runtimeapi.FilesystemUsage{
Expand Down
5 changes: 2 additions & 3 deletions core/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ func (ds *dockerService) ListContainerStats(
r *runtimeapi.ListContainerStatsRequest,
) (*runtimeapi.ListContainerStatsResponse, error) {
start := time.Now()
logrus.Info("Begin ListContainerStats")
containerStatsFilter := r.GetFilter()
filter := &runtimeapi.ContainerFilter{}

Expand All @@ -194,7 +193,7 @@ func (ds *dockerService) ListContainerStats(
containers := res.Containers
ds.containerStatsCache.clist <- containers
numContainers := len(containers)
logrus.Infof("Number of pod containers: %v", numContainers)
logrus.Debugf("Number of pod containers: %v", numContainers)
if numContainers == 0 {
return &runtimeapi.ListContainerStatsResponse{}, nil
}
Expand Down Expand Up @@ -242,7 +241,7 @@ func (ds *dockerService) ListContainerStats(
return nil, err
}

logrus.Infof("End ListContainerStats. Number of stats:%v, Time taken: %v", len(results), time.Since(start))
logrus.Debugf("Number of stats:%v, Time taken: %v", len(results), time.Since(start))

return &runtimeapi.ListContainerStatsResponse{Stats: results}, nil
}

0 comments on commit cd730ff

Please sign in to comment.