Documentation ¶
Index ¶
Constants ¶
const ( EventMatchSelectorFirst = "first" EventMatchSelectorLast = "last" EventMatchSelectorAll = "all" )
Match Selector consts for an Event's MatchSelector
Variables ¶
This section is empty.
Functions ¶
func CommentMatchedLine ¶ added in v0.1.7
CommentMatchedLine is a helper func that returns a func that can be used as a CommentFunc in an Event The func will use the matched line as the comment
Types ¶
type CommentFunc ¶ added in v0.1.7
type Event ¶ added in v0.1.7
type Event struct { Name string `json:"name"` Metric string `json:"metric"` MatchSelector string `json:"matchSelector"` Terminal bool `json:"terminal"` SrcName string `json:"src"` Src Source `json:"-"` CommentFn CommentFunc `json:"-"` FindFn FindFunc `json:"-"` }
Event defines what is being timed from a specific source
type FindResult ¶ added in v0.1.7
FindResult is all data associated with a find including the raw Line data
func SelectMatches ¶ added in v0.1.7
func SelectMatches(results []FindResult, matchSelector string) []FindResult
SelectMaches will filter raw results based on the provided matchSelector
type LogReader ¶
type LogReader struct { Path string Glob bool TimestampRegex *regexp.Regexp TimestampLayout string // contains filtered or unexported fields }
LogReader is a base Source helper that can Read file contents, cache, and support Glob file paths Other Sources can be built on-top of the LogSrc
func (*LogReader) Find ¶
Find searches for the passed in regexp from the log references in the LogReader
func (*LogReader) ParseTimestamp ¶ added in v0.1.7
ParseTimestamp usese the configured timestamp regex to find a timestamp from the passed in log line and return as a time.Time
type Source ¶
type Source interface { // Find finds the string in the source using a source specific method (could be regex or HTTP path) // If no time.Time could be found an error is returned Find(event *Event) ([]FindResult, error) // Name is the source name identifier Name() string // ClearCache clears any cached source data ClearCache() // String is a human friendly version of the source, usually the log filepath String() string }
Source is an interface representing a source of events which have a time stamp or latency associated with them. Most often source is a log file or an API.
Directories ¶
Path | Synopsis |
---|---|
Package awsnode is a latency timing source for the VPC CNI logs (aka aws-node DaemonSet)
|
Package awsnode is a latency timing source for the VPC CNI logs (aka aws-node DaemonSet) |
Package ec2 is a latency timing source for ec2 API events
|
Package ec2 is a latency timing source for ec2 API events |
Package imds is a latency timing source for the EC2 Instance Metadata Service (IMDS)
|
Package imds is a latency timing source for the EC2 Instance Metadata Service (IMDS) |
Package k8s is a latency timing source for K8s API events
|
Package k8s is a latency timing source for K8s API events |
Package messages is a latency timing source for /var/log/messages
|
Package messages is a latency timing source for /var/log/messages |