Files
containerd/cmd/containerd-stress/size.go
Michael Crosby 0725b60402 Add binary sizes to stress test metrics
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-15 12:49:59 -05:00

27 lines
521 B
Go

package main
import (
"os"
"path/filepath"
"github.com/sirupsen/logrus"
)
var binaries = []string{
"ctr",
"containerd",
"containerd-shim",
}
// checkBinarySizes checks and reports the binary sizes for the containerd compiled binaries to prometheus
func checkBinarySizes() {
for _, name := range binaries {
fi, err := os.Stat(filepath.Join("/usr/local/bin", name))
if err != nil {
logrus.WithError(err).Error("stat binary")
continue
}
binarySizeGauge.WithValues(name).Set(float64(fi.Size()))
}
}