presentation

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package presentation implements interactive and non-interactive reporting of cache activity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonReport added in v1.5.0

type JsonReport struct {
	Timestamp                   string
	TotalKeys                   int
	TotalBandwidth              int64
	ReportedKeys                int
	ReportedBandwidth           int64
	ReportedBandwidthPercentage float64
	Rows                        []map[string]interface{}
	Stats                       StatsSet
}

type StatProvider

type StatProvider func() StatsSet

StatProvider returns a snapshot of current runtime statistics.

type Stats

type Stats struct {
	// count of packets that entered the kernel BPF
	PacketsEnteredFilter int `json:"PacketsEnteredFilter"`
	// count of packets that passed the BPF and queued or dropped by the kernel
	PacketsPassedFilter int `json:"PacketsPassedFilter"`
	// count of packets received from pcap
	PacketsCaptured int `json:"PacketsCaptured"`
	// count of packets dropped due to kernel buffer overflow
	PacketsDroppedKernel int `json:"PacketsDroppedKernel"`
	// count of packets dropped due to no decoder available
	PacketsDroppedParser int `json:"PacketsDroppedParser"`
	// count of packets dropped due to analysis queue being full
	PacketsDroppedAnalysis int `json:"PacketsDroppedAnalysis"`
	PacketsDroppedTotal    int `json:"PacketsDroppedTotal"`
	ResponsesParsed        int `json:"ResponsesParsed"`
}

Stats collects statistics on runtime performance to be displayed to the user.

func (Stats) Diff added in v1.5.0

func (s Stats) Diff(other Stats) Stats

Subtracts other from these original set of stats, returning a new Stats

type StatsSet added in v1.5.0

type StatsSet struct {
	Culumative  *Stats
	Incremental *Stats
}

type UIHandler

type UIHandler interface {
	// Run starts this UIHandler running.
	// It does not return unless an error occurs.
	Run() error
	// Log displays a log message to the user.
	Log(items ...interface{})
}

UIHandler is the external API for an interactive user interface.

func New

func New(logger log.Logger, analysisPool *analysis.Pool, interval time.Duration, cumulative bool, statProvider StatProvider,
	useTermbox bool, topX uint16, minKeySizeThreshold uint64, outputFile string) UIHandler

New returns a UIHandler that is ready to run

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL