Skip to content

Commit 615ca71

Browse files
authored
Fix install requirements (socks, urllib3) + minor fixes (#90)
Always install requests with socks Added minimum version of urrlib3 to install_requirements Do not retry on 500 errors Fixed typo and minor bug in flatness analysis
1 parent 107e9ce commit 615ca71

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

kentik_api_library/kentik_api/analytics/flatness.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def flatness_analysis(
359359
:param data: DataFrame indexed by time ("ts" column) containing columns "link" and "bytes_out" or "bps_out.
360360
"link" column is expected to contain names of network links as <device_name>:<interface_name>
361361
"bytes_out" columns (if present) is expected to contain total number of bytes transmitted via the link
362-
"bps_out" column (if present) is expected to contain average outbound bandwith in bits/s for the link
362+
"bps_out" column (if present) is expected to contain average outbound bandwidth in bits/s for the link
363363
For "bytes_out" and "bps_out" the value is for a time period ending at the timestamp.
364364
If the "bps_out" column is present it is used as the source for the analysis (regardless of presence of
365365
"bytes_out")
@@ -374,7 +374,7 @@ def flatness_analysis(
374374
log.debug("Computing bandwidth via each link")
375375
if not has_uniform_datetime_index(data):
376376
resolution = min_index_resolution(data).total_seconds()
377-
log.info("Retrieved data have non-uniform sampling (min resolution: %f seconds) - resampling")
377+
log.info("Retrieved data have non-uniform sampling (min resolution: %f seconds) - resampling", resolution)
378378
data = resample_volume_data(data, f"{resolution}S")
379379
link_bw = compute_link_bandwidth(data)
380380
else:

kentik_api_library/kentik_api/api_connection/retryable_session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66

77
log = logging.getLogger(__name__)
88

9+
910
# mypy: ignore-errors
1011
class RetryableSession(Session):
1112
DEFAULT_RETRY_STRATEGY = Retry(
1213
total=3,
1314
backoff_factor=1,
14-
status_forcelist=[429, 500, 502, 503, 504],
15+
status_forcelist=[429, 502, 503, 504],
1516
allowed_methods=["DELETE", "HEAD", "GET", "PUT", "OPTIONS", "PATCH", "POST"],
1617
)
1718

kentik_api_library/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def run(self):
102102
url="https://github.com/kentik/community_sdk_python/tree/main/kentik_api_library",
103103
license="Apache-2.0",
104104
include_package_data=True,
105-
install_requires=["dacite>=1.6.0", "requests>=2.25.0", "typing-extensions>=3.7.4.3"],
105+
install_requires=["dacite>=1.6.0", "requests[socks]>=2.25.0", "typing-extensions>=3.7.4.3", "urllib3>=1.26.0"],
106106
setup_requires=["pytest-runner", "pylint-runner", "setuptools_scm", "wheel"],
107107
tests_require=["httpretty", "pytest", "pylint"],
108108
extras_require={

0 commit comments

Comments
 (0)