cli

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APP  = "Redis Monitor Top"
	VER  = "1.3.3"
	DESC = "Tiny Redis client for aggregating stats from MONITOR flow"
)
View Source
const (
	OPT_HOST     = "h:host"
	OPT_PORT     = "p:port"
	OPT_AUTH     = "a:password"
	OPT_TIMEOUT  = "t:timeout"
	OPT_INTERVAL = "i:interval"
	OPT_NO_COLOR = "nc:no-color"
	OPT_HELP     = "help"
	OPT_VER      = "v:version"

	OPT_VERB_VER     = "vv:verbose-version"
	OPT_COMPLETION   = "completion"
	OPT_GENERATE_MAN = "generate-man"
)
View Source
const MAX_COMMANDS = 128

Variables

This section is empty.

Functions

func Run

func Run(gitRev string, gomod []byte)

Run is main application function

Types

type CommandInfo

type CommandInfo struct {
	Name  string
	Count int64
}

CommandInfo contains name of command and count

type CommandInfoSlice

type CommandInfoSlice []*CommandInfo

func (CommandInfoSlice) Len

func (s CommandInfoSlice) Len() int

func (CommandInfoSlice) Less

func (s CommandInfoSlice) Less(i, j int) bool

func (CommandInfoSlice) Swap

func (s CommandInfoSlice) Swap(i, j int)

type Stats

type Stats struct {
	Data  map[string]*CommandInfo
	Slice CommandInfoSlice

	Dirty   bool
	HasData bool
}

func NewStats

func NewStats() *Stats

NewStats create new stats struct

func (*Stats) Clean

func (s *Stats) Clean()

Clean clean stats

func (*Stats) Increment

func (s *Stats) Increment(command string)

Increment increment counter for given command

Jump to

Keyboard shortcuts

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