system

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Overview

Foliage primary statefun system package. Provides shared system functions for statefun packages

Index

Constants

This section is empty.

Variables

View Source
var (
	PrometricDifferentTypeExistsForIdError error = errors.New("metrics with a different type exists for an id")
	PrometricInstanceIsNil                 error = errors.New("prometrics instance the method is being call against to is nil")
)

Functions

func BytesToInt64

func BytesToInt64(v []byte) int64

func CreateDimSizeChannel

func CreateDimSizeChannel[T interface{}](maxBufferElements int, onBufferOverflow func()) (in chan T, out chan T)

func GetCurrentTimeNs

func GetCurrentTimeNs() int64

func GetEnv

func GetEnv[T interface{}](key string, defaultVal T) (value T, err error)

func GetEnvMustProceed

func GetEnvMustProceed[T interface{}](key string, defaultVal T) T

func GetHashStr

func GetHashStr(str string) string

func GetUniqueStrID

func GetUniqueStrID() string

func Int64ToBytes

func Int64ToBytes(v int64) []byte

func MapsIntersection added in v0.1.3

func MapsIntersection[T interface{}](m1 map[string]T, m2 map[string]T, valuesFromMap1 bool) map[string]T

func MapsUnion added in v0.1.3

func MapsUnion[T interface{}](m1 map[string]T, m2 map[string]T) map[string]T

func MsgOnErrorReturn

func MsgOnErrorReturn(retVars ...interface{})

func Str2Int

func Str2Int(s string) int64

Types

type KeyMutex added in v0.1.3

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

func NewKeyMutex added in v0.1.3

func NewKeyMutex() KeyMutex

func (KeyMutex) Lock added in v0.1.3

func (s KeyMutex) Lock(key interface{})

func (KeyMutex) Unlock added in v0.1.3

func (s KeyMutex) Unlock(key interface{})

type Prometrics added in v0.1.3

type Prometrics struct {
	// contains filtered or unexported fields
}
var (
	GlobalPrometrics *Prometrics
)

func NewPrometrics added in v0.1.3

func NewPrometrics(pattern string, addr string) *Prometrics

func (*Prometrics) EnsureGaugeVec added in v0.1.3

func (pm *Prometrics) EnsureGaugeVec(id string, metric *prometheus.GaugeVec) (*prometheus.GaugeVec, error)

func (*Prometrics) EnsureGaugeVecSimple added in v0.1.3

func (pm *Prometrics) EnsureGaugeVecSimple(id string, help string, labelNames []string) (*prometheus.GaugeVec, error)

GaugeVec ---------------------------------------------------------------------------------------

func (*Prometrics) EnsureHistogramVec added in v0.1.3

func (pm *Prometrics) EnsureHistogramVec(id string, metric *prometheus.HistogramVec) (*prometheus.HistogramVec, error)

func (*Prometrics) EnsureHistogramVecSimple added in v0.1.3

func (pm *Prometrics) EnsureHistogramVecSimple(id string, help string, buckets []float64, labelNames []string) (*prometheus.HistogramVec, error)

HistogramVec -----------------------------------------------------------------------------------

func (*Prometrics) Exists added in v0.1.3

func (pm *Prometrics) Exists(id string) bool

func (*Prometrics) GetRoutinesCounter added in v0.1.3

func (pm *Prometrics) GetRoutinesCounter() *RoutinesCounter

type RoutinesCounter added in v0.1.3

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

func (*RoutinesCounter) Read added in v0.1.3

func (rc *RoutinesCounter) Read(f func(key string, value int64) bool)

func (*RoutinesCounter) Started added in v0.1.3

func (rc *RoutinesCounter) Started(routineTypeName string)

func (*RoutinesCounter) Stopped added in v0.1.3

func (rc *RoutinesCounter) Stopped(routineTypeName string)

type RoutinesCounterValue added in v0.1.3

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

Jump to

Keyboard shortcuts

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