models

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUStatistics

type CPUStatistics struct {
	TotalCores                  float64 `json:"total_cores"`
	TotalLogicalCores           float64 `json:"total_logical_cores"`
	CoresUsedBySystem           float64 `json:"cores_used_by_system"`
	CoresUsedByService          float64 `json:"cores_used_by_service"`
	CoresUsedByServiceInPercent string  `json:"cores_used_by_service_in_percent"`
	CoresUsedBySystemInPercent  string  `json:"cores_used_by_system_in_percent"`
}

CPUStatistics represents the CPU statistics of the service.

type CoreStatistics

type CoreStatistics struct {
	Goroutines int    `json:"goroutines"`
	Uptime     string `json:"uptime"`
}

CoreStatistics represents the core statistics of the service.

type DataPointsInfo

type DataPointsInfo struct {
	FieldName string                `json:"field_name"`
	Data      []*tstorage.DataPoint `json:"data_points"`
}

DataPointsInfo is the struct to store the data points information

type FetchDataPoints

type FetchDataPoints struct {
	FieldName []string `json:"field_name"`
	StartTime string   `json:"start_time"` // "2006-01-02T15:04:05Z07:00"
	EndTime   string   `json:"end_time"`   // "2006-01-02T15:04:05Z07:00"
}

FetchDataPoints is the struct to fetch the data points from the storage

type FunctionMetrics added in v0.0.2

type FunctionMetrics struct {
	FunctionLastRanAt  time.Time     `json:"function_last_ran_at"`
	CPUProfileFilePath string        `json:"cpu_profile_file_path"`
	MemProfileFilePath string        `json:"mem_profile_file_path"`
	MemoryUsage        uint64        `json:"memory_usage"`
	GoroutineCount     int           `json:"goroutine_count"`
	ExecutionTime      time.Duration `json:"execution_time"`
}

FunctionMetrics represents the function metrics.

type FunctionTraceDetails added in v0.0.2

type FunctionTraceDetails struct {
	FunctionName      string   `json:"function_name"`
	CoreProfile       Profiles `json:"core_profile"`
	FunctionCodeTrace string   `json:"function_code_trace"`
}

FunctionTraceDetails represents the function trace details.

type GoRoutinesStatistic

type GoRoutinesStatistic struct {
	NumberOfGoroutines int      `json:"number_of_goroutines"`
	StackView          []string `json:"stack_view"`
}

GoRoutinesStatistic represents the Go routines statistics.

type Health

type Health struct {
	Percent float64 `json:"percent"`
	Healthy bool    `json:"healthy"`
	Message string  `json:"message"`
	IconMsg string  `json:"icon_msg"`
}

Health represents the health of the service.

type HealthFields added in v0.0.2

type HealthFields struct {
	Percentage    float64 `json:"percentage"`
	AllowedByUser float64 `json:"allowed_by_user"`
	Message       string  `json:"message"`
}

type LoadStatistics

type LoadStatistics struct {
	ServiceCPULoad       string `json:"service_cpu_load"`
	SystemCPULoad        string `json:"system_cpu_load"`
	TotalCPULoad         string `json:"total_cpu_load"`
	ServiceMemLoad       string `json:"service_memory_load"`
	SystemMemLoad        string `json:"system_memory_load"`
	TotalMemLoad         string `json:"total_memory_load"`
	OverallLoadOfService string `json:"overall_load_of_service"` // Final load of the service

}

LoadStatistics represents the load statistics of the service.

type MemoryStatistics

type MemoryStatistics struct {
	TotalSystemMemory   string               `json:"total_system_memory"`
	MemoryUsedBySystem  string               `json:"memory_used_by_system"`
	MemoryUsedByService string               `json:"memory_used_by_service"`
	AvailableMemory     string               `json:"available_memory"`
	GCPauseDuration     string               `json:"gc_pause_duration"`
	StackMemoryUsage    string               `json:"stack_memory_usage"`
	TotalSwapMemory     string               `json:"total_swap_memory"`
	FreeSwapMemory      string               `json:"free_swap_memory"`
	MemStatsRecords     []Record             `json:"mem_stats_records"`     // List of memory statistic records.
	RawMemStatsRecords  []RawMemStatsRecords `json:"raw_mem_stats_records"` // RawMemStatsRecords holds a list of raw memory statistic records.
}

MemoryStatistics represents the memory statistics of the service.

type Profiles added in v0.0.2

type Profiles struct {
	CPU string `json:"cpu_profile"`
	Mem string `json:"mem_profile"`
}

Profiles represents the profiles.

type RawMemStatsRecords

type RawMemStatsRecords struct {
	RecordName  string  `json:"record_name"`
	RecordValue float64 `json:"record_value"`
}

RawMemStatsRecords holds a list of raw memory statistic records.

type Record

type Record struct {
	Name        string      `json:"record_name"`
	Description string      `json:"record_description"`
	Value       interface{} `json:"record_value"`
	Unit        string      `json:"record_unit,omitempty"` // Added Unit to support different units like bytes, MB, GB, etc.
}

Record represents a single memory statistic record.

type ReportsRequest

type ReportsRequest struct {
	Topic     string `json:"topic"`
	StartTime string `json:"start_time"` // "2006-01-02T15:04:05Z07:00"
	EndTime   string `json:"end_time"`   // "2006-01-02T15:04:05Z07:00"
	TimeFrame string `json:"time_frame"`
}

ReportsRequest is the struct to store the reports request

type ServiceHealth

type ServiceHealth struct {
	SystemHealth  Health `json:"system_health"`
	ServiceHealth Health `json:"service_health"`
}

ServiceHealth represents the health of the service.

type ServiceHealthThresholds

type ServiceHealthThresholds struct {
	MaxCPUUsage    float64 `json:"max_cpu_usage"`    // Default is 80%
	MaxMemoryUsage float64 `json:"max_memory_usage"` // Default is 80%
	MaxGoRoutines  int     `json:"max_go_routines"`  // Default is 1000
}

ServiceHealthThresholds is the struct to store the service health thresholds

type ServiceInfo

type ServiceInfo struct {
	ServiceName      string    `json:"service_name"`
	ServiceStartTime time.Time `json:"service_start_time"`
	GoVersion        string    `json:"go_version"`
	ProcessId        int32     `json:"process_id"`
}

ServiceInfo is the struct to store the service information

type ServiceStats

type ServiceStats struct {
	CoreStatistics   CoreStatistics   `json:"core_statistics"`   // Core Statistics
	LoadStatistics   LoadStatistics   `json:"load_statistics"`   // Load Statistics
	CPUStatistics    CPUStatistics    `json:"cpu_statistics"`    // CPU Statistics
	MemoryStatistics MemoryStatistics `json:"memory_statistics"` // Memory Statistics

	// Additional Metrics
	HeapAllocByService  string `json:"heap_alloc_by_service"`
	HeapAllocBySystem   string `json:"heap_alloc_by_system"`
	TotalAllocByService string `json:"total_alloc_by_service"`
	TotalMemoryByOS     string `json:"total_memory_by_os"`
	// DiskIO            float64 `json:"disk_io"` @TODO: Need to work on this
	NetworkIO struct {
		BytesSent     float64 `json:"bytes_sent"`
		BytesReceived float64 `json:"bytes_received"`
	} `json:"network_io"`

	// Health
	Health ServiceHealth `json:"health"`
}

ServiceStats represents the final statistics of the service.

type SystemHealthInPercent

type SystemHealthInPercent struct {
	SystemHealth  HealthFields `json:"system_health_percentage"`
	ServiceHealth HealthFields `json:"service_health_percentage"`
}

SystemHealthInPercent is the struct to store the system health in percentage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL