Documentation
¶
Overview ¶
Copyright © 2021 Optable Technologies Inc. All rights reserved. See LICENSE for details.
Copyright © 2021 Optable Technologies Inc. All rights reserved. See LICENSE for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LevelFromVerbosity ¶
LevelFromVerbosity takes a command-line `-v` stackable flag count, e.g. `-vv`, `-vvv` and transforms it into a sensible loglevel. The mapping is:
``: Warn `-v`: Info `-vv`: Debug `-vvv`: Trace
Types ¶
type Profiling ¶
type Profiling struct {
Profiling string `opt:"" hidden:"true" default:""`
}
Profiling is a struct that can be embedded in any kong cli to enable easy and convenient profiling for performance analysis. The flag is hidden from the help message such that we can use it in public cli.
The supported values are:
- "cpu": Enables CPU profiling.
- "memory": Enables heap memory profiling.
- "block": Enables block (contention) profiling.
- "mutex": Enables mutex profiling.
- "trace": Enables trace profiling.
The profiling file path will be shown to stderr and can be opened with `go tool pprof $file` or `go tool pprof -http localhost:8080 $file`
In order to enable profiling, one should use the command like this: ``` stopProfiling := cli.Profiling.Start() defer stopProfiling() ```