Documentation ¶
Index ¶
- func CalculateHealthScore(serviceStats *models.ServiceStats) (*models.SystemHealthInPercent, error)
- func CalculateOverallLoad(serviceCPU, serviceMem string) string
- func CollectGoRoutinesInfo() models.GoRoutinesStatistic
- func ConfigureServiceThresholds(thresholdsValues *models.ServiceHealthThresholds)
- func ConstructMemStats(memStats *runtime.MemStats) []models.Record
- func ConstructRawMemStats(memStats *runtime.MemStats) []models.RawMemStatsRecords
- func FunctionTraceDetails() map[string]*models.FunctionMetrics
- func GetCPUPrecent() float64
- func GetCPUStatistics() models.CPUStatistics
- func GetCoreStatistics() models.CoreStatistics
- func GetLoadStatistics() models.LoadStatistics
- func GetMemoryStatistics() models.MemoryStatistics
- func GetNetworkIO() (float64, float64)
- func GetServiceHealth(serviceStats *models.ServiceStats) models.ServiceHealth
- func GetServiceStats() models.ServiceStats
- func GetVirtualMemoryStats() mem.VirtualMemoryStat
- func ReadMemStats() *runtime.MemStats
- func SplitGoroutines(stackTrace string) []string
- func StartCPUProfile(filename string) (*os.File, error)
- func StopCPUProfile(f *os.File)
- func TraceFunction(f func())
- func ViewFunctionMetrics(name, reportType string, metrics *models.FunctionMetrics) models.FunctionTraceDetails
- func WriteHeapProfile(filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateHealthScore ¶
func CalculateHealthScore(serviceStats *models.ServiceStats) (*models.SystemHealthInPercent, error)
CalculateHealthScore calculates the health score of both the system and service
func CalculateOverallLoad ¶
Function to calculate overall load
func CollectGoRoutinesInfo ¶
func CollectGoRoutinesInfo() models.GoRoutinesStatistic
CollectGoRoutinesInfo returns the number of running Go routines and their stack traces split into separate goroutine blocks.
func ConfigureServiceThresholds ¶
func ConfigureServiceThresholds(thresholdsValues *models.ServiceHealthThresholds)
SetServiceThresholds sets the service thresholds to calculate the overall service health.
func ConstructMemStats ¶
ConstructMemStats constructs a list of memory statistics records.
func ConstructRawMemStats ¶
func ConstructRawMemStats(memStats *runtime.MemStats) []models.RawMemStatsRecords
ConstructRawMemStats constructs a list of raw memory statistics records.
func FunctionTraceDetails ¶ added in v0.0.2
func FunctionTraceDetails() map[string]*models.FunctionMetrics
FunctionTraceDetails returns the function trace details
func GetCPUPrecent ¶
func GetCPUPrecent() float64
GetRequestCount returns the total number of requests
func GetCPUStatistics ¶
func GetCPUStatistics() models.CPUStatistics
GetCPUStatistics retrieves the CPU statistics.
func GetCoreStatistics ¶
func GetCoreStatistics() models.CoreStatistics
GetCoreStatistics retrieves core statistics like goroutines, request count, uptime, and total request duration
func GetLoadStatistics ¶
func GetLoadStatistics() models.LoadStatistics
GetLoadStatistics retrieves load statistics for CPU, memory, and optionally disk usage.
func GetMemoryStatistics ¶
func GetMemoryStatistics() models.MemoryStatistics
GetMemoryStatistics retrieves memory statistics.
func GetNetworkIO ¶
GetNetworkIO retrieves network I/O statistics.
func GetServiceHealth ¶
func GetServiceHealth(serviceStats *models.ServiceStats) models.ServiceHealth
GetServiceHealth retrieves the service health statistics.
func GetServiceStats ¶
func GetServiceStats() models.ServiceStats
GetServiceStats collects statistics related to service and system performance.
func GetVirtualMemoryStats ¶
func GetVirtualMemoryStats() mem.VirtualMemoryStat
GetVirtualMemoryStats returns the virtual memory statistics
func ReadMemStats ¶
ReadMemStats reads and returns the memory statistics
func SplitGoroutines ¶
SplitGoroutines splits the input stack trace into separate goroutine blocks based on new lines and "goroutine" identifiers.
func StartCPUProfile ¶
StartCPUProfile starts the CPU profile and writes it to the specified file.
func StopCPUProfile ¶
StopCPUProfile stops the current CPU profile and writes it to the specified file.
func TraceFunction ¶ added in v0.0.2
func TraceFunction(f func())
TraceFunction traces the function and captures the metrics
func ViewFunctionMetrics ¶ added in v0.0.2
func ViewFunctionMetrics(name, reportType string, metrics *models.FunctionMetrics) models.FunctionTraceDetails
ViewFunctionMetrics generates the function metrics
func WriteHeapProfile ¶
WriteHeapProfile writes the current memory heap profile to the specified file.
Types ¶
This section is empty.