Documentation
¶
Index ¶
- type MemoryStats
- type PerformanceMetrics
- type Profiler
- func (p *Profiler) ForceGC(ctx context.Context) MemoryStats
- func (p *Profiler) GeneratePerformanceReport() map[string]interface{}
- func (p *Profiler) GetMemoryStats() []MemoryStats
- func (p *Profiler) GetPerformanceMetrics() PerformanceMetrics
- func (p *Profiler) MemoryUsageMB() float64
- func (p *Profiler) RecordMemoryUsage(ctx context.Context) MemoryStats
- func (p *Profiler) StartMemoryMonitoring(ctx context.Context, interval time.Duration)
- func (p *Profiler) TimeOperation(ctx context.Context, operationType string, operation func() error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStats ¶
type MemoryStats struct {
Alloc uint64 `json:"alloc"`
TotalAlloc uint64 `json:"total_alloc"`
Sys uint64 `json:"sys"`
Mallocs uint64 `json:"mallocs"`
Frees uint64 `json:"frees"`
LiveObjects uint64 `json:"live_objects"`
PauseNs []uint64 `json:"pause_ns"`
NumGC uint32 `json:"num_gc"`
Timestamp time.Time `json:"timestamp"`
}
MemoryStats holds memory usage statistics
type PerformanceMetrics ¶
type PerformanceMetrics struct {
EmbeddingLoadTime time.Duration `json:"embedding_load_time"`
SchemaLoadTime time.Duration `json:"schema_load_time"`
LLMResponseTime time.Duration `json:"llm_response_time"`
SemanticSearchTime time.Duration `json:"semantic_search_time"`
FileGenerationTime time.Duration `json:"file_generation_time"`
MCPStartupTime time.Duration `json:"mcp_startup_time"`
ChatSessionStartTime time.Duration `json:"chat_session_start_time"`
}
PerformanceMetrics tracks various performance metrics
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
Profiler provides performance monitoring capabilities
func NewProfiler ¶
NewProfiler creates a new performance profiler
func (*Profiler) ForceGC ¶
func (p *Profiler) ForceGC(ctx context.Context) MemoryStats
ForceGC triggers garbage collection and measures the impact
func (*Profiler) GeneratePerformanceReport ¶
GeneratePerformanceReport creates a comprehensive performance report
func (*Profiler) GetMemoryStats ¶
func (p *Profiler) GetMemoryStats() []MemoryStats
GetMemoryStats returns current memory statistics
func (*Profiler) GetPerformanceMetrics ¶
func (p *Profiler) GetPerformanceMetrics() PerformanceMetrics
GetPerformanceMetrics returns current performance metrics
func (*Profiler) MemoryUsageMB ¶
MemoryUsageMB returns current memory usage in megabytes
func (*Profiler) RecordMemoryUsage ¶
func (p *Profiler) RecordMemoryUsage(ctx context.Context) MemoryStats
RecordMemoryUsage captures current memory statistics
func (*Profiler) StartMemoryMonitoring ¶
StartMemoryMonitoring begins periodic memory monitoring
Click to show internal directories.
Click to hide internal directories.