Documentation ¶
Index ¶
- Constants
- Variables
- func AvailableOutputTypesString() string
- func AvailableProfilingToolsString() string
- func GetDataStructByType(t EventType) interface{}
- func IsSupportedContainerRuntime(runtime string) bool
- func IsSupportedEvent(event string) bool
- func IsSupportedLanguage(lang string) bool
- func IsSupportedLogLevel(event string) bool
- func IsSupportedOutputType(outputType string) bool
- func IsSupportedProfilingTool(profilingTool string) bool
- func IsValidOutputType(eventType EventType, profilingTool ProfilingTool) bool
- func IsValidProfilingTool(tool ProfilingTool, language ProgrammingLanguage) bool
- func ParseEvent(eventString string) (interface{}, error)
- type ContainerRuntime
- type ErrorData
- type Event
- type EventType
- type LogData
- type LogLevel
- type ProfilingEvent
- type ProfilingTool
- type ProgrammingLanguage
- type ProgressData
- type ProgressStage
- type ResultData
Constants ¶
View Source
const ( Error EventType = "error" FlameGraph EventType = "flamegraph" SpeedScope EventType = "speedscope" Jfr EventType = "jfr" ThreadDump EventType = "threaddump" HeapDump EventType = "heapdump" HeapHistogram EventType = "heaphistogram" Flat EventType = "flat" Traces EventType = "traces" Collapsed EventType = "collapsed" Tree EventType = "tree" Progress EventType = "progress" Result EventType = "result" Log EventType = "log" Started ProgressStage = "started" Ended ProgressStage = "ended" )
Variables ¶
View Source
var GetContainerRuntimeRootPath = map[ContainerRuntime]string{ Crio: "/var/lib/containers/storage/", Containerd: "/run/containerd/", }
View Source
var GetOutputTypesByProfilingTool = map[ProfilingTool][]EventType{ AsyncProfiler: {FlameGraph, Jfr, Flat, Traces, Collapsed, Tree}, Jcmd: {Jfr, ThreadDump, HeapDump, HeapHistogram}, Pyspy: {FlameGraph, SpeedScope, ThreadDump}, Bpf: {FlameGraph}, Perf: {FlameGraph}, Rbspy: {FlameGraph}, FakeTool: {FlameGraph}, }
GetOutputTypesByProfilingTool Gets the list of EventType related to the ProfilingTool that they will be considered as output types. The first one is considered the default
View Source
var GetProfilingTool = func(l ProgrammingLanguage, e EventType) ProfilingTool { switch l { case Java: switch e { case Jfr, ThreadDump, HeapDump, HeapHistogram: return Jcmd case FlameGraph, Flat, Traces, Collapsed, Tree: return AsyncProfiler } case Python: return Pyspy case Go, Node, Clang, ClangPlusPlus: return Bpf case Ruby: return Rbspy } return GetProfilingToolsByProgrammingLanguage[l][0] }
GetProfilingTool Gets profiling tool related to the programming language and output event type.
View Source
var GetProfilingToolsByProgrammingLanguage = map[ProgrammingLanguage][]ProfilingTool{ Java: {Jcmd, AsyncProfiler}, Python: {Pyspy}, Go: {Bpf}, Node: {Bpf, Perf}, Clang: {Bpf, Perf}, ClangPlusPlus: {Bpf, Perf}, Ruby: {Rbspy}, FakeLang: {FakeTool}, }
GetProfilingToolsByProgrammingLanguage Gets profiling tool related to the programming language. The first one is considered the default
View Source
var (
ProfilingTools = []ProfilingTool{AsyncProfiler, Jcmd, Pyspy, Bpf, Perf, Rbspy}
)
Functions ¶
func AvailableOutputTypesString ¶ added in v0.6.2
func AvailableOutputTypesString() string
func AvailableProfilingToolsString ¶ added in v0.5.0
func AvailableProfilingToolsString() string
func GetDataStructByType ¶
func GetDataStructByType(t EventType) interface{}
func IsSupportedEvent ¶
func IsSupportedLanguage ¶
func IsSupportedLogLevel ¶
func IsSupportedOutputType ¶ added in v0.5.0
func IsSupportedProfilingTool ¶ added in v0.5.0
func IsValidOutputType ¶ added in v0.5.0
func IsValidOutputType(eventType EventType, profilingTool ProfilingTool) bool
IsValidOutputType Identifies if given EventType is valid for the also given ProfilingTool
func IsValidProfilingTool ¶ added in v0.5.0
func IsValidProfilingTool(tool ProfilingTool, language ProgrammingLanguage) bool
IsValidProfilingTool Identifies if given ProfilingTool is valid for the also given ProgrammingLanguage
func ParseEvent ¶
Types ¶
type ContainerRuntime ¶
type ContainerRuntime string
const ( Crio ContainerRuntime = "crio" Containerd ContainerRuntime = "containerd" FakeContainer ContainerRuntime = "fake" FakeContainerWithRootFileSystemLocationResultError ContainerRuntime = "fakeWithRootFileSystemLocationResultError" FakeContainerWithPIDResultError ContainerRuntime = "fakeWithPIDResultError" )
func AvailableContainerRuntimes ¶
func AvailableContainerRuntimes() []ContainerRuntime
type Event ¶
type Event struct { Type EventType `json:"type"` Data *jsoniter.RawMessage `json:"data"` }
type EventType ¶
type EventType string
func AvailableOutputTypes ¶ added in v0.5.0
func AvailableOutputTypes() []EventType
type ProfilingEvent ¶
type ProfilingEvent string
const ( Cpu ProfilingEvent = "cpu" Alloc ProfilingEvent = "alloc" Lock ProfilingEvent = "lock" CacheMisses ProfilingEvent = "cache-misses" Wall ProfilingEvent = "wall" Itimer ProfilingEvent = "itimer" )
func AvailableEvents ¶
func AvailableEvents() []ProfilingEvent
type ProfilingTool ¶ added in v0.5.0
type ProfilingTool string
const ( AsyncProfiler ProfilingTool = "async-profiler" Jcmd ProfilingTool = "jcmd" Pyspy ProfilingTool = "pyspy" Bpf ProfilingTool = "bpf" Perf ProfilingTool = "perf" Rbspy ProfilingTool = "rbspy" FakeTool ProfilingTool = "fake" )
func AvailableProfilingTools ¶ added in v0.5.0
func AvailableProfilingTools() []ProfilingTool
type ProgrammingLanguage ¶
type ProgrammingLanguage string
const ( Java ProgrammingLanguage = "java" Go ProgrammingLanguage = "go" Python ProgrammingLanguage = "python" Ruby ProgrammingLanguage = "ruby" Node ProgrammingLanguage = "node" Clang ProgrammingLanguage = "clang" ClangPlusPlus ProgrammingLanguage = "clang++" FakeLang ProgrammingLanguage = "fake" )
func AvailableLanguages ¶
func AvailableLanguages() []ProgrammingLanguage
type ProgressData ¶
type ProgressData struct { Time time.Time `json:"time"` Stage ProgressStage `json:"stage"` }
type ProgressStage ¶
type ProgressStage string
Click to show internal directories.
Click to hide internal directories.