publisher

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPExporter

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

HTTPExporter exports metrics by making an HTTP request.

func NewHTTPExporter

func NewHTTPExporter(endpoint, apiKey string) (*HTTPExporter, error)

NewHTTPExporter creates an HTTPExporter.

func (*HTTPExporter) Export

func (e *HTTPExporter) Export(ctx context.Context, metrics []telemetry.Metric, nodeID string) error

Export exports metrics by HTTP.

type MetricsExporter

type MetricsExporter interface {
	Export(context.Context, []telemetry.Metric, string) error
}

MetricsExporter defines the API for exporting metrics.

type MetricsStore

type MetricsStore interface {
	FetchMetrics(context.Context, bool, int) ([]telemetry.Metric, error)
	MarkAsPublished(context.Context, []int64) error
	DeletePublishedOlderThan(context.Context, time.Duration) error
}

MetricsStore defines the API for fetching metrics and marking them as published.

type Publisher

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

Publisher is responsible for fetching unpublished metrics and exporting them.

func NewPublisher

func NewPublisher(s MetricsStore, e MetricsExporter, nodeID string, interval time.Duration) *Publisher

NewPublisher creates a new publisher.

func (*Publisher) Close

func (p *Publisher) Close()

Close closes the published goroutine.

func (*Publisher) Start

func (p *Publisher) Start()

Start starts the publisher.

Jump to

Keyboard shortcuts

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