stats

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStringValueFromMetadata

func GetStringValueFromMetadata(meta map[string]interface{}, key string) (string, error)

Types

type Key

type Key struct {
	NodeID       string
	ResourceType string
	Version      string
	PodID        string
	Key          string
}

func NewKey

func NewKey(nodeID, rType, version, podID, key string) *Key

func NewKeyFromString

func NewKeyFromString(key string) *Key

func (*Key) String

func (k *Key) String() string

type Stats

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

The format of the keys in the cache is

<node-id>:<version>:<resource-type>:<pod-id>:<key>

Note that though currently revision and version have the same value for all types (with the exeption of secrets), this might change in the future and have each resource type follow its own versioning

func New

func New() *Stats

func NewWithItems

func NewWithItems(items map[string]kv.Item) *Stats

func (*Stats) DecrementCounter

func (s *Stats) DecrementCounter(nodeID, rType, version, podID, key string, decrement int64)

func (*Stats) DeleteKeysByFilter

func (s *Stats) DeleteKeysByFilter(filters ...string)

func (*Stats) FilterKeys

func (s *Stats) FilterKeys(filters ...string) map[string]kv.Item

func (*Stats) GetCounter

func (s *Stats) GetCounter(nodeID, rtype, version, podID, key string) (int64, error)

func (*Stats) GetPercentageFailing

func (s *Stats) GetPercentageFailing(nodeID, rType, version string) float64

func (*Stats) GetString

func (s *Stats) GetString(nodeID, rtype, version, podID, key string) (string, error)

func (*Stats) GetSubscribedPods

func (s *Stats) GetSubscribedPods(nodeID, rType string) []string

func (*Stats) IncrementCounter

func (s *Stats) IncrementCounter(nodeID, rType, version, podID, key string, increment int64)

func (*Stats) ReportACK

func (s *Stats) ReportACK(nodeID, rType, version, podID string)

func (*Stats) ReportNACK

func (s *Stats) ReportNACK(nodeID, rType, podID, nonce string) (int64, error)

func (*Stats) ReportRequest

func (s *Stats) ReportRequest(nodeID, rType, podID string, streamID int64)

func (*Stats) ReportStreamClosed

func (s *Stats) ReportStreamClosed(streamID int64)

func (*Stats) SetString

func (s *Stats) SetString(nodeID, rType, version, podID, key, value string)

func (*Stats) SetStringWithExpiration

func (s *Stats) SetStringWithExpiration(nodeID, rType, version, podID, key, value string, expiration time.Duration)

func (*Stats) WriteResponseNonce

func (s *Stats) WriteResponseNonce(nodeID, rType, version, podID, nonce string)

Jump to

Keyboard shortcuts

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