[#1080] metabase: Add StorageID metric
DCO action / DCO (pull_request) Successful in 3m19s
Details
Vulncheck / Vulncheck (pull_request) Successful in 3m31s
Details
Tests and linters / Staticcheck (pull_request) Failing after 4m1s
Details
Build / Build Components (1.20) (pull_request) Successful in 4m45s
Details
Build / Build Components (1.21) (pull_request) Successful in 4m44s
Details
Tests and linters / gopls check (pull_request) Failing after 4m48s
Details
Tests and linters / Lint (pull_request) Successful in 6m3s
Details
Tests and linters / Tests (1.20) (pull_request) Failing after 7m29s
Details
Tests and linters / Tests (1.21) (pull_request) Failing after 7m28s
Details
Tests and linters / Tests with -race (pull_request) Failing after 7m24s
Details
DCO action / DCO (pull_request) Successful in 3m19s
Details
Vulncheck / Vulncheck (pull_request) Successful in 3m31s
Details
Tests and linters / Staticcheck (pull_request) Failing after 4m1s
Details
Build / Build Components (1.20) (pull_request) Successful in 4m45s
Details
Build / Build Components (1.21) (pull_request) Successful in 4m44s
Details
Tests and linters / gopls check (pull_request) Failing after 4m48s
Details
Tests and linters / Lint (pull_request) Successful in 6m3s
Details
Tests and linters / Tests (1.20) (pull_request) Failing after 7m29s
Details
Tests and linters / Tests (1.21) (pull_request) Failing after 7m28s
Details
Tests and linters / Tests with -race (pull_request) Failing after 7m24s
Details
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
parent
bdccf12724
commit
4cae9a782a
|
@ -36,6 +36,14 @@ func (r StorageIDRes) StorageID() []byte {
|
|||
// StorageID returns storage descriptor for objects from the blobstor.
|
||||
// It is put together with the object can makes get/delete operation faster.
|
||||
func (db *DB) StorageID(ctx context.Context, prm StorageIDPrm) (res StorageIDRes, err error) {
|
||||
var (
|
||||
startedAt = time.Now()
|
||||
success = false
|
||||
)
|
||||
defer func() {
|
||||
db.metrics.AddMethodDuration("StorageID", time.Since(startedAt), success)
|
||||
}()
|
||||
|
||||
_, span := tracing.StartSpanFromContext(ctx, "metabase.StorageID",
|
||||
trace.WithAttributes(
|
||||
attribute.String("address", prm.addr.EncodeToString()),
|
||||
|
@ -54,7 +62,7 @@ func (db *DB) StorageID(ctx context.Context, prm StorageIDPrm) (res StorageIDRes
|
|||
|
||||
return err
|
||||
})
|
||||
|
||||
success = err == nil
|
||||
return res, metaerr.Wrap(err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue