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(logLevel string) bool
- func IsSupportedOutputType(outputType string) bool
- func IsSupportedProfilingTool(profilingTool string) bool
- func IsValidOutputType(OutputType OutputType, profilingTool ProfilingTool) bool
- func IsValidProfilingTool(tool ProfilingTool, language ProgrammingLanguage) bool
- func ParseEvent(eventString string) (interface{}, error)
- type ChunkData
- type ContainerRuntime
- type ErrorData
- type Event
- type EventType
- type LogData
- type LogLevel
- type NoticeData
- type OutputType
- type ProfilingEvent
- type ProfilingTool
- type ProgrammingLanguage
- type ProgressData
- type ProgressStage
- type ResultData
Constants ¶
View Source
const ( Progress EventType = "progress" Result EventType = "result" Notice EventType = "notice" Log EventType = "log" Error EventType = "error" 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][]OutputType{ AsyncProfiler: {FlameGraph, Jfr, Flat, Traces, Collapsed, Tree, Raw}, Jcmd: {Jfr, ThreadDump, HeapDump, HeapHistogram}, Pyspy: {FlameGraph, SpeedScope, ThreadDump, Raw}, Bpf: {FlameGraph, Raw}, Perf: {FlameGraph, Raw}, Rbspy: {FlameGraph, SpeedScope, Callgrind, Summary, SummaryByLine}, NodeDummy: {HeapSnapshot, HeapDump}, FakeTool: {FlameGraph}, }
GetOutputTypesByProfilingTool Gets the list of OutputType 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, o OutputType) ProfilingTool { switch l { case Java: switch o { case Jfr, ThreadDump, HeapDump, HeapHistogram: return Jcmd case FlameGraph, Flat, Traces, Collapsed, Tree, Raw: return AsyncProfiler } case Python: return Pyspy case Go, Rust: return Bpf case Clang, ClangPlusPlus: return Bpf case Ruby: return Rbspy case Node: switch o { case FlameGraph, Raw: return Bpf case HeapSnapshot, HeapDump: return NodeDummy } } 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, NodeDummy}, Clang: {Bpf, Perf}, ClangPlusPlus: {Bpf, Perf}, Ruby: {Rbspy}, Rust: {Bpf, Perf}, FakeLang: {FakeTool}, }
GetProfilingToolsByProgrammingLanguage Gets profiling tool related to the programming language. The first one is considered the default
Functions ¶
func AvailableOutputTypesString ¶
func AvailableOutputTypesString() string
func AvailableProfilingToolsString ¶
func AvailableProfilingToolsString() string
func GetDataStructByType ¶
func GetDataStructByType(t EventType) interface{}
func IsSupportedEvent ¶
func IsSupportedLanguage ¶
func IsSupportedLogLevel ¶
func IsSupportedOutputType ¶
func IsValidOutputType ¶
func IsValidOutputType(OutputType OutputType, profilingTool ProfilingTool) bool
IsValidOutputType Identifies if given OutputType is valid for the also given ProfilingTool
func IsValidProfilingTool ¶
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" FakeContainerWithCWDResultError ContainerRuntime = "fakeWithCWDResultError" )
func AvailableContainerRuntimes ¶
func AvailableContainerRuntimes() []ContainerRuntime
type Event ¶
type Event struct { Type EventType `json:"type"` Data *jsoniter.RawMessage `json:"data"` }
type NoticeData ¶
type OutputType ¶
type OutputType string
const ( FlameGraph OutputType = "flamegraph" SpeedScope OutputType = "speedscope" Jfr OutputType = "jfr" ThreadDump OutputType = "threaddump" HeapDump OutputType = "heapdump" HeapHistogram OutputType = "heaphistogram" Flat OutputType = "flat" Traces OutputType = "traces" Collapsed OutputType = "collapsed" Tree OutputType = "tree" Callgrind OutputType = "callgrind" Raw OutputType = "raw" Pprof OutputType = "pprof" Summary OutputType = "summary" SummaryByLine OutputType = "summary-by-line" HeapSnapshot OutputType = "heapsnapshot" )
func AvailableOutputTypes ¶
func AvailableOutputTypes() []OutputType
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 ¶
type ProfilingTool string
const ( AsyncProfiler ProfilingTool = "async-profiler" Jcmd ProfilingTool = "jcmd" Pyspy ProfilingTool = "pyspy" Bpf ProfilingTool = "bpf" Perf ProfilingTool = "perf" Rbspy ProfilingTool = "rbspy" NodeDummy ProfilingTool = "node-dummy" FakeTool ProfilingTool = "fake" )
func AvailableProfilingTools ¶
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++" Rust ProgrammingLanguage = "rust" 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
type ResultData ¶
type ResultData struct { Time time.Time `json:"time"` ResultType OutputType `json:"result-type"` File string `json:"file,omitempty"` FileSizeInBytes int64 `json:"file-size-in-bytes,omitempty"` Checksum string `json:"checksum,omitempty"` CompressorType string `json:"compressor-type,omitempty"` Chunks []ChunkData `json:"chunks,omitempty"` }
Click to show internal directories.
Click to hide internal directories.