forked from TrueCloudLab/frostfs-node
[#1613] morph: Add tracing for morph queries to neo-go
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
parent
4de5fca547
commit
9b113c3156
120 changed files with 623 additions and 562 deletions
|
@ -1,6 +1,7 @@
|
|||
package netmap
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
netmapcontract "git.frostfs.info/TrueCloudLab/frostfs-contract/netmap"
|
||||
|
@ -11,12 +12,12 @@ import (
|
|||
|
||||
// GetNetMapByEpoch calls "snapshotByEpoch" method with the given epoch and
|
||||
// decodes netmap.NetMap from the response.
|
||||
func (c *Client) GetNetMapByEpoch(epoch uint64) (*netmap.NetMap, error) {
|
||||
func (c *Client) GetNetMapByEpoch(ctx context.Context, epoch uint64) (*netmap.NetMap, error) {
|
||||
invokePrm := client.TestInvokePrm{}
|
||||
invokePrm.SetMethod(epochSnapshotMethod)
|
||||
invokePrm.SetArgs(epoch)
|
||||
|
||||
res, err := c.client.TestInvoke(invokePrm)
|
||||
res, err := c.client.TestInvoke(ctx, invokePrm)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("test invoke (%s): %w",
|
||||
epochSnapshotMethod, err)
|
||||
|
@ -34,11 +35,11 @@ func (c *Client) GetNetMapByEpoch(epoch uint64) (*netmap.NetMap, error) {
|
|||
|
||||
// GetCandidates calls "netmapCandidates" method and decodes []netmap.NodeInfo
|
||||
// from the response.
|
||||
func (c *Client) GetCandidates() ([]netmap.NodeInfo, error) {
|
||||
func (c *Client) GetCandidates(ctx context.Context) ([]netmap.NodeInfo, error) {
|
||||
invokePrm := client.TestInvokePrm{}
|
||||
invokePrm.SetMethod(netMapCandidatesMethod)
|
||||
|
||||
res, err := c.client.TestInvoke(invokePrm)
|
||||
res, err := c.client.TestInvoke(ctx, invokePrm)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("test invoke (%s): %w", netMapCandidatesMethod, err)
|
||||
}
|
||||
|
@ -51,11 +52,11 @@ func (c *Client) GetCandidates() ([]netmap.NodeInfo, error) {
|
|||
}
|
||||
|
||||
// NetMap calls "netmap" method and decode netmap.NetMap from the response.
|
||||
func (c *Client) NetMap() (*netmap.NetMap, error) {
|
||||
func (c *Client) NetMap(ctx context.Context) (*netmap.NetMap, error) {
|
||||
invokePrm := client.TestInvokePrm{}
|
||||
invokePrm.SetMethod(netMapMethod)
|
||||
|
||||
res, err := c.client.TestInvoke(invokePrm)
|
||||
res, err := c.client.TestInvoke(ctx, invokePrm)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("test invoke (%s): %w",
|
||||
netMapMethod, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue