mutexmap

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MMMetricsStorage

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

MMMetricsStorage contains an in-memory implementation of Metrics storage

func NewMMMetricsStorage

func NewMMMetricsStorage() *MMMetricsStorage

NewMMMetricsStorage instantiates a new MMMetricsStorage

func (*MMMetricsStorage) IncCounter

func (m *MMMetricsStorage) IncCounter(key string)

IncCounter increments the counter for a specific key. It initializes it in 1 if it doesn't exist when this function is called.

func (*MMMetricsStorage) IncLatency

func (m *MMMetricsStorage) IncLatency(metricName string, index int)

IncLatency increments the latency for a specific key and bucket. If the key doesn't exist it's initialized to an empty array of 23 items.

func (*MMMetricsStorage) PeekCounters

func (m *MMMetricsStorage) PeekCounters() map[string]int64

PeekCounters returns Counters

func (*MMMetricsStorage) PeekLatencies

func (m *MMMetricsStorage) PeekLatencies() map[string][]int64

PeekLatencies returns Latencies

func (*MMMetricsStorage) PopCounters

func (m *MMMetricsStorage) PopCounters() []dtos.CounterDTO

PopCounters returns and deletes all the counters stored

func (*MMMetricsStorage) PopCountersWithMetadata

func (m *MMMetricsStorage) PopCountersWithMetadata() (*dtos.CounterDataBulk, error)

PopCountersWithMetadata mock

func (*MMMetricsStorage) PopGauges

func (m *MMMetricsStorage) PopGauges() []dtos.GaugeDTO

PopGauges returns and deletes all gauges currently stored

func (*MMMetricsStorage) PopGaugesWithMetadata

func (m *MMMetricsStorage) PopGaugesWithMetadata() (*dtos.GaugeDataBulk, error)

PopGaugesWithMetadata mock

func (*MMMetricsStorage) PopLatencies

func (m *MMMetricsStorage) PopLatencies() []dtos.LatenciesDTO

PopLatencies Returns and delete all the latencies currently stored

func (*MMMetricsStorage) PopLatenciesWithMetadata

func (m *MMMetricsStorage) PopLatenciesWithMetadata() (*dtos.LatencyDataBulk, error)

PopLatenciesWithMetadata mock

func (*MMMetricsStorage) PutGauge

func (m *MMMetricsStorage) PutGauge(key string, gauge float64)

PutGauge stores a new gauge value for a specific key

type MMSegmentStorage

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

MMSegmentStorage contains is an in-memory implementation of segment storage

func NewMMSegmentStorage

func NewMMSegmentStorage() *MMSegmentStorage

NewMMSegmentStorage instantiates a new MMSegmentStorage

func (*MMSegmentStorage) ChangeNumber

func (m *MMSegmentStorage) ChangeNumber(segmentName string) (int64, error)

ChangeNumber returns the latest timestamp the segment was fetched

func (*MMSegmentStorage) CountRemovedKeys

func (m *MMSegmentStorage) CountRemovedKeys(segmentName string) int64

CountRemovedKeys method

func (*MMSegmentStorage) Keys

func (m *MMSegmentStorage) Keys(segmentName string) *set.ThreadUnsafeSet

Keys retrieves a segment from the in-memory storage NOTE: A pointer TO A COPY is returned, in order to avoid race conditions between evaluations and sdk <-> backend sync

func (*MMSegmentStorage) SegmentContainsKey

func (m *MMSegmentStorage) SegmentContainsKey(segmentName string, key string) (bool, error)

SegmentContainsKey returns true if the segment contains a specific key

func (*MMSegmentStorage) SetChangeNumber

func (m *MMSegmentStorage) SetChangeNumber(name string, till int64) error

SetChangeNumber sets the till value belong to segmentName

func (*MMSegmentStorage) Update

func (m *MMSegmentStorage) Update(name string, toAdd *set.ThreadUnsafeSet, toRemove *set.ThreadUnsafeSet, till int64) error

Update adds a new segment to the in-memory storage

type MMSplitStorage

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

MMSplitStorage struct contains is an in-memory implementation of split storage

func NewMMSplitStorage

func NewMMSplitStorage() *MMSplitStorage

NewMMSplitStorage instantiates a new MMSplitStorage

func (*MMSplitStorage) All

func (m *MMSplitStorage) All() []dtos.SplitDTO

All returns a list with a copy of each split. NOTE: This method will block any further operations regarding splits. Use with caution

func (*MMSplitStorage) ChangeNumber

func (m *MMSplitStorage) ChangeNumber() (int64, error)

ChangeNumber returns the last timestamp the split was fetched

func (*MMSplitStorage) FetchMany

func (m *MMSplitStorage) FetchMany(splitNames []string) map[string]*dtos.SplitDTO

FetchMany fetches features in redis and returns an array of split dtos

func (*MMSplitStorage) KillLocally

func (m *MMSplitStorage) KillLocally(splitName string, defaultTreatment string, changeNumber int64)

KillLocally kills the split locally

func (*MMSplitStorage) PutMany

func (m *MMSplitStorage) PutMany(splits []dtos.SplitDTO, till int64)

PutMany bulk inserts splits into the in-memory storage

func (*MMSplitStorage) Remove

func (m *MMSplitStorage) Remove(splitName string)

Remove deletes a split from the in-memory storage

func (*MMSplitStorage) SegmentNames

func (m *MMSplitStorage) SegmentNames() *set.ThreadUnsafeSet

SegmentNames returns a slice with the names of all segments referenced in splits

func (*MMSplitStorage) SetChangeNumber

func (m *MMSplitStorage) SetChangeNumber(till int64) error

SetChangeNumber sets the till value belong to split

func (*MMSplitStorage) Split

func (m *MMSplitStorage) Split(splitName string) *dtos.SplitDTO

Split retrieves a split from the MMSplitStorage NOTE: A pointer TO A COPY is returned, in order to avoid race conditions between evaluations and sdk <-> backend sync

func (*MMSplitStorage) SplitNames

func (m *MMSplitStorage) SplitNames() []string

SplitNames returns a slice with the names of all the current splits

func (*MMSplitStorage) TrafficTypeExists

func (m *MMSplitStorage) TrafficTypeExists(trafficType string) bool

TrafficTypeExists returns true or false depending on existence and counter of trafficType

Jump to

Keyboard shortcuts

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