Automatic units in memory metrics

Open Beginner friendly
#1,031 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
observability

Research direction

Start in stats.py at the Memory class and inspect how the virtual memory metrics are currently passed to display_themed_value. Check the existing bytes2human usage and apply the requested automatic conversion consistently to virtual used, free, and total values. Done means these memory metrics display human-readable units automatically.

Written by the indexing model from the issue text.

Description

enhancement

Automatic unit conversion for memory metrics via bytes2human in stats.py Memory class:

       display_themed_value(
            theme_data=memory_stats_theme_data['VIRTUAL']['USED'],
            value=f"{bytes2human(sensors.Memory.virtual_used(), '%(value).1f %(symbol)s')}",
            min_size=6
        )
        display_themed_value(
            theme_data=memory_stats_theme_data['VIRTUAL']['FREE'],
            value=f"{bytes2human(sensors.Memory.virtual_free(), '%(value).1f %(symbol)s')}",
            min_size=6
        )
        display_themed_value(
            theme_data=memory_stats_theme_data['VIRTUAL']['TOTAL'],
            value=f"{bytes2human(sensors.Memory.virtual_free() + sensors.Memory.virtual_used(), '%(value).1f %(symbol)s')}",
            min_size=6
        )```
Dominant language
Rich Text Format
Stars
2.3k
Forks
412
Avg merge
21h 10m
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mathoudebine/turing-smart-screen-python

All issues in mathoudebine/turing-smart-screen-python

Similar issues

More Observability & SRE issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.