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

feat: Import tenacity library and use it in cluster_read.py #109

Merged
merged 2 commits into from
Jan 14, 2024
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
3 changes: 3 additions & 0 deletions core/opl/cluster_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from . import data
from . import date
from tenacity import * # noqa: F403


def execute(command):
Expand Down Expand Up @@ -178,6 +179,8 @@ def _sanitize_target(self, target):
target = target.replace("$Cloud", self.args.grafana_prefix)
return target

# pylint: disable-next=undefined-variable
@retry(stop=(stop_after_delay(10) | stop_after_attempt(10))) # noqa: F405
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

def measure(self, ri, name, grafana_target):
assert (
ri.start is not None and ri.end is not None
Expand Down
1 change: 1 addition & 0 deletions core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"requests",
"tabulate",
"deepdiff",
"tenacity",
],
package_data={
"opl": [
Expand Down
3 changes: 3 additions & 0 deletions opl/cluster_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from . import data
from . import date
from tenacity import * # noqa: F403


def execute(command):
Expand Down Expand Up @@ -178,6 +179,8 @@ def _sanitize_target(self, target):
target = target.replace("$Cloud", self.args.grafana_prefix)
return target

# pylint: disable-next=undefined-variable
@retry(stop=(stop_after_delay(10) | stop_after_attempt(10))) # noqa: F405
def measure(self, ri, name, grafana_target):
assert (
ri.start is not None and ri.end is not None
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"requests",
"tabulate",
"deepdiff",
"tenacity",
pablomh marked this conversation as resolved.
Show resolved Hide resolved
],
package_data={
"opl": [
Expand Down