Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager interface {
// GetPool returns the current connection pool or error if not available
GetPool() (nntppool.UsenetConnectionPool, error)
// SetProviders creates/recreates the pool with new providers
SetProviders(providers []nntppool.UsenetProviderConfig) error
// ClearPool shuts down and removes the current pool
ClearPool() error
// HasPool returns true if a pool is currently available
HasPool() bool
// GetMetrics returns the current pool metrics with calculated speeds
GetMetrics() (MetricsSnapshot, error)
}
Manager provides centralized NNTP connection pool management
func NewManager ¶
NewManager creates a new pool manager
type MetricsSnapshot ¶
type MetricsSnapshot struct {
BytesDownloaded int64 `json:"bytes_downloaded"`
BytesUploaded int64 `json:"bytes_uploaded"`
ArticlesDownloaded int64 `json:"articles_downloaded"`
ArticlesPosted int64 `json:"articles_posted"`
TotalErrors int64 `json:"total_errors"`
ProviderErrors map[string]int64 `json:"provider_errors"`
DownloadSpeedBytesPerSec float64 `json:"download_speed_bytes_per_sec"`
UploadSpeedBytesPerSec float64 `json:"upload_speed_bytes_per_sec"`
Timestamp time.Time `json:"timestamp"`
}
MetricsSnapshot represents pool metrics at a point in time with calculated values
type MetricsTracker ¶
type MetricsTracker struct {
// contains filtered or unexported fields
}
MetricsTracker tracks pool metrics over time and calculates rates
func NewMetricsTracker ¶
func NewMetricsTracker(pool nntppool.UsenetConnectionPool) *MetricsTracker
NewMetricsTracker creates a new metrics tracker
func (*MetricsTracker) GetSnapshot ¶
func (mt *MetricsTracker) GetSnapshot() MetricsSnapshot
GetSnapshot returns the current metrics with calculated speeds
func (*MetricsTracker) Start ¶
func (mt *MetricsTracker) Start(ctx context.Context)
Start begins collecting metrics samples
func (*MetricsTracker) Stop ¶
func (mt *MetricsTracker) Stop()
Stop stops collecting metrics samples
Click to show internal directories.
Click to hide internal directories.