pipeline

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyPrint added in v0.1.1

func PrettyPrint(v interface{}) (string, error)

PrettyPrint marshals the provided value into a pretty-printed JSON string.

Types

type DataPipeline

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

DataPipeline defines the structure for a data processing pipeline

func NewDataPipeline

func NewDataPipeline(reader interfaces.Reader, writer interfaces.Writer) *DataPipeline

NewDataPipeline creates a new DataPipeline instance

func (*DataPipeline) Done added in v0.1.1

func (dp *DataPipeline) Done() <-chan error

Done returns a channel that the pipeline can be waited on

func (*DataPipeline) Metrics added in v0.1.1

func (dp *DataPipeline) Metrics() *Metrics

Metrics returns the pipeline metrics

func (*DataPipeline) Start

func (dp *DataPipeline) Start(ctx context.Context) (string, error)

Start begins the pipeline processing and returns the metrics report

type Metrics

type Metrics struct {
	RecordsProcessed int64
	TotalBytes       int64
	StartTime        time.Time
	EndTime          time.Time
	TotalDuration    int64 // nanoseconds
	Throughput       int64 // records per second * 100 (for two decimal places)
	ThroughputBytes  int64 // bytes per second
	// contains filtered or unexported fields
}

Metrics stores pipeline processing metrics

func (*Metrics) Report

func (m *Metrics) Report() string

Report generates a summary of the collected metrics

func (*Metrics) UpdateMetrics added in v0.1.1

func (m *Metrics) UpdateMetrics()

UpdateMetrics calculates the total duration, throughput, and throughput in bytes.

Jump to

Keyboard shortcuts

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