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

Fix install requirements (socks, urllib3) + minor fixes #90

Merged
merged 2 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kentik_api_library/kentik_api/analytics/flatness.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def flatness_analysis(
:param data: DataFrame indexed by time ("ts" column) containing columns "link" and "bytes_out" or "bps_out.
"link" column is expected to contain names of network links as <device_name>:<interface_name>
"bytes_out" columns (if present) is expected to contain total number of bytes transmitted via the link
"bps_out" column (if present) is expected to contain average outbound bandwith in bits/s for the link
"bps_out" column (if present) is expected to contain average outbound bandwidth in bits/s for the link
For "bytes_out" and "bps_out" the value is for a time period ending at the timestamp.
If the "bps_out" column is present it is used as the source for the analysis (regardless of presence of
"bytes_out")
Expand All @@ -374,7 +374,7 @@ def flatness_analysis(
log.debug("Computing bandwidth via each link")
if not has_uniform_datetime_index(data):
resolution = min_index_resolution(data).total_seconds()
log.info("Retrieved data have non-uniform sampling (min resolution: %f seconds) - resampling")
log.info("Retrieved data have non-uniform sampling (min resolution: %f seconds) - resampling", resolution)
data = resample_volume_data(data, f"{resolution}S")
link_bw = compute_link_bandwidth(data)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

log = logging.getLogger(__name__)


# mypy: ignore-errors
class RetryableSession(Session):
DEFAULT_RETRY_STRATEGY = Retry(
total=3,
backoff_factor=1,
status_forcelist=[429, 500, 502, 503, 504],
status_forcelist=[429, 502, 503, 504],
allowed_methods=["DELETE", "HEAD", "GET", "PUT", "OPTIONS", "PATCH", "POST"],
)

Expand Down
2 changes: 1 addition & 1 deletion kentik_api_library/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def run(self):
url="https://github.com/kentik/community_sdk_python/tree/main/kentik_api_library",
license="Apache-2.0",
include_package_data=True,
install_requires=["dacite>=1.6.0", "requests>=2.25.0", "typing-extensions>=3.7.4.3"],
install_requires=["dacite>=1.6.0", "requests[socks]>=2.25.0", "typing-extensions>=3.7.4.3", "urllib3>=1.26.0"],
setup_requires=["pytest-runner", "pylint-runner", "setuptools_scm", "wheel"],
tests_require=["httpretty", "pytest", "pylint"],
extras_require={
Expand Down