forked from TrueCloudLab/frostfs-node
[#1484] engine: Fix engine metrics
1. Add forgotten metrics for client requests 2. Include execIfNotBlocked into metrics Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
ad01fb958a
commit
8a57c78f5f
9 changed files with 25 additions and 26 deletions
|
@ -65,6 +65,15 @@ func (r RngRes) Object() *objectSDK.Object {
|
|||
//
|
||||
// Returns an error if executions are blocked (see BlockExecution).
|
||||
func (e *StorageEngine) GetRange(ctx context.Context, prm RngPrm) (res RngRes, err error) {
|
||||
ctx, span := tracing.StartSpanFromContext(ctx, "StorageEngine.getRange",
|
||||
trace.WithAttributes(
|
||||
attribute.String("address", prm.addr.EncodeToString()),
|
||||
attribute.String("offset", strconv.FormatUint(prm.off, 10)),
|
||||
attribute.String("length", strconv.FormatUint(prm.ln, 10)),
|
||||
))
|
||||
defer span.End()
|
||||
defer elapsed("GetRange", e.metrics.AddMethodDuration)()
|
||||
|
||||
err = e.execIfNotBlocked(func() error {
|
||||
res, err = e.getRange(ctx, prm)
|
||||
return err
|
||||
|
@ -74,16 +83,6 @@ func (e *StorageEngine) GetRange(ctx context.Context, prm RngPrm) (res RngRes, e
|
|||
}
|
||||
|
||||
func (e *StorageEngine) getRange(ctx context.Context, prm RngPrm) (RngRes, error) {
|
||||
ctx, span := tracing.StartSpanFromContext(ctx, "StorageEngine.getRange",
|
||||
trace.WithAttributes(
|
||||
attribute.String("address", prm.addr.EncodeToString()),
|
||||
attribute.String("offset", strconv.FormatUint(prm.off, 10)),
|
||||
attribute.String("length", strconv.FormatUint(prm.ln, 10)),
|
||||
))
|
||||
defer span.End()
|
||||
|
||||
defer elapsed("GetRange", e.metrics.AddMethodDuration)()
|
||||
|
||||
var shPrm shard.RngPrm
|
||||
shPrm.SetAddress(prm.addr)
|
||||
shPrm.SetRange(prm.off, prm.ln)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue