Documentation
¶
Overview ¶
Package ping provides TUI model for ping diagnostic tool
Package ping provides ping diagnostic functionality
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatPingStatistics ¶
func FormatPingStatistics(stats PingStatistics) string
FormatPingStatistics formats ping statistics for display
Types ¶
type LatencyGraph ¶
type LatencyGraph struct {
Values []time.Duration
MaxValues int
MaxRTT time.Duration
MinRTT time.Duration
Width int
Height int
}
LatencyGraph represents a simple ASCII graph of latency over time
type LiveStatistics ¶
type LiveStatistics struct {
PacketsSent int `json:"packets_sent"`
PacketsReceived int `json:"packets_received"`
PacketLoss float64 `json:"packet_loss_percent"`
MinRTT time.Duration `json:"min_rtt"`
MaxRTT time.Duration `json:"max_rtt"`
AvgRTT time.Duration `json:"avg_rtt"`
LastRTT time.Duration `json:"last_rtt"`
Jitter time.Duration `json:"jitter"`
ElapsedTime time.Duration `json:"elapsed_time"`
}
LiveStatistics tracks real-time ping statistics
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the ping tool TUI model
type ModelState ¶
type ModelState int
ModelState represents the current state of the model
const ( StateInput ModelState = iota StateRunning StateResult StateError )
type PacketLossIndicator ¶
type PacketLossIndicator struct {
RecentResults []bool // true = success, false = loss
MaxResults int
LossCount int
TotalCount int
}
PacketLossIndicator shows packet loss visualization
type PingStatistics ¶
type PingStatistics struct {
PacketsSent int `json:"packets_sent"`
PacketsReceived int `json:"packets_received"`
PacketLoss float64 `json:"packet_loss_percent"`
MinRTT time.Duration `json:"min_rtt"`
MaxRTT time.Duration `json:"max_rtt"`
AvgRTT time.Duration `json:"avg_rtt"`
StdDevRTT time.Duration `json:"stddev_rtt"`
TotalTime time.Duration `json:"total_time"`
}
PingStatistics contains calculated ping statistics
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool implements the DiagnosticTool interface for ping operations
func NewTool ¶
func NewTool(client domain.NetworkClient, logger domain.Logger) *Tool
NewTool creates a new ping diagnostic tool
func (*Tool) Description ¶
Description returns the tool description
Click to show internal directories.
Click to hide internal directories.