Documentation
¶
Index ¶
- Constants
- func AdjacentPrefix(p netip.Prefix) netip.Prefix
- func GetFirstDirectory(url string) string
- func HumanizeAgo(d time.Duration) string
- func OpenFile(filename string) (io.ReadCloser, error)
- func TruncateFilenameLen(input string, target int) string
- func TruncateURLPath(input string) string
- func TruncateURLPathLen(input string, target int) string
- type Analyzer
- func (a *Analyzer) AnalyzeFile(filename string) error
- func (a *Analyzer) DirAnalyze(displayRecord map[netip.Prefix]time.Time, sortBy SortByFlag, ...)
- func (a *Analyzer) GetActiveConns(activeConn map[netip.Prefix]int)
- func (a *Analyzer) GetCurrentServers() []string
- func (a *Analyzer) IPPrefix(ip netip.Addr) netip.Prefix
- func (a *Analyzer) OpenLogFile() error
- func (a *Analyzer) OpenTailIterator(filename string) (fileiter.Iterator, error)
- func (a *Analyzer) PrintTopValues(displayRecord map[netip.Prefix]time.Time, sortBy SortByFlag, ...)
- func (a *Analyzer) PrintTotal()
- func (a *Analyzer) RunLoop(iter fileiter.Iterator) error
- func (a *Analyzer) RunLoopWithMultipleIterators(iters []fileiter.Iterator) error
- func (a *Analyzer) SortedKeys(sortBy SortByFlag, serverFilter string) []StatKey
- func (a *Analyzer) TailFile(filename string) error
- type AnalyzerConfig
- type DirectoryStats
- type DirectoryTotalStats
- type IPStats
- type SortByFlag
- type SortFunc
- type StatKey
- type UAKeyType
Constants ¶
View Source
const TimeFormat = time.DateTime
Variables ¶
This section is empty.
Functions ¶
func GetFirstDirectory ¶ added in v0.1.3
func HumanizeAgo ¶ added in v0.1.4
func TruncateFilenameLen ¶
func TruncateURLPath ¶
func TruncateURLPathLen ¶
Types ¶
type Analyzer ¶
type Analyzer struct {
Config AnalyzerConfig
// contains filtered or unexported fields
}
func NewAnalyzer ¶
func NewAnalyzer(c AnalyzerConfig) (*Analyzer, error)
func (*Analyzer) AnalyzeFile ¶
func (*Analyzer) DirAnalyze ¶ added in v0.1.3
func (*Analyzer) GetActiveConns ¶
func (*Analyzer) GetCurrentServers ¶
func (*Analyzer) OpenLogFile ¶
func (*Analyzer) OpenTailIterator ¶
func (*Analyzer) PrintTopValues ¶
func (*Analyzer) PrintTotal ¶
func (a *Analyzer) PrintTotal()
func (*Analyzer) RunLoopWithMultipleIterators ¶
func (*Analyzer) SortedKeys ¶
func (a *Analyzer) SortedKeys(sortBy SortByFlag, serverFilter string) []StatKey
SortedKeys returns stat keys sorted by value
type AnalyzerConfig ¶
type AnalyzerConfig struct {
Absolute bool
Group bool
LogOutput string
NoNetstat bool
Parser string
PrefixV4 int
PrefixV6 int
PrintDelta util.SizeFlag
RefreshSec int
RepeatWarn time.Duration
SortBy SortByFlag
TopN int
Truncate bool
Truncate2 int
Whole bool
Filter grep.Filter
Analyze bool
Daemon bool
DirAnalyze bool
CpuProfile string
MemProfile string
}
func DefaultConfig ¶
func DefaultConfig() AnalyzerConfig
func (*AnalyzerConfig) InstallFlags ¶
func (c *AnalyzerConfig) InstallFlags(flags *pflag.FlagSet, cmdname string)
func (*AnalyzerConfig) UseLock ¶
func (c *AnalyzerConfig) UseLock() bool
type DirectoryStats ¶ added in v0.1.3
type DirectoryTotalStats ¶ added in v0.1.3
type IPStats ¶
type IPStats struct {
Size uint64
Requests uint64
LastURL string
// Directory statistics
DirStats map[string]*DirectoryStats
// Used only in daemon mode
LastSize uint64
FirstSeen time.Time
// Time of last URL change
LastURLUpdate time.Time
// Time of last URL access
LastURLAccess time.Time
// User-agent storage
UAStore map[UAKeyType]struct{}
}
type SortByFlag ¶
type SortByFlag string
const ( SortBySize SortByFlag = "size" SortByRequests SortByFlag = "requests" SortByDirectory SortByFlag = "directory" )
func ListSortFuncs ¶
func ListSortFuncs() []SortByFlag
func (*SortByFlag) Set ¶
func (s *SortByFlag) Set(value string) error
func (SortByFlag) String ¶
func (s SortByFlag) String() string
func (SortByFlag) Type ¶
func (s SortByFlag) Type() string
type SortFunc ¶
func GetSortFunc ¶
func GetSortFunc(name SortByFlag, i map[StatKey]IPStats) SortFunc
Click to show internal directories.
Click to hide internal directories.