forked from TrueCloudLab/frostfs-node
[#1653] objectSvc: Add operations by IO tag metric
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
3727d60331
commit
4ed2bbdb0f
3 changed files with 40 additions and 15 deletions
|
@ -1,6 +1,11 @@
|
|||
package qos
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-qos/tagging"
|
||||
)
|
||||
|
||||
type IOTag string
|
||||
|
||||
|
@ -37,3 +42,11 @@ func FromRawString(s string) (IOTag, error) {
|
|||
func (t IOTag) String() string {
|
||||
return string(t)
|
||||
}
|
||||
|
||||
func IOTagFromContext(ctx context.Context) string {
|
||||
tag, ok := tagging.IOTagFromContext(ctx)
|
||||
if !ok {
|
||||
tag = "undefined"
|
||||
}
|
||||
return tag
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue