Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion chaosprometheus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from chaoslib.types import DiscoveredActivities, Discovery
from logzero import logger

__version__ = '0.3.0'
__version__ = '0.3.1'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For futrure reference, we usually do not change the version in the PR



def discover(discover_system: bool = True) -> Discovery:
Expand Down
Empty file.
18 changes: 18 additions & 0 deletions chaosprometheus/verification/probes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from logzero import logger

__all__ = ["query_results_lower_than_threshold"]


def query_results_lower_than_threshold(threshold: int,
value: dict) -> bool:
"""
Checks if all passed Prometheus values are below the
given threshold. If so returns True, otherwise False.
If no threshold is given it throws an exception.
"""
if threshold is None:
raise Exception("No threshold given")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That should be ActivityFailed instead Exception

logger.info("threshold: %d" % (threshold,))
print(value)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

trailing print should be removed

return True