dump

package
v0.0.0-...-0ce9163 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

README

package dump

import "github.com/vivint/rothko/dump"

package dump provides periodic dumping from a scribbler to disk.

Usage

type Dumper
type Dumper struct {
}

Dumper is a worker that periodically dumps from a Writer into a database.

func New
func New(opts Options) *Dumper

New constructs a Dumper with the given options.

func (*Dumper) Dump
func (d *Dumper) Dump(ctx context.Context, w *data.Writer)

Dump writes all of the metrics Captured from the Writer into the DB associated with the Dumper.

func (*Dumper) Run
func (d *Dumper) Run(ctx context.Context, w *data.Writer) (err error)

Run dumps periodically, until the context is canceled. When the context is canceled, it waits for any active Dump and returns.

type Options
type Options struct {
	// The database to dump into.
	DB database.DB

	// How often to dump.
	Period time.Duration

	// How big a buffer to use for records. Defaults to 1024.
	Bufsize int
}

Options controls the options to the dumper.

Documentation

Overview

package dump provides periodic dumping from a scribbler to disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dumper

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

Dumper is a worker that periodically dumps from a Writer into a database.

func New

func New(opts Options) *Dumper

New constructs a Dumper with the given options.

func (*Dumper) Dump

func (d *Dumper) Dump(ctx context.Context, w *data.Writer)

Dump writes all of the metrics Captured from the Writer into the DB associated with the Dumper.

func (*Dumper) Run

func (d *Dumper) Run(ctx context.Context, w *data.Writer) (err error)

Run dumps periodically, until the context is canceled. When the context is canceled, it waits for any active Dump and returns.

type Options

type Options struct {
	// The database to dump into.
	DB database.DB

	// How often to dump.
	Period time.Duration

	// How big a buffer to use for records. Defaults to 1024.
	Bufsize int
}

Options controls the options to the dumper.

Jump to

Keyboard shortcuts

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