Documentation ¶
Index ¶
Constants ¶
View Source
const ( // unix timestamp in seconds when the event was observed ColumnUnixSeconds = "unix_seconds" ColumnDeviceName = "device_name" ColumnCongestedPercentAgainstThreshold = "congested_percent_against_threshold" ColumnMaxBackgroundPercentAgainstThreshold = "max_background_percent_against_threshold" )
View Source
const DefaultRetentionPeriod = 3 * time.Hour
View Source
const TableNameFUSEConnectionsEventHistory = "components_fuse_connections_event_history"
Variables ¶
View Source
var ErrInvalidLimit = errors.New("limit must be greater than or equal to 0")
Functions ¶
Types ¶
type Event ¶
type Event struct { UnixSeconds int64 `json:"unix_seconds"` DeviceName string `json:"device_name"` CongestedPercentAgainstThreshold float64 `json:"congested_percent_against_threshold"` MaxBackgroundPercentAgainstThreshold float64 `json:"max_background_percent_against_threshold"` }
func ReadEvents ¶
Returns nil if no event is found.
type OpOption ¶
type OpOption func(*Op)
func WithBefore ¶
WithBefore sets the before timestamp for the delete queries. If not specified, it deletes all events.
func WithSince ¶
WithSince sets the since timestamp for the select queries. If not specified, it returns all events.
func WithSortUnixSecondsAscendingOrder ¶
func WithSortUnixSecondsAscendingOrder() OpOption
WithSortUnixSecondsAscendingOrder sorts the events by unix_seconds in ascending order, meaning its read query returns the oldest events first.
func WithSortUnixSecondsDescendingOrder ¶
func WithSortUnixSecondsDescendingOrder() OpOption
WithSortUnixSecondsDescendingOrder sorts the events by unix_seconds in descending order, meaning its read query returns the newest events first.
Click to show internal directories.
Click to hide internal directories.