Documentation ¶
Index ¶
- Constants
- func EnableBpfStats() func() error
- func GetBpfStats() map[int64]*BpfProgStats
- func GetBpfStatsSince(oldStats map[int64]*BpfProgStats) map[int64]*BpfProgStats
- func TraceBenchNameOrPanic(s string) string
- func TraceBenchSupported() []string
- type Arguments
- type BpfProgStats
- type CPUUsage
- type CPUUsageTarget
- type CountingDiscardWriter
- type Summary
- type TraceBench
Constants ¶
View Source
const ( CPU_USAGE_ALL_THREADS = syscall.RUSAGE_SELF CPU_USAGE_THIS_THREAD = syscall.RUSAGE_THREAD )
Variables ¶
This section is empty.
Functions ¶
func EnableBpfStats ¶
func EnableBpfStats() func() error
func GetBpfStats ¶
func GetBpfStats() map[int64]*BpfProgStats
func GetBpfStatsSince ¶
func GetBpfStatsSince(oldStats map[int64]*BpfProgStats) map[int64]*BpfProgStats
func TraceBenchNameOrPanic ¶
func TraceBenchSupported ¶
func TraceBenchSupported() []string
Types ¶
type Arguments ¶
type BpfProgStats ¶
type BpfProgStats struct { Id int64 `json:"id"` Type string `json:"type"` Name string `json:"name"` RunNs int64 `json:"run_time_ns"` RunCnt int64 `json:"run_cnt"` }
func (*BpfProgStats) String ¶
func (bps *BpfProgStats) String() string
type CPUUsage ¶
type CPUUsage struct { SystemTime time.Duration UserTime time.Duration MaxRss int64 ContextSwitches int64 }
func CPUUsageFromRusage ¶
func GetCPUUsage ¶
func GetCPUUsage(tgt CPUUsageTarget) CPUUsage
type CPUUsageTarget ¶
type CPUUsageTarget int
type CountingDiscardWriter ¶
type CountingDiscardWriter struct {
// contains filtered or unexported fields
}
func (*CountingDiscardWriter) String ¶
func (cw *CountingDiscardWriter) String() string
type Summary ¶
type Summary struct { Args *Arguments ExitEvents, ExecEvents int64 StartTime time.Time EndTime time.Time RunTime time.Time SetupDurationNanos time.Duration TestDurationNanos time.Duration JSONEncodingDurationNanos time.Duration ExportStats CountingDiscardWriter TetragonCPUUsage CPUUsage // key is the bpf program id BpfStats map[int64]*BpfProgStats Error string }
Summary gathers benchmark results. Serializes to JSON. This is updated from multiple places concurrently (ExportStats are from tetragon process), but currently there is no overlap on writes, so this isn't yet protected by a mutex.
func RunTraceBench ¶
func (*Summary) PrettyPrint ¶
func (s *Summary) PrettyPrint()
Click to show internal directories.
Click to hide internal directories.