counter

package
v0.0.0-...-b25ce53 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: AGPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Workers int
}

Config contains the configuration for a Counter

type Counter

type Counter struct {
	Config
}

Counter counts the number of messages sents

func (*Counter) OnMessage

func (c *Counter) OnMessage(m *utils.Message, done utils.Done)

OnMessage is called when a new message is receive. Counts the number of bytes on the message (or messages if a batch is received) and send a JSON formatted message to the next component.

func (*Counter) Spawn

func (c *Counter) Spawn(id int) utils.Composer

Spawn creates a new instance of a Counter worker

func (*Counter) Workers

func (c *Counter) Workers() int

Workers returns the number of workers

type Monitor

type Monitor struct {
	Monitor   string `json:"monitor"`
	Unit      string `json:"unit"`
	Value     uint64 `json:"value"`
	UUID      string `json:"organization_uuid"`
	Timestamp int64  `json:"timestamp"`
}

Monitor contains the data for generate a JSON with the count of bytes/messages

Jump to

Keyboard shortcuts

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