mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
adds qc param, address pr feedback
This commit is contained in:
@@ -376,7 +376,7 @@ func (a *Agent) Trace(serverID, nodeID string, seconds int, q *QueryOptions) ([]
|
||||
//
|
||||
// The call blocks until the profile finishes, and returns the raw bytes of the
|
||||
// profile.
|
||||
func (a *Agent) Profile(serverID, nodeID, profile string, debug int, q *QueryOptions) ([]byte, error) {
|
||||
func (a *Agent) Profile(serverID, nodeID, profile string, debug, gc int, q *QueryOptions) ([]byte, error) {
|
||||
if q == nil {
|
||||
q = &QueryOptions{}
|
||||
}
|
||||
@@ -385,6 +385,7 @@ func (a *Agent) Profile(serverID, nodeID, profile string, debug int, q *QueryOpt
|
||||
}
|
||||
|
||||
q.Params["debug"] = strconv.Itoa(debug)
|
||||
q.Params["qc"] = strconv.Itoa(debug)
|
||||
q.Params["node_id"] = nodeID
|
||||
q.Params["server_id"] = serverID
|
||||
|
||||
|
||||
@@ -436,14 +436,14 @@ func TestAgentProfile(t *testing.T) {
|
||||
}
|
||||
|
||||
{
|
||||
resp, err := agent.Profile("", "", "goroutine", 0, q)
|
||||
resp, err := agent.Profile("", "", "heap", 0, 1, q)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, resp)
|
||||
}
|
||||
|
||||
// unknown profile
|
||||
{
|
||||
resp, err := agent.Profile("", "", "invalid", 1, q)
|
||||
resp, err := agent.Profile("", "", "invalid", 1, 1, q)
|
||||
require.Error(t, err)
|
||||
require.Contains(t, err.Error(), "Unexpected response code: 404")
|
||||
require.Nil(t, resp)
|
||||
|
||||
Reference in New Issue
Block a user