utils

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchId added in v0.5.1

func BatchId(ctx context.Context, watermark int64) string

func BatchIdFromWorkerId added in v0.5.1

func BatchIdFromWorkerId(workerId string, watermark int64) string

func BytesToUint64

func BytesToUint64(bytes []byte) uint64

func MarshalToReader

func MarshalToReader(s any) (io.Reader, error)

MarshalToReader transforms a struct to io.Reader.

func MetricsHandler

func MetricsHandler() http.Handler

func NewRecordId added in v0.5.1

func NewRecordId() fmt.Stringer

func NewWorkerContext

func NewWorkerContext(processorCtx context.Context, workerIndex int, processorName string,
	topicName string) context.Context

func NewWorkerId

func NewWorkerId(workerIndex int, processorName string, topicName string) string

func SafeJsonIndent

func SafeJsonIndent(s any) string

func Uint64ToBytes

func Uint64ToBytes(num uint64) []byte

func WorkerId

func WorkerId(ctx context.Context) (string, bool)

func WorkerIndex

func WorkerIndex(ctx context.Context) (string, bool)

Types

type MetricsClient

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

func NewMetricsClient

func NewMetricsClient(processorName string) *MetricsClient

func (*MetricsClient) EmitCounter

func (m *MetricsClient) EmitCounter(name string, help string, val float64) error

func (*MetricsClient) EmitHistogram added in v0.5.21

func (m *MetricsClient) EmitHistogram(name string, help string, val float64) error

Jump to

Keyboard shortcuts

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