Documentation
¶
Overview ¶
Package widgets provides UI widgets for the observability plugin.
Index ¶
- type AlertHistoryWidget
- type AlertSummaryWidget
- type AlertsWidget
- type GaugeGroup
- type GaugeWidget
- type HeatmapWidget
- func (h *HeatmapWidget) Draw(screen tcell.Screen)
- func (h *HeatmapWidget) GetPrimitive() tview.Primitive
- func (h *HeatmapWidget) GetSelectedCell() (row, col string, value float64, ok bool)
- func (h *HeatmapWidget) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (h *HeatmapWidget) SetCellSize(width, height int)
- func (h *HeatmapWidget) SetData(data map[string]map[string]float64)
- func (h *HeatmapWidget) SetScale(minVal, maxVal float64)
- type NodeUtilizationHeatmap
- type SparklineGroup
- type SparklineWidget
- func (s *SparklineWidget) AddValue(value float64)
- func (s *SparklineWidget) Draw(screen tcell.Screen)
- func (s *SparklineWidget) GetPrimitive() tview.Primitive
- func (s *SparklineWidget) SetScale(minVal, maxVal float64)
- func (s *SparklineWidget) SetUnit(unit string)
- func (s *SparklineWidget) SetValues(values []float64)
- type TimeSeriesSparkline
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertHistoryWidget ¶
AlertHistoryWidget displays alert history with scrolling
func NewAlertHistoryWidget ¶
func NewAlertHistoryWidget() *AlertHistoryWidget
NewAlertHistoryWidget creates a new alert history widget
func (*AlertHistoryWidget) AddToHistory ¶
func (w *AlertHistoryWidget) AddToHistory(alert *models.Alert)
AddToHistory adds an alert to the history
func (*AlertHistoryWidget) GetSelectedAlert ¶
func (w *AlertHistoryWidget) GetSelectedAlert() *models.Alert
GetSelectedAlert returns the currently selected alert
type AlertSummaryWidget ¶
AlertSummaryWidget shows a compact alert summary
func NewAlertSummaryWidget ¶
func NewAlertSummaryWidget() *AlertSummaryWidget
NewAlertSummaryWidget creates a new alert summary widget
func (*AlertSummaryWidget) UpdateCounts ¶
func (w *AlertSummaryWidget) UpdateCounts(alerts []models.Alert)
UpdateCounts updates the alert counts
type AlertsWidget ¶
AlertsWidget displays active alerts
func NewAlertsWidget ¶
func NewAlertsWidget() *AlertsWidget
NewAlertsWidget creates a new alerts widget
func (*AlertsWidget) AddAlert ¶
func (w *AlertsWidget) AddAlert(alert *models.Alert)
AddAlert adds a new alert
func (*AlertsWidget) ClearAlerts ¶
func (w *AlertsWidget) ClearAlerts()
ClearAlerts removes all alerts
func (*AlertsWidget) GetPrimitive ¶
func (w *AlertsWidget) GetPrimitive() tview.Primitive
GetPrimitive returns the primitive for this widget
func (*AlertsWidget) SetAlerts ¶
func (w *AlertsWidget) SetAlerts(alerts []models.Alert)
SetAlerts updates the alerts list
type GaugeGroup ¶
GaugeGroup manages multiple gauges with consistent sizing
func NewGaugeGroup ¶
func NewGaugeGroup(direction int) *GaugeGroup
NewGaugeGroup creates a new gauge group
func (*GaugeGroup) AddGauge ¶
func (gg *GaugeGroup) AddGauge(title string, minVal, maxVal float64, unit string) *GaugeWidget
AddGauge adds a gauge to the group
func (*GaugeGroup) Update ¶
func (gg *GaugeGroup) Update(values map[string]float64)
Update updates all gauges in the group
type GaugeWidget ¶
GaugeWidget displays a value as a horizontal gauge/progress bar
func NewGaugeWidget ¶
func NewGaugeWidget(title string, minVal, maxVal float64, unit string) *GaugeWidget
NewGaugeWidget creates a new gauge widget
func (*GaugeWidget) GetPrimitive ¶
func (g *GaugeWidget) GetPrimitive() tview.Primitive
GetPrimitive returns the primitive for this widget
func (*GaugeWidget) SetColorFunc ¶
func (g *GaugeWidget) SetColorFunc(f func(float64) tcell.Color)
SetColorFunc sets a custom color function
func (*GaugeWidget) SetValue ¶
func (g *GaugeWidget) SetValue(value float64)
SetValue updates the gauge value
type HeatmapWidget ¶
HeatmapWidget displays a grid of values as a heatmap
func NewHeatmapWidget ¶
func NewHeatmapWidget(title string) *HeatmapWidget
NewHeatmapWidget creates a new heatmap widget
func (*HeatmapWidget) Draw ¶
func (h *HeatmapWidget) Draw(screen tcell.Screen)
Draw draws the heatmap
func (*HeatmapWidget) GetPrimitive ¶
func (h *HeatmapWidget) GetPrimitive() tview.Primitive
GetPrimitive returns the primitive for this widget
func (*HeatmapWidget) GetSelectedCell ¶
func (h *HeatmapWidget) GetSelectedCell() (row, col string, value float64, ok bool)
GetSelectedCell returns the currently selected cell
func (*HeatmapWidget) InputHandler ¶
func (h *HeatmapWidget) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler handles input events
func (*HeatmapWidget) SetCellSize ¶
func (h *HeatmapWidget) SetCellSize(width, height int)
SetCellSize sets the cell dimensions
func (*HeatmapWidget) SetData ¶
func (h *HeatmapWidget) SetData(data map[string]map[string]float64)
SetData sets the heatmap data
func (*HeatmapWidget) SetScale ¶
func (h *HeatmapWidget) SetScale(minVal, maxVal float64)
SetScale sets manual scale
type NodeUtilizationHeatmap ¶
type NodeUtilizationHeatmap struct {
*HeatmapWidget
}
NodeUtilizationHeatmap is a specialized heatmap for node utilization
func NewNodeUtilizationHeatmap ¶
func NewNodeUtilizationHeatmap() *NodeUtilizationHeatmap
NewNodeUtilizationHeatmap creates a heatmap optimized for node utilization display
func (*NodeUtilizationHeatmap) SetNodeMetrics ¶
func (h *NodeUtilizationHeatmap) SetNodeMetrics(metrics map[string]map[string]float64)
SetNodeMetrics sets metrics for nodes grouped by some criteria
type SparklineGroup ¶
SparklineGroup manages multiple sparklines
func NewSparklineGroup ¶
func NewSparklineGroup(direction int) *SparklineGroup
NewSparklineGroup creates a new sparkline group
func (*SparklineGroup) AddSparkline ¶
func (sg *SparklineGroup) AddSparkline(id, title string, maxPoints int) *SparklineWidget
AddSparkline adds a sparkline to the group
func (*SparklineGroup) UpdateAll ¶
func (sg *SparklineGroup) UpdateAll(values map[string]float64)
UpdateAll updates all sparklines with new values
func (*SparklineGroup) UpdateValue ¶
func (sg *SparklineGroup) UpdateValue(id string, value float64)
UpdateValue updates a specific sparkline with a new value
type SparklineWidget ¶
SparklineWidget displays a time series as a sparkline chart
func NewSparklineWidget ¶
func NewSparklineWidget(title string, maxPoints int) *SparklineWidget
NewSparklineWidget creates a new sparkline widget
func (*SparklineWidget) AddValue ¶
func (s *SparklineWidget) AddValue(value float64)
AddValue adds a new value to the sparkline
func (*SparklineWidget) Draw ¶
func (s *SparklineWidget) Draw(screen tcell.Screen)
Draw draws the sparkline
func (*SparklineWidget) GetPrimitive ¶
func (s *SparklineWidget) GetPrimitive() tview.Primitive
GetPrimitive returns the primitive for this widget
func (*SparklineWidget) SetScale ¶
func (s *SparklineWidget) SetScale(minVal, maxVal float64)
SetScale sets manual scale
func (*SparklineWidget) SetUnit ¶
func (s *SparklineWidget) SetUnit(unit string)
SetUnit sets the unit for display
func (*SparklineWidget) SetValues ¶
func (s *SparklineWidget) SetValues(values []float64)
SetValues sets all values at once
type TimeSeriesSparkline ¶
type TimeSeriesSparkline struct {
*SparklineWidget
// contains filtered or unexported fields
}
TimeSeriesSparkline is a specialized sparkline for time series data
func NewTimeSeriesSparkline ¶
func NewTimeSeriesSparkline(title string, timeWindow int64) *TimeSeriesSparkline
NewTimeSeriesSparkline creates a new time series sparkline
func (*TimeSeriesSparkline) AddTimedValue ¶
func (ts *TimeSeriesSparkline) AddTimedValue(value float64, timestamp int64)
AddTimedValue adds a value with timestamp