lpxgen

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2015 License: GPL-3.0, Apache-2.0 Imports: 6 Imported by: 2

README

lpxgen: Random Logplex Batches for testing.

Example usage

Let's say you want to test out lumbermill. You can use lpxgen to send random logplex batches at it with different types of log lines in the batches:

$ lpxgen -count 10000 -min 10 -max 100 -dist router:.8,dynomem:.1,dynoload:.1 http://lumbermill/drain

This will fire off 10000 batches with a batch size between 10 and 100, and ensuring that 80% of messages sent are Heroku router messages, while the other 20% are split between dynomem and dynoload.

Contributing and Feedback

If you'd like to fix or contribute something, please fork and submit a pull request, or open an issue. There's lots of room for improvement, and much more work to be done.

Authors

Andrew Gwozdziewycz web@apgwoz.com

Copyright 2014, Andrew Gwozdziewycz, web@apgwoz.com

Licensed under the GNU GPLv3. See LICENSE for more details

Documentation

Index

Constants

View Source
const (
	TimeFormat = "2006-01-02T15:04:05.000000+00:00"
)

Variables

This section is empty.

Functions

func FormatSyslog

func FormatSyslog(l Log) string

func RandomDrainToken

func RandomDrainToken() string

func RandomFrameId

func RandomFrameId() string

func RandomIPv4

func RandomIPv4() string

func UUID4

func UUID4() string

Types

type DefaultLog

type DefaultLog struct{}

func (DefaultLog) Hostname

func (d DefaultLog) Hostname() string

func (DefaultLog) Msg

func (d DefaultLog) Msg() string

func (DefaultLog) Msgid

func (d DefaultLog) Msgid() string

func (DefaultLog) Name

func (d DefaultLog) Name() string

func (DefaultLog) PrivalVersion

func (d DefaultLog) PrivalVersion() string

func (DefaultLog) Procid

func (d DefaultLog) Procid() string

func (DefaultLog) String

func (d DefaultLog) String() string

func (DefaultLog) Time

func (d DefaultLog) Time() string

type HerokuLog

type HerokuLog int
const (
	Router HerokuLog = iota
	DynoMem
	DynoLoad
)

func (HerokuLog) Hostname

func (d HerokuLog) Hostname() string

func (HerokuLog) Msg

func (d HerokuLog) Msg() string

func (HerokuLog) Msgid

func (d HerokuLog) Msgid() string

func (HerokuLog) Name

func (d HerokuLog) Name() string

func (HerokuLog) PrivalVersion

func (d HerokuLog) PrivalVersion() string

func (HerokuLog) Procid

func (d HerokuLog) Procid() string

func (HerokuLog) String

func (d HerokuLog) String() string

func (HerokuLog) Time

func (d HerokuLog) Time() string

type LPXGenerator

type LPXGenerator struct {
	Mincount int
	Maxcount int
	Log      Log
}

func NewGenerator

func NewGenerator(minBatch, maxBatch int, loggen Log) *LPXGenerator

func (*LPXGenerator) Generate

func (g *LPXGenerator) Generate(url string) *http.Request

type Log

type Log interface {
	PrivalVersion() string
	Time() string
	Hostname() string
	Name() string
	Procid() string
	Msgid() string
	Msg() string
	String() string
}

type ProbLog

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

func NewProbLog

func NewProbLog(logs map[Log]float32) *ProbLog

func (*ProbLog) Add

func (p *ProbLog) Add(l Log, prob float32)

func (*ProbLog) Hostname

func (p *ProbLog) Hostname() string

func (*ProbLog) Msg

func (p *ProbLog) Msg() string

func (*ProbLog) Msgid

func (p *ProbLog) Msgid() string

func (*ProbLog) Name

func (p *ProbLog) Name() string

func (*ProbLog) PrivalVersion

func (p *ProbLog) PrivalVersion() string

func (*ProbLog) Procid

func (p *ProbLog) Procid() string

func (*ProbLog) String

func (p *ProbLog) String() string

func (*ProbLog) Time

func (p *ProbLog) Time() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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