[#424] morphcache: Use labels for method duration

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-06-13 16:15:59 +03:00
parent 85deb12f4d
commit c8023a9c8d
3 changed files with 16 additions and 48 deletions

View file

@ -86,7 +86,7 @@ func (c *Client) NNSHash() (util.Uint160, error) {
startedAt := time.Now()
defer func() {
c.cache.metrics.AddNNSContractHashDuration(success, time.Since(startedAt))
c.cache.metrics.AddMethodDuration("NNSContractHash", success, time.Since(startedAt))
}()
nnsHash := c.cache.nns()
@ -233,7 +233,7 @@ func (c *Client) contractGroupKey() (*keys.PublicKey, error) {
success := false
startedAt := time.Now()
defer func() {
c.cache.metrics.AddGroupKeyDuration(success, time.Since(startedAt))
c.cache.metrics.AddMethodDuration("GroupKey", success, time.Since(startedAt))
}()
if gKey := c.cache.groupKey(); gKey != nil {