forked from TrueCloudLab/frostfs-node
[#1410] engine: Provide the default implementation to MetricsRegister
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
9206ce5cd2
commit
9a87acb87a
11 changed files with 77 additions and 55 deletions
|
@ -68,9 +68,7 @@ func ContainerSize(e *StorageEngine, id cid.ID) (uint64, error) {
|
|||
}
|
||||
|
||||
func (e *StorageEngine) containerSize(prm ContainerSizePrm) (res ContainerSizeRes, err error) {
|
||||
if e.metrics != nil {
|
||||
defer elapsed("EstimateContainerSize", e.metrics.AddMethodDuration)()
|
||||
}
|
||||
defer elapsed("EstimateContainerSize", e.metrics.AddMethodDuration)()
|
||||
|
||||
e.iterateOverUnsortedShards(func(sh hashedShard) (stop bool) {
|
||||
var csPrm shard.ContainerSizePrm
|
||||
|
@ -116,9 +114,7 @@ func ListContainers(ctx context.Context, e *StorageEngine) ([]cid.ID, error) {
|
|||
}
|
||||
|
||||
func (e *StorageEngine) listContainers(ctx context.Context) (ListContainersRes, error) {
|
||||
if e.metrics != nil {
|
||||
defer elapsed("ListContainers", e.metrics.AddMethodDuration)()
|
||||
}
|
||||
defer elapsed("ListContainers", e.metrics.AddMethodDuration)()
|
||||
|
||||
uniqueIDs := make(map[string]cid.ID)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue