forked from TrueCloudLab/frostfs-sdk-go
[#291] pool: Use more robust way to init methods
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
828cfdc5bf
commit
90255e9efa
1 changed files with 5 additions and 2 deletions
|
@ -135,6 +135,7 @@ const (
|
||||||
methodObjectHead
|
methodObjectHead
|
||||||
methodObjectRange
|
methodObjectRange
|
||||||
methodSessionCreate
|
methodSessionCreate
|
||||||
|
methodLast
|
||||||
)
|
)
|
||||||
|
|
||||||
// String implements fmt.Stringer.
|
// String implements fmt.Stringer.
|
||||||
|
@ -170,14 +171,16 @@ func (m MethodIndex) String() string {
|
||||||
return "objectRange"
|
return "objectRange"
|
||||||
case methodSessionCreate:
|
case methodSessionCreate:
|
||||||
return "sessionCreate"
|
return "sessionCreate"
|
||||||
|
case methodLast:
|
||||||
|
return "it's a system name rather than a method"
|
||||||
default:
|
default:
|
||||||
return "unknown"
|
return "unknown"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func newClientStatusMonitor(addr string, errorThreshold uint32) clientStatusMonitor {
|
func newClientStatusMonitor(addr string, errorThreshold uint32) clientStatusMonitor {
|
||||||
methods := make([]*methodStatus, methodSessionCreate+1)
|
methods := make([]*methodStatus, methodLast)
|
||||||
for i := methodBalanceGet; i <= methodSessionCreate; i++ {
|
for i := methodBalanceGet; i < methodLast; i++ {
|
||||||
methods[i] = &methodStatus{name: i.String()}
|
methods[i] = &methodStatus{name: i.String()}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue