From 59ef1c63ff6827765bd891212e398881cfb982fb Mon Sep 17 00:00:00 2001 From: Evgenii Baidakov Date: Fri, 30 Jun 2023 16:25:37 +0400 Subject: [PATCH] pool: Remove old statistic method enum Signed-off-by: Evgenii Baidakov --- pool/pool.go | 80 ----------------------------------------------- pool/pool_test.go | 7 ----- 2 files changed, 87 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index ebc9fd89..ca6c3f25 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -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, diff --git a/pool/pool_test.go b/pool/pool_test.go index d9ca4a73..09892b93 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -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()) - } -}