forked from TrueCloudLab/frostfs-node
[#312] metrics: Add writecache metrcis
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
d212d908b5
commit
2ce43935f9
14 changed files with 415 additions and 32 deletions
|
@ -24,7 +24,7 @@ func (c *cache) Delete(ctx context.Context, addr oid.Address) error {
|
|||
defer span.End()
|
||||
|
||||
deleted := false
|
||||
storageType := storageTypeUndefined
|
||||
storageType := StorageTypeUndefined
|
||||
startedAt := time.Now()
|
||||
defer func() {
|
||||
c.metrics.Delete(time.Since(startedAt), deleted, storageType)
|
||||
|
@ -46,7 +46,7 @@ func (c *cache) Delete(ctx context.Context, addr oid.Address) error {
|
|||
})
|
||||
|
||||
if dataSize > 0 {
|
||||
storageType = storageTypeDB
|
||||
storageType = StorageTypeDB
|
||||
err := c.db.Update(func(tx *bbolt.Tx) error {
|
||||
b := tx.Bucket(defaultBucket)
|
||||
err := b.Delete([]byte(saddr))
|
||||
|
@ -65,7 +65,7 @@ func (c *cache) Delete(ctx context.Context, addr oid.Address) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
storageType = storageTypeFSTree
|
||||
storageType = StorageTypeFSTree
|
||||
_, err := c.fsTree.Delete(ctx, common.DeletePrm{Address: addr})
|
||||
if err == nil {
|
||||
storagelog.Write(c.log,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue