stat

package
v1.0.0-rc.11 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownNode = errors.New("unknown node")

ErrUnknownNode indicate that node with current address is not found in list.

Functions

func IsMethodValid

func IsMethodValid(m Method) bool

IsMethodValid check range of passed Method variable.

Types

type Method

type Method int

Method is an enumerator to describe [client.Client] methods.

const (
	MethodBalanceGet Method = iota
	MethodContainerPut
	MethodContainerGet
	MethodContainerList
	MethodContainerDelete
	MethodContainerEACL
	MethodContainerSetEACL
	MethodEndpointInfo
	MethodNetworkInfo
	MethodObjectPut
	MethodObjectDelete
	MethodObjectGet
	MethodObjectHead
	MethodObjectRange
	MethodSessionCreate
	MethodNetMapSnapshot
	MethodObjectHash
	MethodObjectSearch
	MethodContainerAnnounceUsedSpace
	MethodAnnounceIntermediateTrust
	MethodAnnounceLocalTrust
	MethodObjectGetStream
	MethodObjectRangeStream
	MethodObjectSearchStream
	MethodObjectPutStream
	// MethodLast is no a valid method name, it's a system anchor for tests, etc.
	MethodLast
)

Various client methods.

func (Method) String

func (m Method) String() string

String implements fmt.Stringer.

type NodeStatistic

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

NodeStatistic is metrics of certain connections.

func (NodeStatistic) Address

func (n NodeStatistic) Address() string

Address returns node endpoint address.

func (NodeStatistic) AverageCreateSession

func (n NodeStatistic) AverageCreateSession() time.Duration

AverageCreateSession returns average time to perform SessionCreate request.

func (NodeStatistic) AverageDeleteContainer

func (n NodeStatistic) AverageDeleteContainer() time.Duration

AverageDeleteContainer returns average time to perform ContainerDelete request.

func (NodeStatistic) AverageDeleteObject

func (n NodeStatistic) AverageDeleteObject() time.Duration

AverageDeleteObject returns average time to perform ObjectDelete request.

func (NodeStatistic) AverageEndpointInfo

func (n NodeStatistic) AverageEndpointInfo() time.Duration

AverageEndpointInfo returns average time to perform EndpointInfo request.

func (NodeStatistic) AverageGetBalance

func (n NodeStatistic) AverageGetBalance() time.Duration

AverageGetBalance returns average time to perform BalanceGet request.

func (NodeStatistic) AverageGetContainer

func (n NodeStatistic) AverageGetContainer() time.Duration

AverageGetContainer returns average time to perform ContainerGet request.

func (NodeStatistic) AverageGetContainerEACL

func (n NodeStatistic) AverageGetContainerEACL() time.Duration

AverageGetContainerEACL returns average time to perform ContainerEACL request.

func (NodeStatistic) AverageGetObject

func (n NodeStatistic) AverageGetObject() time.Duration

AverageGetObject returns average time to perform ObjectGet request.

func (NodeStatistic) AverageHeadObject

func (n NodeStatistic) AverageHeadObject() time.Duration

AverageHeadObject returns average time to perform ObjectHead request.

func (NodeStatistic) AverageListContainer

func (n NodeStatistic) AverageListContainer() time.Duration

AverageListContainer returns average time to perform ContainerList request.

func (NodeStatistic) AverageNetworkInfo

func (n NodeStatistic) AverageNetworkInfo() time.Duration

AverageNetworkInfo returns average time to perform NetworkInfo request.

func (NodeStatistic) AveragePutContainer

func (n NodeStatistic) AveragePutContainer() time.Duration

AveragePutContainer returns average time to perform ContainerPut request.

func (NodeStatistic) AveragePutObject

func (n NodeStatistic) AveragePutObject() time.Duration

AveragePutObject returns average time to perform ObjectPut request.

func (NodeStatistic) AverageRangeObject

func (n NodeStatistic) AverageRangeObject() time.Duration

AverageRangeObject returns average time to perform ObjectRange request.

func (NodeStatistic) AverageSetContainerEACL

func (n NodeStatistic) AverageSetContainerEACL() time.Duration

AverageSetContainerEACL returns average time to perform ContainerSetEACL request.

func (NodeStatistic) OverallErrors

func (n NodeStatistic) OverallErrors() uint64

OverallErrors returns all errors on current node. This value never decreases.

func (NodeStatistic) Requests

func (n NodeStatistic) Requests() (requests uint64)

Requests returns number of requests.

func (NodeStatistic) Snapshot

func (n NodeStatistic) Snapshot(method Method) (Snapshot, error)

Snapshot returns snapshot statistic for method.

type OperationCallback

type OperationCallback = func(nodeKey []byte, endpoint string, method Method, duration time.Duration, err error)

OperationCallback describes common interface to external statistic collection.

Passing zero duration means only error counting.

type PoolStat

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

PoolStat is an external statistic for pool connections.

func NewPoolStatistic

func NewPoolStatistic() *PoolStat

NewPoolStatistic is a constructor for PoolStat.

func (*PoolStat) OperationCallback

func (s *PoolStat) OperationCallback(nodeKey []byte, endpoint string, method Method, duration time.Duration, err error)

OperationCallback implements stat.OperationCallback.

func (*PoolStat) Statistic

func (s *PoolStat) Statistic() Statistic

Statistic returns connection statistics.

type Snapshot

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

Snapshot represents statistic for specific method.

func (Snapshot) AllRequests

func (s Snapshot) AllRequests() uint64

AllRequests returns amount of requests to node.

func (Snapshot) AllTime

func (s Snapshot) AllTime() uint64

AllTime returns sum of time, spent to specific request. Use with time.Duration to get human-readable value.

type Statistic

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

Statistic is metrics of the pool.

func (Statistic) Node

func (s Statistic) Node(address string) (*NodeStatistic, error)

Node returns NodeStatistic by node address. If such node doesn't exist ErrUnknownNode error is returned.

func (Statistic) Nodes

func (s Statistic) Nodes() []NodeStatistic

Nodes returns list of nodes statistic.

The value returned shares memory with the structure itself, so changing it can lead to data corruption. Make a copy if you need to change it.

func (Statistic) OverallErrors

func (s Statistic) OverallErrors() uint64

OverallErrors returns sum of errors on all connections. It doesn't decrease.

Jump to

Keyboard shortcuts

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