Skip to content

include memory logger - #1

Merged
anna-follestad-4ss merged 2 commits into
mainfrom
memory-logger
Aug 18, 2026
Merged

include memory logger#1
anna-follestad-4ss merged 2 commits into
mainfrom
memory-logger

Conversation

@anna-follestad-4ss

Copy link
Copy Markdown
Collaborator

What changed

Adds a memory logger for development purposes. The tool is controlled by a single variable in the .env file, "LOG_MEMORY". When set to true, the logger prints the used memory to terminal every time the user navigates to a new page.

Why

Included as a development tool, as we know that the 4insight implementation of python dashboards will have limited memory.

Definition of done

CI covers the first two. The rest are yours — tick them because you did them,
not because they were already ticked. See CONTRIBUTING.md for why each is here.

  • pytest passes
  • black is clean
  • memory logger acts as decribed
  • memory logger behaviour is logical and useful.

Anything the reviewer should look at closely

Check if you think the logging interval make sense. I tried to do a "timed" version, i.e. log memory usage every 30 sec, but I figured at navigation is more useful.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in development memory logger (controlled by LOG_MEMORY) so developers can observe the app process’ RSS usage during navigation, helping validate memory headroom for constrained deployments.

Changes:

  • Introduces src/memory_log.py to print RSS memory usage on demand.
  • Adds LOG_MEMORY wiring in src/app.py to log once on URL/pathname changes.
  • Documents the feature in README.md / .env.example and adds psutil to requirements-dev.txt.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/memory_log.py New utility for printing current process RSS memory usage.
src/app.py Adds LOG_MEMORY env toggle and calls the logger on navigation.
requirements-dev.txt Adds psutil as a dev dependency.
README.md Documents how to enable memory logging via .env.
.env.example Adds LOG_MEMORY configuration and usage notes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/app.py Outdated
Comment thread src/memory_log.py
Comment thread src/app.py
@anna-follestad-4ss
anna-follestad-4ss merged commit 146e0d4 into main Aug 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants