Add density stress test

Running the density tool will report Pss and Rss total and per container
values for shim memory usage. Values are reported in KB.

```bash
containerd-stress density --count 500
INFO[0000] pulling docker.io/library/alpine:latest
INFO[0000] generating spec from image
{"pss":421188,"rss":2439688,"pssPerContainer":842,"rssPerContainer":4879}
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-02-27 15:39:41 -05:00
parent 5bd99af7db
commit a2ef6952f2
4 changed files with 303 additions and 0 deletions

View File

@@ -55,6 +55,11 @@ func init() {
binarySizeGauge = ns.NewLabeledGauge("binary_size", "Binary size of compiled binaries", metrics.Bytes, "name")
errCounter = ns.NewLabeledCounter("errors", "Errors encountered running the stress tests", "err")
metrics.Register(ns)
// set higher ulimits
if err := setRlimit(); err != nil {
panic(err)
}
}
type run struct {
@@ -150,6 +155,9 @@ func main() {
}
return nil
}
app.Commands = []cli.Command{
densityCommand,
}
app.Action = func(context *cli.Context) error {
config := config{
Address: context.GlobalString("address"),