PagerDuty / pdpyras

Low-level PagerDuty REST/Events API client for Python
MIT License
130 stars 30 forks source link

Update for v3.1 #11

Closed Deconstrained closed 5 years ago

Deconstrained commented 5 years ago

I would like to put the custom user agent header into v3.1 ahead of v4 in order to begin gathering metrics that will help gauge the need for coming up with some clever workarounds for safer pagination during concurrent updates, i.e. race conditions.

Accounts that have very high volumes of any given object type which use this client library to make index requests would be more susceptible to concurrent operations disrupting pagination/iteration, because it might take longer to get through all pages of results, thus increasing the likelihood that something will affect the set being iterated over (see the root cause of issue #9, and also "Disclaimers Regarding Iteration" in the README, on the dev branch).

Being able to identify when the client is being used, especially for index requests, would thus help decide the most appropriate solution to issue #9 i.e. if it would be adequate to either:

  1. Simply pre-fetch all results before operating, or:
  2. Have some algorithm to keep track of results and grope through pages to make sure no results are being skipped if the total parameter in the response ever changes.