Documentation
¶
Index ¶
- type DB
- func (db *DB) Cleanup(olderThan time.Duration) (int64, error)
- func (db *DB) Close() error
- func (db *DB) GetLogs(filter *TrafficFilter) ([]TrafficLog, int, error)
- func (db *DB) GetStats(deploymentName string, since time.Duration) (*TrafficStats, error)
- func (db *DB) GetUnknownDomainStats(knownDeployments []string, since time.Duration) (*UnknownDomainStats, error)
- func (db *DB) InsertLog(log *TrafficLog) (int64, error)
- type DeploymentTrafficStats
- type HourlyStats
- type IPTrafficStats
- type IngestTrafficLog
- type Manager
- func (m *Manager) Cleanup(days int) (int64, error)
- func (m *Manager) Close() error
- func (m *Manager) GetLogs(filter *TrafficFilter) ([]TrafficLog, int, error)
- func (m *Manager) GetStats(deploymentName string, since time.Duration) (*TrafficStats, error)
- func (m *Manager) GetUnknownDomainStats(knownDeployments []string, since time.Duration) (*UnknownDomainStats, error)
- func (m *Manager) IngestLog(ingest *IngestTrafficLog) (*TrafficLog, error)
- type PathStats
- type TrafficFilter
- type TrafficLog
- type TrafficStats
- type UnknownDomainEntry
- type UnknownDomainIPEntry
- type UnknownDomainStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) GetLogs ¶
func (db *DB) GetLogs(filter *TrafficFilter) ([]TrafficLog, int, error)
func (*DB) GetUnknownDomainStats ¶
type DeploymentTrafficStats ¶
type DeploymentTrafficStats struct {
Name string `json:"name"`
TotalRequests int64 `json:"total_requests"`
AvgResponseTime float64 `json:"avg_response_time_ms"`
ErrorRate float64 `json:"error_rate"`
Status2xx int64 `json:"status_2xx"`
Status3xx int64 `json:"status_3xx"`
Status4xx int64 `json:"status_4xx"`
Status5xx int64 `json:"status_5xx"`
}
type HourlyStats ¶
type IPTrafficStats ¶
type IngestTrafficLog ¶
type IngestTrafficLog struct {
DeploymentName string `json:"deployment_name"`
RequestPath string `json:"request_path"`
RequestMethod string `json:"request_method"`
StatusCode int `json:"status_code"`
SourceIP string `json:"source_ip"`
ResponseTimeMs int `json:"response_time_ms"`
BytesSent int `json:"bytes_sent"`
RequestLength int `json:"request_length"`
UpstreamTimeMs *int `json:"upstream_time_ms,omitempty"`
Timestamp int64 `json:"timestamp"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) GetLogs ¶
func (m *Manager) GetLogs(filter *TrafficFilter) ([]TrafficLog, int, error)
func (*Manager) GetUnknownDomainStats ¶
func (*Manager) IngestLog ¶
func (m *Manager) IngestLog(ingest *IngestTrafficLog) (*TrafficLog, error)
type TrafficFilter ¶
type TrafficLog ¶
type TrafficLog struct {
ID int64 `json:"id"`
DeploymentName string `json:"deployment_name"`
RequestPath string `json:"request_path"`
RequestMethod string `json:"request_method"`
StatusCode int `json:"status_code"`
SourceIP string `json:"source_ip"`
ResponseTimeMs int `json:"response_time_ms"`
BytesSent int `json:"bytes_sent"`
RequestLength int `json:"request_length"`
UpstreamTimeMs *int `json:"upstream_time_ms,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type TrafficStats ¶
type TrafficStats struct {
TotalRequests int64 `json:"total_requests"`
TotalBytes int64 `json:"total_bytes"`
AvgResponseTimeMs float64 `json:"avg_response_time_ms"`
ByStatusGroup map[string]int64 `json:"by_status_group"`
ByDeployment map[string]int64 `json:"by_deployment"`
ByMethod map[string]int64 `json:"by_method"`
TopPaths []PathStats `json:"top_paths"`
TopIPs []IPTrafficStats `json:"top_ips"`
RequestsPerHour []HourlyStats `json:"requests_per_hour"`
DeploymentStats []DeploymentTrafficStats `json:"deployment_stats"`
}
type UnknownDomainEntry ¶
type UnknownDomainIPEntry ¶
type UnknownDomainStats ¶
type UnknownDomainStats struct {
TotalRequests int64 `json:"total_requests"`
TopDomains []UnknownDomainEntry `json:"top_domains"`
TopIPs []UnknownDomainIPEntry `json:"top_ips"`
RecentLogs []TrafficLog `json:"recent_logs"`
}
Click to show internal directories.
Click to hide internal directories.