axslog

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllFlagOK = 3

AllFlagOK : all OK

View Source
var PtimeFlag = 1

PtimeFlag : ptime is exists

View Source
var StatusFlag = 2

StatusFlag : stattus is exists

Functions

func BFloat64 added in v0.0.3

func BFloat64(b []byte) (float64, error)

BFloat64 :

func BInt added in v0.0.3

func BInt(b []byte) (int, error)

BInt :

func DisplayAll added in v0.2.1

func DisplayAll(statsAll []*Stats, keyPrefix string) string

DisplayAll :

Types

type HumanBytes added in v0.4.12

type HumanBytes uint64

HumanBytes is a custom type to handle human-readable byte inputs

func (*HumanBytes) UnmarshalFlag added in v0.4.12

func (hb *HumanBytes) UnmarshalFlag(value string) error

UnmarshalFlag parses human inputs like "10MB" or "2GiB" using go-humanize

type Opt added in v0.4.13

type Opt struct {
	LogFile          string     `` /* 131-byte string literal not displayed */
	Format           string     `long:"format" default:"ltsv" description:"format of logfile. support json and ltsv"`
	KeyPrefix        string     `long:"key-prefix" description:"Metric key prefix" required:"true"`
	PtimeKey         string     `long:"ptime-key" default:"ptime" description:"key name for request_time"`
	StatusKeys       []string   `long:"status-key" default:"status" description:"key name for response status"`
	Filter           string     `long:"filter" default:"" description:"select lines contain a specified text from log"`
	SkipUntilBracket bool       `long:"skip-until-json" description:"skip reading until first { for json log with plain text header"`
	InvertFilter     bool       `long:"invert-filter" description:"select lines don't contain a specified text from log if a filter is specified"`
	MaxReadSize      HumanBytes `long:"max-read-size" description:"maximum size of log file to read (e.g. 10MB, 2GiB). 0 uses the default per format"`
	Version          bool       `short:"v" long:"version" description:"Show version"`
}

type Reader

type Reader interface {
	Parse([]byte) (int, []byte, []byte)
}

Reader :

type Stats added in v0.0.5

type Stats struct {
	// contains filtered or unexported fields
}

Stats :

func NewStats added in v0.0.5

func NewStats() *Stats

NewStats :

func (*Stats) Append added in v0.0.5

func (s *Stats) Append(ptime float64, status int)

Append :

func (*Stats) Display added in v0.0.5

func (s *Stats) Display(keyPrefix string) string

Display :

func (*Stats) GetTotal added in v0.0.5

func (s *Stats) GetTotal() float64

GetTotal :

func (*Stats) SetDuration added in v0.2.1

func (s *Stats) SetDuration(d float64)

SetDuration :

type StatsCh added in v0.2.1

type StatsCh struct {
	Stats   *Stats
	Logfile string
	Err     error
}

StatsCh :

Jump to

Keyboard shortcuts

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