Skip to content

Commit

Permalink
Merge pull request #282 from lsst-sqre/tickets/DM-39552
Browse files Browse the repository at this point in the history
DM-39552: Generate less data when summarizing flocks
  • Loading branch information
rra authored Jul 6, 2023
2 parents b88dd74 + 769479e commit d803e83
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
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

0 comments on commit d803e83

Please sign in to comment.