Repository navigation
Add a runnable example, its real output and a request-flow diagram to the README - #50
Open
dmccoystephenson wants to merge 1 commit into
Open
dmccoystephenson wants to merge 1 commit into
dmccoystephenson wants to merge 1 commit into
Conversation
… the README A self-contained example (examples/demo.py) was added that runs the client against a stand-in trace server on a loopback port and prints what arrives, then shows each opt-out. Its real output was rendered to docs/screenshots/demo-output.png with a darkroom shot list (docs/screenshots/media.json), and the image was added to the README as a hero image and in a new Screenshots section. A Mermaid sequence diagram of the report path (constructor opt-outs, queue, sender thread, POST /api/metrics, close() draining) was written from trace_client.py. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <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
The README had no visuals. This adds real ones:
examples/demo.py, a self-contained example that starts a stand-in trace server on a free loopback port (standard libraryThreadingHTTPServer, answering201like a trace server), points aTraceClientat it with a demo key, reports three events,close()s, and prints what the server received. It then builds the client withDO_NOT_TRACK=1,enabled="false"and an empty key and printsenabled/disabled_reasonfor each. Nothing leaves the machine.docs/screenshots/demo-output.png(83 KB): the actual output ofpython examples/demo.py, rendered as a terminal and screenshotted in headless Chromium. Added as a hero image after the intro example and in a new Screenshots section with a caption.TraceClient→ bounded queue → sender thread →POST /api/metrics, written fromtrace_client.py: opt-out order in the constructor, tag merging,put_nowait, the non-201/redirect/timeout path logged at DEBUG, andclose()draining behind a stop signal. It is a diagram, not a screenshot.darkroom shoot docs/screenshots/media.jsonruns the example (render_terminal.py) and screenshots the output..darkroom/was added to.gitignore; the generated HTML goes to the already-ignoredbuild/.The image contains only demo values (
demo-game,demo-key, a loopback server); the random install ID is cut to its first eight characters by the example.No library code was changed.
Tests
python -m unittestwas run locally on Python 3.8.10: 84 pass, 2 fail. Both failures are pre-existing onmainand unrelated to this change:chore: release 0.5.1 (#48)set__version__ = "0.5.1"but left the file header at0.5.0andtest_user_agent_names_the_client_versionexpecting0.5.0, so the Build workflow onmainis already red (run 44866128194). This PR is expected to show the same two failures until that is fixed separately.examples/demo.pywas run six times in a row without a failure, and the Mermaid block was rendered with Mermaid 10.9.1 to check it parses.drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code