adds qc param, address pr feedback

This commit is contained in:
Drew Bailey
2019-12-19 13:32:23 -05:00
parent 28265086fc
commit ad86438fc0
5 changed files with 16 additions and 16 deletions

View File

@@ -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

View File

@@ -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)