Skip to content

Commit

Permalink
Merge pull request #54 from cyberlis/METRICS-INTERVAL
Browse files Browse the repository at this point in the history
Changed default export period to 0.5 to fix metrics gaps
  • Loading branch information
bugrimov committed Mar 28, 2024
2 parents 6a5e3d5 + db1aed8 commit 852b5ca
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.11.5
- Changed default export period to 0.5 to fix metrics gaps

# 1.11.4
- Lower cpu usage in main process

Expand Down
4 changes: 2 additions & 2 deletions aqueduct/metrics/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def gauge(self, name: str, value: Union[float, int]):


class Exporter(ABC):
def __init__(self, target: Any, export_period: float = 10., prefix: str = None):
def __init__(self, target: Any, export_period: float = 0.5, prefix: str = None):
self.target = target
self.export_period = export_period
if prefix is None:
Expand All @@ -46,7 +46,7 @@ def export(self, metrics: AqueductMetricsStorage):

class ToStatsDMetricsExporter(Exporter):
"""Translates aqueduct metrics to statsd metrics format."""
def __init__(self, target: StatsDBuffer, export_period: float = 10., prefix: str = None):
def __init__(self, target: StatsDBuffer, export_period: float = 0.5, prefix: str = None):
super().__init__(target, export_period, prefix)

def export(self, metrics: AqueductMetricsStorage):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
setup(
name='aqueduct',
packages=find_packages(),
version='1.11.4',
version='1.11.5',
license='MIT',
license_files='LICENSE.txt',
author='Data Science SWAT',
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ async def test_start_waiting_for_subproccess_to_start(self, task: Task):
t1 = time.time()

assert t1 - t0 == pytest.approx(slowest_handler.start_time, 0.5)
await flow.stop()

async def test_start_waiting_timeout(self, task: Task):
"""flow.start(timeout) should raise FlowError when starting_timeout expired."""
Expand All @@ -189,6 +190,7 @@ async def test_start_waiting_timeout(self, task: Task):
t1 = time.time()

assert t1 - t0 == pytest.approx(timeout, 0.5)
await flow.stop()

async def test_process_set_result(self, simple_flow: Flow, task: Task):
assert task.result is None
Expand Down

0 comments on commit 852b5ca

Please sign in to comment.