-
Notifications
You must be signed in to change notification settings - Fork 2
feat: PAUSED+PAGED app tier — freeze idle apps, page to swap, wake in ms (#81) #145
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
979eb49
feat(model): Status.PAUSED and Lifecycle v1.3 with two-tier idle fields
ClaydeCode 3be7a5f
feat(settings): pause-tier lifecycle options with pause_enabled kill-…
ClaydeCode 695421b
feat(service): memory_pressure module — PSI reads and cgroup page-out
ClaydeCode 22df263
feat(service): docker pause/unpause primitives and frozen-stack handling
ClaydeCode e0d8e26
feat(lifecycle): two-tier idle control loop and PSI-driven LRU demotion
ClaydeCode 58bdb30
feat(telemetry): report pause-tier metrics to the controller
ClaydeCode 4c0fff1
test(lifecycle): integration coverage for the pause tier on real cont…
ClaydeCode 0028bc5
docs: describe the pause tier in agents.md
ClaydeCode 8a4cb16
style: black formatting
ClaydeCode 41ecc27
fix(lifecycle): address review — disk stop for always_on, pause-first…
ClaydeCode c697b99
fix(migration): map legacy idle_time_for_shutdown to idle_for_pause
ClaydeCode 8dc57fa
fix(test): quick_stop mock stops directly under new migration semantics
ClaydeCode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,32 @@ | ||
| # DO NOT MODIFY - copied from freeshard-controller | ||
|
|
||
| import datetime | ||
| from typing import Dict, List, Optional | ||
|
|
||
| from pydantic import BaseModel | ||
|
|
||
|
|
||
| class PauseTierTelemetry(BaseModel): | ||
| """Metrics from the shard_core PAUSED+PAGED app tier (FreeshardBase/freeshard#81). | ||
|
|
||
| Sent by shards with the pause tier enabled; absent (None) from older shards | ||
| and from shards with the feature flag off. | ||
| """ | ||
|
|
||
| # per-app transition counts, e.g. {"immich": {"running_to_paused": 3, "paused_to_running": 2}} | ||
| transitions: Dict[str, Dict[str, int]] = {} | ||
| pause_latency_ms_p50: Optional[float] = None | ||
| pause_latency_ms_p95: Optional[float] = None | ||
| unpause_latency_ms_p50: Optional[float] = None | ||
| unpause_latency_ms_p95: Optional[float] = None | ||
| # PSI `some avg10` sampled at each control cycle within the reporting interval | ||
| psi_some_avg10_snapshots: List[float] = [] | ||
| swap_total_kib: Optional[int] = None | ||
| swap_free_kib: Optional[int] = None | ||
|
|
||
|
|
||
| class Telemetry(BaseModel): | ||
| start_time: datetime.datetime | ||
| end_time: datetime.datetime | ||
| no_of_requests: int | ||
| pause_tier: Optional[PauseTierTelemetry] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be mapped to idle_for_pause instead. Some apps have an aggressive stop time for which there should be no more need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in c697b99 — migration now maps
idle_time_for_shutdown→idle_for_pause;idle_for_stopstays unset and falls back to the global default. Aggressive legacy shutdown times become pause thresholds. Tests updated (migration + mock-store fixtures) and pass.