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

DM-39552: Generate less data when summarizing flocks #282

Merged
merged 2 commits into from
Jul 6, 2023
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ repos:
- id: check-yaml
- id: check-toml

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.272
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.277
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -17,7 +17,7 @@ repos:
hooks:
- id: black

- repo: https://github.com/asottile/blacken-docs
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.14.0
hooks:
- id: blacken-docs
Expand Down
3 changes: 3 additions & 0 deletions changelog.d/20230706_111300_rra_DM_39552.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Bug fixes

- Rather than dumping the full monkey data when summarizing flocks, which can cause long enough delays that in-progress calls fail due to the huge amount of timing data, extract only the success and failure count from the running business. This should be considerably faster and avoid timeout problems.
2 changes: 2 additions & 0 deletions src/mobu/models/business/nublado.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class CachemachinePolicy(Enum):
class NubladoImageClass(str, Enum):
"""Possible ways of selecting an image."""

__slots__ = ()

RECOMMENDED = "recommended"
LATEST_RELEASE = "latest-release"
LATEST_WEEKLY = "latest-weekly"
Expand Down
5 changes: 2 additions & 3 deletions src/mobu/services/flock.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ def summary(self) -> FlockSummary:
successes = 0
failures = 0
for monkey in self._monkeys.values():
data = monkey.dump()
count += 1
successes += data.business.success_count
failures += data.business.failure_count
successes += monkey.business.success_count
failures += monkey.business.failure_count
return FlockSummary(
name=self.name,
business=self._config.business.type,
Expand Down
Loading