Documentation
¶
Overview ¶
Package profiler provides functionality for the Tako framework.
Index ¶
- type EventLog
- type HookMetric
- type MemoryHealth
- type Profiler
- func (c *Profiler) ClearHookStats(id string)
- func (c *Profiler) GetEvents() []EventLog
- func (c *Profiler) GetHealth() MemoryHealth
- func (c *Profiler) GetPluginMetrics(id string) *HookMetric
- func (c *Profiler) RecordBootTimes(framework, app, plugins time.Duration)
- func (c *Profiler) RecordHook(id string, dur time.Duration)
- func (c *Profiler) RecordUpdate(dur time.Duration)
- func (c *Profiler) RecordView(dur time.Duration)
- func (c *Profiler) Stop()
- func (c *Profiler) Tick()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HookMetric ¶
type HookMetric struct {
ID string `json:"id"`
AvgTimeMs float64 `json:"avg_time_ms"`
Calls int `json:"calls"`
}
HookMetric represents performance data for a single hook.
type MemoryHealth ¶
type MemoryHealth struct {
AllocMB uint64
SysMB uint64
NumGC uint32
NumGoroutine int `json:"num_goroutine"`
ActiveJobs int `json:"active_jobs"`
Tickers int `json:"tickers"`
PauseTotalNs uint64 `json:"pause_total_ns"`
Uptime time.Duration `json:"uptime"`
Fps float64 `json:"fps"`
AvgUpdateMs float64 `json:"avg_update_ms"`
AvgViewMs float64 `json:"avg_view_ms"`
FrameworkBootMs float64 `json:"framework_boot_ms"`
AppBootMs float64 `json:"app_boot_ms"`
PluginsBootMs float64 `json:"plugins_boot_ms"`
TotalBootMs float64 `json:"total_boot_ms"`
HasRecordedMetrics bool `json:"has_recorded_metrics"`
IsIdle bool `json:"is_idle"`
TotalEvents int64 `json:"total_events"`
EventsPerSec float64 `json:"events_per_sec"`
TotalHooks int `json:"total_hooks"`
HookMetrics []HookMetric `json:"hook_metrics"`
}
MemoryHealth returns current memory and goroutine stats.
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
Profiler gathers and buffers profiler data.
func NewProfiler ¶
NewProfiler creates a new Profiler.
func (*Profiler) ClearHookStats ¶
ClearHookStats removes profiling data for a specific hook.
func (*Profiler) GetHealth ¶
func (c *Profiler) GetHealth() MemoryHealth
GetHealth returns the current system health metrics.
func (*Profiler) GetPluginMetrics ¶
func (c *Profiler) GetPluginMetrics(id string) *HookMetric
GetPluginMetrics returns metrics for a specific plugin ID.
func (*Profiler) RecordBootTimes ¶
RecordBootTimes logs framework, app, and total boot times.
func (*Profiler) RecordHook ¶
RecordHook logs the execution time of a hook.
func (*Profiler) RecordUpdate ¶
RecordUpdate logs the duration of an Update cycle.
func (*Profiler) RecordView ¶
RecordView logs the duration of a View cycle and increments the frame counter.