mtail

package
v3.0.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mtail

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

Mtail contains the state of the main program object.

func New

func New(o Options) (*Mtail, error)

New creates an Mtail from the supplied Options.

func (*Mtail) Close

func (m *Mtail) Close()

Close handles the graceful shutdown of this mtail instance, ensuring that it only occurs once.

func (*Mtail) InitLoader

func (m *Mtail) InitLoader() error

InitLoader constructs a new program loader and performs the inital load of program files in the program directory.

func (*Mtail) OneShot

func (m *Mtail) OneShot(logfile string, print bool) (count int64, err error)

OneShot reads the contents of a log file into the lines channel from start to finish, terminating the program at the end.

func (*Mtail) Run

func (m *Mtail) Run()

Run starts Mtail in the configuration supplied in Options at creation.

func (*Mtail) RunOneShot

func (m *Mtail) RunOneShot()

RunOneShot performs the work of the one_shot commandline flag; after compiling programs mtail will read all of the log files in full, once, dump the metric results at the end, and then exit.

func (*Mtail) Serve

func (m *Mtail) Serve()

Serve begins the long-running mode of mtail, in which it watches the log files for changes and sends any new lines found into the lines channel for pick up by the virtual machines. It will continue to do so until it is signalled to exit.

func (*Mtail) ServeHTTP

func (m *Mtail) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Mtail) StartTailing

func (m *Mtail) StartTailing() error

StartTailing constructs a new Tailer and commences sending log lines into the lines channel.

func (*Mtail) WaitForShutdown

func (m *Mtail) WaitForShutdown()

WaitForShutdown handles shutdown requests from the system or the UI.

func (*Mtail) WriteMetrics

func (m *Mtail) WriteMetrics(w io.Writer) error

WriteMetrics dumps the current state of the metrics store in JSON format to the io.Writer.

type Options

type Options struct {
	Progs                string
	LogPaths             []string
	LogFds               []int
	Port                 string
	OneShot              bool
	OneShotMetrics       bool
	CompileOnly          bool
	DumpAst              bool
	DumpAstTypes         bool
	DumpBytecode         bool
	SyslogUseCurrentYear bool

	Store *metrics.Store

	W  watcher.Watcher // Not required, will use watcher.LogWatcher if zero.
	FS afero.Fs        // Not required, will use afero.OsFs if zero.
}

Options contains all the parameters necessary for constructing a new Mtail.

Jump to

Keyboard shortcuts

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