mirror of
https://github.com/DullJZ/s3-balance.git
synced 2026-09-04 23:36:40 +08:00
Add management API endpoints
This commit is contained in:
@@ -413,6 +413,25 @@ func (b *BucketInfo) IsVirtual() bool {
|
||||
return b.Config.Virtual
|
||||
}
|
||||
|
||||
// GetOperationCount 获取指定类型的操作计数
|
||||
func (b *BucketInfo) GetOperationCount(category OperationCategory) int64 {
|
||||
if b == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
b.mu.RLock()
|
||||
defer b.mu.RUnlock()
|
||||
|
||||
switch category {
|
||||
case OperationTypeA:
|
||||
return b.operationCountA
|
||||
case OperationTypeB:
|
||||
return b.operationCountB
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
// GetVirtualBuckets 获取所有虚拟存储桶
|
||||
func (m *Manager) GetVirtualBuckets() []*BucketInfo {
|
||||
m.mu.RLock()
|
||||
|
||||
Reference in New Issue
Block a user