graphina 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 312b53087f996a782bb42290c0bd6c1d198bba698beb488ca3718ce3ad50bb27
4
- data.tar.gz: 5491ba83b0ff23510c70bfe8105bb30b0bd2f8e11889823873541c420d478b15
3
+ metadata.gz: 34d6c2359a026420a4d0994c99cdc961de57d1bc2b94bc2fd0b1d5e00f9069e6
4
+ data.tar.gz: d313432adb111b829637d896712df4d87393cae8a96f3161f30930908a19dec9
5
5
  SHA512:
6
- metadata.gz: 9bb2bf827cd8b72a2d0708ac6471d3afd611f7f3918350f36d84dd5f9d5b2981faf14ce953a5a7caa74b14630530890c733faecde541b5f9b0d8cc83e8891231
7
- data.tar.gz: 7d158cf60ed9f707ad682d9e0f3f1e3f647c87a6ceb6a17bb46775997bee5547700f77a3168df27a45c394c90b4aa5206b006d291f6ef73b62a3a713d065b3c0
6
+ metadata.gz: 58e6f2e36923dd6132fd2a2705467a7227ec84e58e1cc24a5548cdf9d132cc41561781f3ac285398e0065c17e31f62708818c1c80c51d41b277b63f387927483
7
+ data.tar.gz: 58b912ea40cb79e670238d411ee8ebea3c4d6827e1d5032c9756f8a79eabfa96cbaab2e114870e3bcd8a112704073dc54ad07151526c4d323766fa3807c4cc89
data/CHANGES.md ADDED
@@ -0,0 +1,181 @@
1
+ # Changes
2
+
3
+ ## 2026-11-19 v0.6.0
4
+
5
+ ### Fixes
6
+
7
+ - Corrected typo in `Graph#initialize` documentation: "determineicolor" to
8
+ "determine color".
9
+ - Fixed missing periods in `Display` class documentation to resolve run-on
10
+ sentences.
11
+
12
+ ### Improvements
13
+
14
+ - Removed unused `normalize_value` method from `Graphina::Graph`.
15
+ - Replaced `else` clause with explicit `when :single` in
16
+ `Graphina::Graph#draw_graph` to explicitly support the `:single` resolution
17
+ mode.
18
+ - Added descriptive header comments to `lib/graphina/version.rb`.
19
+ - Removed redundant Vim modeline comments from `Gemfile` and `Rakefile`.
20
+
21
+ ### Build & CI
22
+
23
+ - Updated `rubygems_version` to **4.0.24** in `graphina.gemspec`.
24
+ - Updated `gem_hadar` development dependency requirement to `>= 2.24.1` in
25
+ `graphina.gemspec`.
26
+
27
+ ### Documentation
28
+
29
+ - Added missing `@raise` documentation for `adjust_brightness` in
30
+ `Graph#initialize`.
31
+ - Added YARD documentation for the private `Graph#perform` method.
32
+ - Added missing `@raise` documentation for dimension mismatch in `Display#-`.
33
+ - Added `@attr` documentation for `Panel#title` accessor.
34
+ - Added documentation for the `true_coloring` parameter in
35
+ `Graphina::Graph#initialize`.
36
+ - Rewrote `.contexts/yard.md` from a cheatsheet into a documentation guide for
37
+ AI assistants, including a complete `Document` class example and rules for
38
+ generating YARD comments.
39
+
40
+ ## 2026-01-12 v0.5.0
41
+
42
+ - Added `CHANGES.md` file to track version history and changes
43
+ - Added `changelog` section to `Rakefile` to include `CHANGES.md` in gem build
44
+ process
45
+ - Updated `rubygems_version` from **4.0.2** to **4.0.3**
46
+ - Updated `gem_hadar` development dependency from **~> 2.10** to **>= 2.16.2**
47
+ - Added GPU monitoring sections to **x86_64-linux.yml** with fan, clock, and
48
+ temperature panels
49
+ - Enhanced **x86_64-linux.yml** with hardware fan monitoring support for case,
50
+ CPU, and pump fans
51
+ - Introduced new documentation headers for **arm64-darwin.yml**,
52
+ **x86_64-darwin.yml**, and **x86_64-linux.yml**
53
+ - Updated memory usage color from **`#689d6a`** to **`#fabd2f`** in
54
+ **x86_64-linux.yml**
55
+ - Standardized color schemes across all platform configurations
56
+ - Added detailed inline documentation for the `usage` method with comprehensive help text
57
+ - Included descriptive comments at the top of the file explaining Graphina's
58
+ purpose and features
59
+
60
+ ## 2025-12-19 v0.4.1
61
+
62
+ - Updated `gem_hadar` development dependency from version **2.8** to **2.10**
63
+
64
+ ## 2025-12-18 v0.4.0
65
+
66
+ - Updated `tins` gem dependency from **1.45** to **1.49**
67
+ - Replaced manual SI prefix construction with `:si_uc` format option in
68
+ `as_hertz` method
69
+ - Updated `rubygems` version requirement from **3.7.2** to **4.0.2** in gemspec
70
+ - Removed workaround code for prefix formatting in
71
+ `lib/graphina/graph/formatters.rb`
72
+
73
+ ## 2025-12-16 v0.3.0
74
+
75
+ - Added support for **MacOS ARM 64** platform with new `arm64-darwin.yml`
76
+ default config
77
+ - Updated `README.md` to reflect that installation now includes config
78
+ inference and installation
79
+ - Simplified CPU usage extraction command in `README.md` by removing
80
+ unnecessary `grep` step
81
+ - Refactored temperature sensor data extraction in `README.md` to use single
82
+ `awk` command instead of `grep | awk` pipeline
83
+ - Added support for **arm64**-darwin platform in `Graphina::Setup`
84
+ - Introduced `arm64-darwin.yml` default panel configuration
85
+ - Updated `x86_64-darwin.yml` and `x86_64-linux.yml` with standardized titles
86
+ - Enhanced `as_hertz` method in `Graphina::Graph` to use custom prefixes
87
+ - Replaced `Tins::Unit.format` with custom prefix handling for better control
88
+ - Updated CPU clock command for **x86_64-darwin** to use `powermetrics` with
89
+ `-i 100 -n 9` flags
90
+ - Changed title format for all metrics from "(%)" to "%" for consistency
91
+ - Used `%.3f%U` format string for `as_hertz` to ensure proper unit display
92
+
93
+ ## 2025-12-13 v0.2.0
94
+
95
+ - Added support for predefined panel configurations with new `Graphina::Setup`
96
+ class
97
+ - Introduced `-S` command-line option to install default panel configurations
98
+ from `lib/graphina/panel/defaults/`
99
+ - Added default panel configuration files for **x86_64-darwin** and
100
+ **x86_64-linux** architectures
101
+ - Enhanced `bin/graphina` to handle the new `-S` option and call
102
+ `Graphina::Setup#install_default_panels`
103
+ - Updated `lib/graphina.rb` to require `graphina/setup`
104
+ - Added `lib/graphina/setup.rb` with platform detection and configuration
105
+ copying functionality
106
+ - Extended documentation in `README.md` for panel configuration setup and usage
107
+ - Added `project_structure` tag to tree command for documentation
108
+ categorization
109
+ - Introduced `structure` namespace with `tree` command for project layout
110
+ analysis
111
+ - Updated Linux system monitoring panel configurations:
112
+ - Renamed `cpu` panel to `cpu_usage_percentage` in `README.md`
113
+ - Renamed `memory` panel to `memory_usage` in `README.md`
114
+ - Added new `memory_usage_percentage` panel with percentage calculation
115
+ - Renamed `temperature` panel to `cpu_temperature` in `README.md`
116
+ - Configured tree command to capture project file hierarchy
117
+ - Enabled documentation generation for gem directory structure
118
+ - Added `lib/graphina/setup.rb` to `extra_rdoc_files` and `files` in
119
+ `graphina.gemspec`
120
+ - Updated file tagging in `.contexts/code_comment.rb` to include `code` and
121
+ `config` tags for YAML files
122
+
123
+ ## 2025-11-29 v0.1.1
124
+
125
+ - Updated Celsius temperature symbol from `"°"` to `"℃"` for better Unicode
126
+ representation
127
+ - Added platform-specific panel configuration examples to `README.md` including
128
+ a Linux example for `panels.yml` configuration
129
+ - Added `img/graphina.png` screenshot to `README.md` with a new section `##
130
+ Screenshots (run in tmux)` and alt text "graphina Screenshot"
131
+ - Introduced new `.utilsrc` configuration file for code indexing and searching
132
+ - Added `cscope.out` to `.gitignore` and `Rakefile`
133
+ - Updated panel configuration with new names and improved formatting
134
+
135
+ ## 2025-10-30 v0.1.0
136
+
137
+ - Added support for predefined panel configurations via the new `-P PANEL`
138
+ command line option
139
+ - Implemented panel configuration system with `Graphina::Panel` class for
140
+ managing graph display settings
141
+ - Introduced `Graphina::Panel::Chooser` module for interactive panel selection
142
+ with fuzzy matching
143
+ - Enhanced CLI with backwards compatible `-e` flag support for executing
144
+ external data commands
145
+ - Updated documentation to reflect XDG base directory specification for
146
+ configuration files
147
+ - Added `GraphinaConfig` module with support for XDG Base Directory
148
+ specification and YAML configuration loading
149
+ - Added new dependencies: `const_conf` (**0.4**), `amatch` (**0.5**), and
150
+ `search_ui`
151
+ - Extended `format_value` method to support both `Symbol` and `String` types
152
+ for method calls
153
+ - Refactored graph initialization to use panel values instead of raw
154
+ command-line options
155
+ - Added `configure_from_opts` method to `Graphina::Panel` for backward
156
+ compatibility
157
+ - Updated `Graphina::Graph` initialization to use panel values
158
+ - Added `Tins` dependency for additional utilities
159
+ - Improved README documentation with `panels.yml` configuration examples and
160
+ `cpu`/`memory` panel examples
161
+ - Added interactive panel selection when no panel is specified
162
+ - Updated `Graphina::Panel` to support dynamic attribute assignment via
163
+ `configure` method
164
+ - Added accessor methods for title, interval, command, color settings,
165
+ resolution, and `format_value`
166
+ - Added `value` method that returns data generation proc (external command or
167
+ random data)
168
+ - Added `from_opts` factory method for creating panel instances from
169
+ command-line options
170
+ - Updated gemspec file lists to include new files: `graphina_config.rb`,
171
+ `panel.rb`, and `panel/chooser.rb`
172
+ - Added YARD documentation cheatsheet and guidelines for consistent
173
+ documentation practices
174
+ - Documented `-e COMMAND` option for executing external data commands with
175
+ examples using `top` and `free` commands
176
+ - Split long lines in README.md for better readability
177
+ - Removed incorrect parameter documentation from `clear` method
178
+
179
+ ## 2025-10-27 v0.0.0
180
+
181
+ * Start
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
- # vim: set filetype=ruby et sw=2 ts=2:
2
-
3
1
  source 'https://rubygems.org'
4
2
 
5
3
  gemspec
data/Rakefile CHANGED
@@ -1,5 +1,3 @@
1
- # vim: set filetype=ruby et sw=2 ts=2:
2
-
3
1
  require 'gem_hadar'
4
2
 
5
3
  GemHadar do
@@ -25,6 +23,10 @@ GemHadar do
25
23
 
26
24
  readme 'README.md'
27
25
 
26
+ changelog do
27
+ filename 'CHANGES.md'
28
+ end
29
+
28
30
  github_workflows(
29
31
  'static.yml' => {}
30
32
  )
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.6.0
data/bin/graphina CHANGED
@@ -1,10 +1,37 @@
1
1
  #!/usr/bin/env ruby
2
+ # Graphina - Terminal-based Real-time Data Visualization
3
+ #
4
+ # Graphina creates dynamic, real-time graphical displays in terminal
5
+ # environments using Unicode block characters and ANSI color codes. It supports
6
+ # various data sources, formatting options, and customizable display
7
+ # configurations.
8
+ #
9
+ # Features:
10
+ # - Real-time graphing with smooth terminal updates
11
+ # - Multiple resolution modes (:single or :double)
12
+ # - Customizable colors, titles, and formatting
13
+ # - Support for external command data sources
14
+ # - Interactive panel selection
15
+ # - Terminal resize handling
16
+ # - Cross-platform configuration using XDG Base Directory spec
17
+ #
18
+ # See 'graphina -h' for full command-line options and examples.
2
19
 
3
20
  require 'graphina'
4
21
  require 'term/ansicolor'
5
22
  include Tins::GO
6
23
  require 'shellwords'
7
24
 
25
+ # The usage method displays the command-line help text for the graphina
26
+ # application
27
+ #
28
+ # This method prints a formatted help message to standard output that describes
29
+ # all available command-line options, their default values, and provides usage
30
+ # examples for different scenarios including basic usage, custom titles,
31
+ # colors, and specific # data source configurations
32
+ #
33
+ # @return [ Integer ] returns 0 to indicate successful help display as exit
34
+ # code.
8
35
  def usage
9
36
  puts <<~EOT
10
37
  Usage: #{File.basename($0)} [OPTIONS]
data/graphina.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: graphina 0.4.1 ruby lib
2
+ # stub: graphina 0.6.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "graphina".freeze
6
- s.version = "0.4.1".freeze
6
+ s.version = "0.6.0".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -13,17 +13,17 @@ Gem::Specification.new do |s|
13
13
  s.email = "flori@ping.de".freeze
14
14
  s.executables = ["graphina".freeze]
15
15
  s.extra_rdoc_files = ["README.md".freeze, "lib/graphina.rb".freeze, "lib/graphina/graph.rb".freeze, "lib/graphina/graph/display.rb".freeze, "lib/graphina/graph/display/cell.rb".freeze, "lib/graphina/graph/formatters.rb".freeze, "lib/graphina/graphina_config.rb".freeze, "lib/graphina/panel.rb".freeze, "lib/graphina/panel/chooser.rb".freeze, "lib/graphina/setup.rb".freeze, "lib/graphina/version.rb".freeze]
16
- s.files = [".utilsrc".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/graphina".freeze, "graphina.gemspec".freeze, "img/graphina.png".freeze, "lib/graphina.rb".freeze, "lib/graphina/graph.rb".freeze, "lib/graphina/graph/display.rb".freeze, "lib/graphina/graph/display/cell.rb".freeze, "lib/graphina/graph/formatters.rb".freeze, "lib/graphina/graphina_config.rb".freeze, "lib/graphina/panel.rb".freeze, "lib/graphina/panel/chooser.rb".freeze, "lib/graphina/panel/defaults/arm64-darwin.yml".freeze, "lib/graphina/panel/defaults/x86_64-darwin.yml".freeze, "lib/graphina/panel/defaults/x86_64-linux.yml".freeze, "lib/graphina/setup.rb".freeze, "lib/graphina/version.rb".freeze]
16
+ s.files = [".utilsrc".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/graphina".freeze, "graphina.gemspec".freeze, "img/graphina.png".freeze, "lib/graphina.rb".freeze, "lib/graphina/graph.rb".freeze, "lib/graphina/graph/display.rb".freeze, "lib/graphina/graph/display/cell.rb".freeze, "lib/graphina/graph/formatters.rb".freeze, "lib/graphina/graphina_config.rb".freeze, "lib/graphina/panel.rb".freeze, "lib/graphina/panel/chooser.rb".freeze, "lib/graphina/panel/defaults/arm64-darwin.yml".freeze, "lib/graphina/panel/defaults/x86_64-darwin.yml".freeze, "lib/graphina/panel/defaults/x86_64-linux.yml".freeze, "lib/graphina/setup.rb".freeze, "lib/graphina/version.rb".freeze]
17
17
  s.homepage = "https://github.com/flori/graphina".freeze
18
18
  s.licenses = ["MIT".freeze]
19
19
  s.rdoc_options = ["--title".freeze, "Graphina - Gem for creating terminal-based data visualizations with real-time\ngraphical displays using Unicode characters and ANSI styling.\n".freeze, "--main".freeze, "README.md".freeze]
20
20
  s.required_ruby_version = Gem::Requirement.new(">= 3.1".freeze)
21
- s.rubygems_version = "4.0.2".freeze
21
+ s.rubygems_version = "4.0.24".freeze
22
22
  s.summary = "Gem for creating terminal-based data visualizations with real-time graphical displays using Unicode characters and ANSI styling.".freeze
23
23
 
24
24
  s.specification_version = 4
25
25
 
26
- s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.10".freeze])
26
+ s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.24.1".freeze])
27
27
  s.add_development_dependency(%q<debug>.freeze, ["~> 1.0".freeze])
28
28
  s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.49".freeze])
29
29
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
@@ -3,8 +3,8 @@ class Graphina::Graph
3
3
  # styling support
4
4
  #
5
5
  # The Display class provides functionality for creating and managing
6
- # terminal-based visual displays It handles cell-level rendering with support
7
- # for colors, background colors, and text styles The class maintains internal
6
+ # terminal-based visual displays. It handles cell-level rendering with support
7
+ # for colors, background colors, and text styles. The class maintains internal
8
8
  # state for cursor position and formatting attributes while providing methods
9
9
  # to manipulate individual cells and render complete display grids to the
10
10
  # terminal
@@ -113,6 +113,9 @@ class Graphina::Graph
113
113
  #
114
114
  # @return [ String ] a string containing ANSI escape sequences for
115
115
  # rendering only the changed cells
116
+ #
117
+ # @raise [ ArgumentError ] raised when the old display dimensions don't
118
+ # match the current display dimensions
116
119
  def -(old)
117
120
  dimensions != old.dimensions and raise ArgumentError,
118
121
  "old dimensions #{old.dimensions.inspect} don't match #{dimensions.inspect}"
@@ -53,8 +53,9 @@ class Graphina::Graph
53
53
  # @param format_value [ Proc, Symbol, nil ] formatting strategy for
54
54
  # displaying values
55
55
  # @param sleep [ Numeric ] time in seconds between updates
56
+ # @param true_coloring [ Boolean ] enable true coloring support
56
57
  # @param color [ Object, Proc, nil ] color or proc or nil. nil
57
- # determineicolor dynamically from the title
58
+ # determine color dynamically from the title
58
59
  # @param color_secondary [ Object, nil ] secondary color or nil
59
60
  # for enhanced visuals, nil derives secondary color from (primary) color
60
61
  # @param adjust_brightness [ Symbol ] the method to call on the color for
@@ -70,6 +71,7 @@ class Graphina::Graph
70
71
  # @raise [ ArgumentError ] if the sleep parameter is negative
71
72
  # @raise [ TypeError ] if the sleep parameter is not numeric
72
73
  # @raise [ ArgumentError ] if the resolution parameter is not :single or :double
74
+ # @raise [ ArgumentError ] if the adjust_brightness parameter is not :lighten or :darken
73
75
  def initialize(
74
76
  title:,
75
77
  value: -> i { 0 },
@@ -172,7 +174,7 @@ class Graphina::Graph
172
174
  else
173
175
  @display.at(iy, x).on_color(color).color(color_secondary).write(?▄)
174
176
  end
175
- else
177
+ when :single
176
178
  @display.at(iy, x).on_color(color).color(color_secondary).write(' ')
177
179
  end
178
180
  end
@@ -237,6 +239,10 @@ class Graphina::Graph
237
239
  stop
238
240
  end
239
241
 
242
+ # The perform method is a thin wrapper around Kernel#print that
243
+ # centralizes all terminal output through a single call site.
244
+ #
245
+ # @param a [ Array ] the arguments to print to the terminal
240
246
  def perform(*a)
241
247
  print(*a)
242
248
  end
@@ -395,28 +401,6 @@ class Graphina::Graph
395
401
  end
396
402
  end
397
403
 
398
-
399
- # The normalize_value method converts a value to its appropriate numeric
400
- # representation
401
- #
402
- # This method takes an input value and normalizes it to either a Float or
403
- # Integer type depending on its original form. If the value is already a
404
- # Float, it is returned as-is. For all other types, the method attempts to
405
- # convert the value to an integer using to_i
406
- #
407
- # @param value [ Object ] the value to be normalized
408
- #
409
- # @return [ Float, Integer ] the normalized numeric value as either a Float
410
- # or Integer
411
- def normalize_value(value)
412
- case value
413
- when Float
414
- value
415
- else
416
- value.to_i
417
- end
418
- end
419
-
420
404
  # The full_reset method performs a complete reset of the display and terminal
421
405
  # state
422
406
  #
@@ -1,3 +1,11 @@
1
+ # CPU Usage and Temperature Monitoring
2
+ #
3
+ # These panels monitor CPU performance metrics on Apple Silicon (ARM64) macOS
4
+ # systems.
5
+ # Uses system commands to gather real-time data for visualization.
6
+ # Note: Some commands may require specific tools or may behave differently on
7
+ # ARM64 architecture.
8
+
1
9
  cpu_usage_percentage:
2
10
  title: "CPU Usage %"
3
11
  interval: 1
@@ -5,6 +13,7 @@ cpu_usage_percentage:
5
13
  top -l 1 -n 0 | awk '/^CPU usage:/ { printf "%.1f", $3 + $5 }'
6
14
  format_value: as_percent
7
15
  color: '#fe8019'
16
+
8
17
  cpu_temperature:
9
18
  title: "CPU Temperature ℃ "
10
19
  interval: 1
@@ -12,6 +21,7 @@ cpu_temperature:
12
21
  smctemp -c
13
22
  format_value: as_celsius
14
23
  color: '#fb4934'
24
+
15
25
  cpu_clock_average:
16
26
  title: "CPU Clock Speed Hz"
17
27
  interval: 1
@@ -19,17 +29,24 @@ cpu_clock_average:
19
29
  sudo powermetrics --show-usage-summary -s cpu_power -i 100 -n 9 | awk '/CPU [0-9]+ frequency: / { count++; sum += $4 } END { if (count > 0) { print 1000000 * sum / count } else { print 0 } }'
20
30
  format_value: as_hertz
21
31
  color: '#b8bb26'
32
+
33
+ # Memory Usage Monitoring
34
+ #
35
+ # These panels track memory utilization on Apple Silicon (ARM64) macOS systems.
36
+ # Provides both absolute usage and percentage values.
37
+
22
38
  memory_usage:
23
39
  title: "Memory Usage"
24
40
  interval: 1
25
41
  command: |
26
42
  free -b | awk '/^Mem:/ { print $4 }'
27
43
  format_value: as_bytes
28
- color: '#689d6a'
44
+ color: '#fabd2f'
45
+
29
46
  memory_usage_percentage:
30
47
  title: "Memory Usage %"
31
48
  interval: 1
32
49
  command: |
33
50
  free -b | awk '/^Mem:/ { printf "%.1f", 100 * $4 / $2 }'
34
51
  format_value: as_percent
35
- color: '#689d6a'
52
+ color: '#fabd2f'
@@ -1,3 +1,8 @@
1
+ # CPU Usage and Temperature Monitoring
2
+ #
3
+ # These panels monitor CPU performance metrics on macOS systems.
4
+ # Uses system commands to gather real-time data for visualization.
5
+
1
6
  cpu_usage_percentage:
2
7
  title: "CPU Usage %"
3
8
  interval: 1
@@ -5,6 +10,7 @@ cpu_usage_percentage:
5
10
  top -l 1 -n 0 | awk '/^CPU usage:/ { printf "%.1f", $3 + $5 }'
6
11
  format_value: as_percent
7
12
  color: '#fe8019'
13
+
8
14
  cpu_temperature:
9
15
  title: "CPU Temperature ℃ "
10
16
  interval: 1
@@ -12,6 +18,7 @@ cpu_temperature:
12
18
  osx-cpu-temp -C | tr -dc '0-9.'
13
19
  format_value: as_celsius
14
20
  color: '#fb4934'
21
+
15
22
  cpu_clock_average:
16
23
  title: "CPU Clock Speed Hz"
17
24
  interval: 1
@@ -19,17 +26,24 @@ cpu_clock_average:
19
26
  sudo powermetrics --show-usage-summary -s cpu_power -i 100 -n 9 | awk '/CPU Average frequency as fraction of nominal: / { count++; gsub(/[^0-9.]/, "", $9); sum += $9 } END { if (count > 0) { print 1000000 * sum / count } else { print 0 } }'
20
27
  format_value: as_hertz
21
28
  color: '#b8bb26'
29
+
30
+ # Memory Usage Monitoring
31
+ #
32
+ # These panels track memory utilization on macOS systems.
33
+ # Provides both absolute usage and percentage values.
34
+
22
35
  memory_usage:
23
36
  title: "Memory Usage"
24
37
  interval: 1
25
38
  command: |
26
39
  free -b | awk '/^Mem:/ { print $4 }'
27
40
  format_value: as_bytes
28
- color: '#689d6a'
41
+ color: '#fabd2f'
42
+
29
43
  memory_usage_percentage:
30
44
  title: "Memory Usage %"
31
45
  interval: 1
32
46
  command: |
33
47
  free -b | awk '/^Mem:/ { printf "%.1f", 100 * $4 / $2 }'
34
48
  format_value: as_percent
35
- color: '#689d6a'
49
+ color: '#fabd2f'
@@ -1,3 +1,9 @@
1
+ # CPU Monitoring
2
+ #
3
+ # These panels monitor CPU performance metrics on Linux systems.
4
+ # Uses standard Linux tools like 'top', 'sensors', and '/proc/cpuinfo' for data
5
+ # collection.
6
+
1
7
  cpu_usage_percentage:
2
8
  title: "CPU Usage %"
3
9
  interval: 1
@@ -5,6 +11,7 @@ cpu_usage_percentage:
5
11
  top -b -n 1 | awk '/^%Cpu\(s\)/ { print $2 + $4 + $6 }'
6
12
  format_value: as_percent
7
13
  color: '#fe8019'
14
+
8
15
  cpu_temperature:
9
16
  title: "CPU Temperature ℃ "
10
17
  interval: 1
@@ -12,6 +19,7 @@ cpu_temperature:
12
19
  sensors | awk '/^Tctl:/ { print $2 }' | tr -dc '0-9.'
13
20
  format_value: as_celsius
14
21
  color: '#fb4934'
22
+
15
23
  cpu_clock_average:
16
24
  title: "CPU Clock Speed Hz"
17
25
  interval: 1
@@ -19,17 +27,149 @@ cpu_clock_average:
19
27
  awk '/cpu MHz/ {sum += $4; count++} END {if (count > 0) print 1000000 * sum/count}' /proc/cpuinfo
20
28
  format_value: as_hertz
21
29
  color: '#b8bb26'
30
+
31
+ # Memory Usage Monitoring
32
+ #
33
+ # These panels track memory utilization on Linux systems.
34
+ # Provides both absolute usage and percentage values using the 'free' command.
35
+
22
36
  memory_usage:
23
37
  title: "Memory Usage"
24
38
  interval: 1
25
39
  command: |
26
40
  free -b | awk '/^Mem:/ { print $3 }'
27
41
  format_value: as_bytes
28
- color: '#689d6a'
42
+ color: '#fabd2f'
43
+
29
44
  memory_usage_percentage:
30
45
  title: "Memory Usage %"
31
46
  interval: 1
32
47
  command: |
33
48
  free -b | awk '/^Mem:/ { printf "%.1f", 100 * $3 / $2 }'
34
49
  format_value: as_percent
50
+ color: '#fabd2f'
51
+
52
+ # Hardware Fan Monitoring
53
+ #
54
+ # These panels monitor fan speeds and PWM values for various hardware components.
55
+ # Uses 'sensors' command with JSON output and 'jq' for parsing.
56
+ # Note: Requires 'lm-sensors' package and 'jq' utility to be installed.
57
+
58
+ # System Fans (Teal group)
59
+ case_fan_rpm:
60
+ title: "Case Fan RPM"
61
+ interval: 1
62
+ command: |
63
+ sensors -j | jq '."nct6799-isa-0290".fan1.fan1_input'
64
+ format_value: as_default
65
+ color: '#83a598'
66
+
67
+ case_fan_percentage:
68
+ title: "Case Fan %"
69
+ interval: 1
70
+ command: |
71
+ sensors -j | jq '."nct6799-isa-0290".pwm1.pwm1'
72
+ format_value: as_percent
73
+ color: '#83a598'
74
+
75
+ # CPU Fans (Blue group)
76
+ cpu_fan_rpm:
77
+ title: "CPU Fan RPM"
78
+ interval: 1
79
+ command: |
80
+ sensors -j | jq '."nct6799-isa-0290".fan2.fan2_input'
81
+ format_value: as_default
82
+ color: '#458588'
83
+
84
+ cpu_fan_percentage:
85
+ title: "CPU Fan %"
86
+ interval: 1
87
+ command: |
88
+ sensors -j | jq '."nct6799-isa-0290".pwm2.pwm2'
89
+ format_value: as_percent
90
+ color: '#458588'
91
+
92
+ # Pump Fans (Green group)
93
+ pump_fan_rpm:
94
+ title: "Pump Fan RPM"
95
+ interval: 1
96
+ command: |
97
+ sensors -j | jq '."nct6799-isa-0290".fan7.fan7_input'
98
+ format_value: as_default
99
+ color: '#689d6a'
100
+
101
+ pump_fan_percentage:
102
+ title: "Pump Fan %"
103
+ interval: 1
104
+ command: |
105
+ sensors -j | jq '."nct6799-isa-0290".pwm7.pwm7'
106
+ format_value: as_percent
35
107
  color: '#689d6a'
108
+
109
+ # GPU Monitoring
110
+ #
111
+ # These panels monitor AMD GPU performance metrics on Linux systems.
112
+ # Requires 'sensors' with AMDGPU support and 'jq' for JSON parsing.
113
+ # Note: GPU monitoring requires proper hardware support and driver installation.
114
+
115
+ # GPU Fans (Magenta group)
116
+ gpu_fan_rpm:
117
+ title: "GPU Fan RPM"
118
+ interval: 1
119
+ command: |
120
+ sensors -j | jq '."amdgpu-pci-0300".fan1.fan1_input'
121
+ format_value: as_default
122
+ color: '#b16286'
123
+
124
+ # GPU Clock Speed Monitoring
125
+ gpu_shaders_clock:
126
+ title: "GPU SCLK Hz"
127
+ interval: 1
128
+ command: |
129
+ sensors -j | jq '."amdgpu-pci-0300".sclk.freq1_input'
130
+ format_value: as_hertz
131
+ color: '#8ec0fc'
132
+
133
+ gpu_memory_clock:
134
+ title: "GPU MCLK Hz"
135
+ interval: 1
136
+ command: |
137
+ sensors -j | jq '."amdgpu-pci-0300".mclk.freq2_input'
138
+ format_value: as_hertz
139
+ color: '#8ef07c'
140
+
141
+ # GPU Temperatures
142
+ #
143
+ # These panels monitor various temperature sensors on AMD GPU hardware.
144
+ #
145
+ # The different temperature readings provide insight into GPU thermal
146
+ # performance:
147
+ # - Edge temperature: Core edge temperature sensor
148
+ # - Junction temperature: GPU junction temperature (typically highest)
149
+ # - Memory temperature: GPU memory bank temperature
150
+ #
151
+ # Note: GPU temperature monitoring requires proper AMDGPU driver support and
152
+ # 'sensors' configuration.
153
+ gpu_edge_temperature:
154
+ title: "GPU Edge Temperature ℃ "
155
+ interval: 1
156
+ command: |
157
+ sensors -j | jq '."amdgpu-pci-0300".edge.temp1_input'
158
+ format_value: as_celsius
159
+ color: '#b16286'
160
+
161
+ gpu_junction_temperature:
162
+ title: "GPU Junction Temperature ℃ "
163
+ interval: 1
164
+ command: |
165
+ sensors -j | jq '."amdgpu-pci-0300".junction.temp2_input'
166
+ format_value: as_celsius
167
+ color: '#b16286'
168
+
169
+ gpu_memory_temperature:
170
+ title: "GPU Memory Temperature ℃ "
171
+ interval: 1
172
+ command: |
173
+ sensors -j | jq '."amdgpu-pci-0300".mem.temp3_input'
174
+ format_value: as_celsius
175
+ color: '#b16286'
@@ -88,6 +88,10 @@ class Graphina::Panel
88
88
  end
89
89
  end
90
90
 
91
+ # The title accessor method provides read and write access to the title
92
+ # attribute
93
+ #
94
+ # @attr [ String ] title the title to display at the bottom of the graph
91
95
  attr_accessor :title
92
96
 
93
97
  # The interval reader method provides access to the interval attribute that
@@ -1,6 +1,11 @@
1
+ # Version information for the Graphina gem.
2
+ #
3
+ # This module is auto-generated by GemHadar and exposes the
4
+ # current release version as a set of constants. Do not edit it
5
+ # by hand; it is rewritten on every `rake version` invocation.
1
6
  module Graphina
2
- # Graphina version
3
- VERSION = '0.4.1'
7
+ # The current version of the Graphina gem as a String.
8
+ VERSION = '0.6.0'
4
9
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
10
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
11
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -13,16 +13,16 @@ dependencies:
13
13
  name: gem_hadar
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '2.10'
18
+ version: 2.24.1
19
19
  type: :development
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - "~>"
23
+ - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '2.10'
25
+ version: 2.24.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,7 @@ extra_rdoc_files:
136
136
  - lib/graphina/version.rb
137
137
  files:
138
138
  - ".utilsrc"
139
+ - CHANGES.md
139
140
  - Gemfile
140
141
  - LICENSE
141
142
  - README.md
@@ -181,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
182
  - !ruby/object:Gem::Version
182
183
  version: '0'
183
184
  requirements: []
184
- rubygems_version: 4.0.2
185
+ rubygems_version: 4.0.24
185
186
  specification_version: 4
186
187
  summary: Gem for creating terminal-based data visualizations with real-time graphical
187
188
  displays using Unicode characters and ANSI styling.