Documentation ¶
Index ¶
- Variables
- func IsMethodValid(m Method) bool
- type Method
- type NodeStatistic
- func (n NodeStatistic) Address() string
- func (n NodeStatistic) AverageCreateSession() time.Duration
- func (n NodeStatistic) AverageDeleteContainer() time.Duration
- func (n NodeStatistic) AverageDeleteObject() time.Duration
- func (n NodeStatistic) AverageEndpointInfo() time.Duration
- func (n NodeStatistic) AverageGetBalance() time.Duration
- func (n NodeStatistic) AverageGetContainer() time.Duration
- func (n NodeStatistic) AverageGetContainerEACL() time.Duration
- func (n NodeStatistic) AverageGetObject() time.Duration
- func (n NodeStatistic) AverageHeadObject() time.Duration
- func (n NodeStatistic) AverageListContainer() time.Duration
- func (n NodeStatistic) AverageNetworkInfo() time.Duration
- func (n NodeStatistic) AveragePutContainer() time.Duration
- func (n NodeStatistic) AveragePutObject() time.Duration
- func (n NodeStatistic) AverageRangeObject() time.Duration
- func (n NodeStatistic) AverageSetContainerEACL() time.Duration
- func (n NodeStatistic) OverallErrors() uint64
- func (n NodeStatistic) Requests() (requests uint64)
- func (n NodeStatistic) Snapshot(method Method) (Snapshot, error)
- type OperationCallback
- type PoolStat
- type Snapshot
- type Statistic
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownNode = errors.New("unknown node")
ErrUnknownNode indicate that node with current address is not found in list.
Functions ¶
func IsMethodValid ¶
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.
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.
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.
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot represents statistic for specific method.
func (Snapshot) AllRequests ¶
AllRequests returns amount of requests to node.
func (Snapshot) AllTime ¶
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 ¶
OverallErrors returns sum of errors on all connections. It doesn't decrease.