-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added method for getQPS to zone, #9
base: master
Are you sure you want to change the base?
Conversation
… response (qps does not have this property)
added missing setRData
any reason this wouldn't be accepted? I'd love to rebase our code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Bill,
Apologies for the delay, this one slipped under the radar. I've added some feedback, if you wouldn't mind making some tweaks. A couple of the bug fixes in here have subsequently been fixed on master, so it might be worth merging in the upstream changes as well.
Thanks,
Tim.
@@ -4,6 +4,7 @@ | |||
|
|||
use Dyn\TrafficManagement\Api\Client as ApiClient; | |||
use Dyn\TrafficManagement\Zone; | |||
use Symfony\Component\Config\Definition\Exception\Exception; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove this import, as it doesn't appear to be used.
* @param $end int | ||
* @return bool|Zone | ||
*/ | ||
public function getQpsJobs($start,$end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming this function createQpsReport
would be more consistent with the others, since the API call is a POST, even though what it's doing is returning data.
Also, could you make the parameters camel cased versions of the actual API call args? So $startTs
, $endTs
.
I would be inclined to make this call return the actual data on success (rather than a response object), just so users of the function don't need to understand the structure of the response object as well:
if ($result && $result->isComplete()) {
return $result->data;
}
$result = $this->apiClient->post($path, ['start_ts'=>$start,'end_ts'=>$end,'zones'=>[$this->name]]); | ||
|
||
return $result; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same feedback here as for the getQpsJobs()
function.
and a check for the msgs parameter in response (qps does not have this property)