macpm 0.13__tar.gz → 0.14__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: macpm
3
- Version: 0.13
3
+ Version: 0.14
4
4
  Summary: Performance monitoring CLI tool for Apple Silicon
5
5
  Home-page: https://github.com/visualcjy/macpm
6
6
  Author: Jinyu Chen
@@ -1,6 +1,7 @@
1
1
  import argparse
2
2
  import humanize
3
3
  from collections import deque
4
+ from blessed import Terminal
4
5
  from dashing import VSplit, HSplit, HGauge, HChart, VGauge, HBrailleChart, HBrailleFilledChart
5
6
  import os, time
6
7
  import subprocess
@@ -8,8 +9,9 @@ from subprocess import PIPE
8
9
  import psutil
9
10
  import plistlib
10
11
 
12
+ version = 'macpm v0.14'
11
13
  parser = argparse.ArgumentParser(
12
- description='macpm v0.13: Performance monitoring CLI tool for Apple Silicon')
14
+ description=f'{version}: Performance monitoring CLI tool for Apple Silicon')
13
15
  parser.add_argument('--interval', type=int, default=1,
14
16
  help='Display interval and sampling interval for powermetrics (seconds)')
15
17
  parser.add_argument('--color', type=int, default=2,
@@ -412,16 +414,16 @@ def main():
412
414
  )
413
415
 
414
416
  disk_read_iops_charts = HChart(title="read iops", color=args.color)
415
- disk_write_iops_charts = HBrailleFilledChart(title="write iops", color=args.color)
417
+ disk_write_iops_charts = HChart(title="write iops", color=args.color)
416
418
  disk_read_bps_charts = HChart(title="read Bps", color=args.color)
417
- disk_write_bps_charts = HBrailleFilledChart(title="write Bps", color=args.color)
419
+ disk_write_bps_charts = HChart(title="write Bps", color=args.color)
418
420
  network_in_bps_charts = HChart(title="in Bps", color=args.color)
419
- network_out_bps_charts = HBrailleFilledChart(title="out Bps", color=args.color)
421
+ network_out_bps_charts = HChart(title="out Bps", color=args.color)
420
422
  disk_io_charts = HSplit(
421
- disk_read_iops_charts,
422
- disk_write_iops_charts,
423
- disk_read_bps_charts,
424
- disk_write_bps_charts,
423
+ VSplit(disk_read_iops_charts,
424
+ disk_write_iops_charts,),
425
+ VSplit(disk_read_bps_charts,
426
+ disk_write_bps_charts,),
425
427
  title="Disk IO",
426
428
  color=args.color,
427
429
  border_color=args.color)
@@ -448,7 +450,13 @@ def main():
448
450
  disk_io_charts,
449
451
  network_io_charts,
450
452
  )
451
-
453
+ """
454
+ ui.title = "".join([
455
+ version,
456
+ " (Press q or ESC to stop)"
457
+ ])
458
+ ui.border_color = args.color
459
+ """
452
460
  usage_gauges = ui.items[0]
453
461
  #bw_gauges = memory_gauges.items[1]
454
462
 
@@ -482,11 +490,6 @@ def main():
482
490
 
483
491
  print("\n[2/3] Starting powermetrics process\n")
484
492
 
485
- timecode = str(int(time.time()))
486
-
487
- #powermetrics_process = run_powermetrics_process(timecode,
488
- # interval=args.interval * 1000)
489
-
490
493
  command = " ".join([
491
494
  "sudo nice -n",
492
495
  str(10),
@@ -521,7 +524,7 @@ def main():
521
524
  avg_gpu_power_list = deque([], maxlen=int(args.avg / args.interval))
522
525
 
523
526
  clear_console()
524
-
527
+ term = Terminal()
525
528
  try:
526
529
  data = b''
527
530
  while True:
@@ -838,6 +841,18 @@ def main():
838
841
  network_out_bps_charts.append(network_out_bps_rate)
839
842
 
840
843
  ui.display()
844
+ key_cmd = ''
845
+ with term.cbreak():
846
+ key = term.inkey(timeout=1)
847
+ if key:
848
+ if key.is_sequence:
849
+ if key.name == 'KEY_ESCAPE':
850
+ key_cmd = "quit"
851
+ elif key.lower() == 'q':
852
+ key_cmd = "quit"
853
+ if key_cmd == "quit":
854
+ print("\nStopping...")
855
+ break
841
856
 
842
857
  if str_output == '':
843
858
  time.sleep(0.1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: macpm
3
- Version: 0.13
3
+ Version: 0.14
4
4
  Summary: Performance monitoring CLI tool for Apple Silicon
5
5
  Home-page: https://github.com/visualcjy/macpm
6
6
  Author: Jinyu Chen
@@ -4,7 +4,7 @@ long_description = 'Performance monitoring CLI tool for Apple Silicon'
4
4
 
5
5
  setup(
6
6
  name='macpm',
7
- version='0.13',
7
+ version='0.14',
8
8
  author='Jinyu Chen',
9
9
  author_email='visualcjy@mail.com',
10
10
  url='https://github.com/visualcjy/macpm',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes