smax_from_valkey: --merge option, error handling, scripts README#21
Open
mpound wants to merge 4 commits into
Open
smax_from_valkey: --merge option, error handling, scripts README#21mpound wants to merge 4 commits into
mpound wants to merge 4 commits into
Conversation
Adds deep_merge(base, overlay) which recursively merges two JSON dicts, with base (smax.json) taking precedence on conflicts. This preserves validated descriptions, units, and thresholds while adding new entries. New CLI flag: --merge [SMAX_JSON] (default: conf/smax.json when flag is present without argument). The merged result is written to --output. 9 new tests in TestDeepMerge. Total: 223 tests passing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers dump_redis, compare_monitor_points, smax_from_valkey (including --merge workflow), fakeobs, simple_smax_check, and test coverage. Includes the typical end-to-end workflow for updating smax.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
smax_from_valkey.pyerror handling: Variables whosesmax_pullquery fails are now omitted from output (previously written as{"size": "?", "smax_type": "?", "_error": "..."}which would pollute smax.json). Failure count reported to stderr;--verboselists the names.smax_from_valkey.py --merge: New option deep-merges generated entries into an existingsmax.json.smax.jsonvalues take precedence on conflicts, preserving validated descriptions, units, and thresholds while adding new keys. Output goes to--output.scripts/README.md: New reference doc covering all scripts —dump_redis,compare_monitor_points,smax_from_valkey(including merge workflow),fakeobs,simple_smax_check, and test files.recursewithtreelib.py: Fix broken import paths (Marc).TestDeepMergetests and 5 newTestBuildSubtreeErrorstests. Total: 223 tests passing.Typical workflow enabled by --merge
Test plan
uv run pytest— 223 tests passuv run scripts/smax_from_valkey.py valkeynotsmax.txt --merge --output /tmp/test.json --verbosewith a live Valkey server🤖 Generated with Claude Code