Skip to content

Commit

Permalink
add perf calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Omarabdul3ziz committed Oct 29, 2023
1 parent 51fbe3a commit 1cc3d4b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions grid-client/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,34 @@ func (n *NodeClient) SystemVersion(ctx context.Context) (ver Version, err error)
return
}

// GetPerfTestsResults get all perf tests results
func (n *NodeClient) GetPerfTestsResults(ctx context.Context) (result string, err error) {
ctx, cancel := context.WithTimeout(ctx, n.timeout)
defer cancel()

const cmd = "zos.perf.get_all"

if err = n.bus.Call(ctx, n.nodeTwin, cmd, nil, &result); err != nil {
return
}

return
}

// GetPerfTestResult get a single perf test result
func (n *NodeClient) GetPerfTestResult(ctx context.Context, testName string) (result string, err error) {
ctx, cancel := context.WithTimeout(ctx, n.timeout)
defer cancel()

const cmd = "zos.perf.get"

if err = n.bus.Call(ctx, n.nodeTwin, cmd, testName, &result); err != nil {
return
}

return
}

// IsNodeUp checks if the node is up
func (n *NodeClient) IsNodeUp(ctx context.Context) error {
_, err := n.SystemVersion(ctx)
Expand Down

0 comments on commit 1cc3d4b

Please # to comment.