Skip to content

Commit

Permalink
pool: Remove old statistic method enum
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
  • Loading branch information
smallhive committed Jul 3, 2023
1 parent a19f4ac commit 3ac0b0b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 87 deletions.
80 changes: 0 additions & 80 deletions pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,86 +115,6 @@ type clientStatusMonitor struct {
overallErrorCount uint64
}

// MethodIndex index of method in list of statuses in clientStatusMonitor.
type MethodIndex int

const (
methodBalanceGet MethodIndex = iota
methodContainerPut
methodContainerGet
methodContainerList
methodContainerDelete
methodContainerEACL
methodContainerSetEACL
methodEndpointInfo
methodNetworkInfo
methodObjectPut
methodObjectDelete
methodObjectGet
methodObjectHead
methodObjectRange
methodSessionCreate
methodNetMapSnapshot
methodObjectHash
methodObjectSearch
methodContainerAnnounceUsedSpace
methodAnnounceIntermediateTrust
methodAnnounceLocalTrust
methodLast
)

// String implements fmt.Stringer.
func (m MethodIndex) String() string {
switch m {
case methodBalanceGet:
return "balanceGet"
case methodContainerPut:
return "containerPut"
case methodContainerGet:
return "containerGet"
case methodContainerList:
return "containerList"
case methodContainerDelete:
return "containerDelete"
case methodContainerEACL:
return "containerEACL"
case methodContainerSetEACL:
return "containerSetEACL"
case methodEndpointInfo:
return "endpointInfo"
case methodNetworkInfo:
return "networkInfo"
case methodObjectPut:
return "objectPut"
case methodObjectDelete:
return "objectDelete"
case methodObjectGet:
return "objectGet"
case methodObjectHead:
return "objectHead"
case methodObjectRange:
return "objectRange"
case methodSessionCreate:
return "sessionCreate"
case methodNetMapSnapshot:
return "netMapSnapshot"
case methodObjectHash:
return "objectHash"
case methodObjectSearch:
return "objectSearch"
case methodContainerAnnounceUsedSpace:
return "containerAnnounceUsedSpace"
case methodAnnounceIntermediateTrust:
return "announceIntermediateTrust"
case methodAnnounceLocalTrust:
return "announceLocalTrust"
case methodLast:
return "it's a system name rather than a method"
default:
return "unknown"
}
}

func newClientStatusMonitor(addr string, errorThreshold uint32) clientStatusMonitor {
return clientStatusMonitor{
addr: addr,
Expand Down
7 changes: 0 additions & 7 deletions pool/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,3 @@ func TestSwitchAfterErrorThreshold(t *testing.T) {
_, err = conn.objectGet(ctx, cid.ID{}, oid.ID{}, PrmObjectGet{})
require.NoError(t, err)
}

func TestStatisticMethodsNames(t *testing.T) {
for i := methodBalanceGet; i < methodLast; i++ {
require.NotEqual(t, "unknown", i.String())
require.NotEqual(t, "it's a system name rather than a method", i.String())
}
}

0 comments on commit 3ac0b0b

Please sign in to comment.