Skip to content
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

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

BillKeenan
Copy link
Contributor

and a check for the msgs parameter in response (qps does not have this property)

@BillKeenan
Copy link
Contributor Author

any reason this wouldn't be accepted? I'd love to rebase our code.

Copy link
Member

@tfountain tfountain left a 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;
Copy link
Member

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)
Copy link
Member

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;
}
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants