generator

package
v0.0.0-...-d076e8d Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package generator provides a periodic request generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

Generator keeps a cron to make requests periodically.

func New

func New(
	metrics []string,
	consumer func(string),
	rpm uint,
) (*Generator, error)

New returns a request generator to collect metrics periodically. consumer will be called with each metrics, thereby consumer have need to get string as parameter. rpm means Requests Per Minute referred by consumer. It should be bigger than zero.

func (*Generator) Start

func (g *Generator) Start()

Start the generator

func (*Generator) Stop

func (g *Generator) Stop()

Stop the generator

Jump to

Keyboard shortcuts

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