diff --git a/NEWS b/NEWS index baefadd458cca30c99b4adbb6063364636e56223..f3140848622390a2d8e0d7efaf035d0be3511b92 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,8 @@ Version 2.x Enhancements and new features: - * [WebUI] add "pointer" cursor for sortable columns (issue #704 from @notFloran) + * Add process summary min/max stats (issue #703) + * [WebUI] add "pointer" cursor for sortable columns (issue #704 from @notFloran) Version 2.5.1 ============= diff --git a/docs/glances-doc.rst b/docs/glances-doc.rst index b826cee054cb62d9958138bdf4a954a7552847a2..1f1ecb5552ab754b884451ff7f0b441a226220b4 100644 --- a/docs/glances-doc.rst +++ b/docs/glances-doc.rst @@ -258,6 +258,8 @@ The following commands (key pressed) are supported while in Glances: Show/hide log messages ``m`` Sort processes by MEM usage +``M`` + Reset processes summary min/max ``n`` Show/hide network stats ``p`` @@ -266,6 +268,8 @@ The following commands (key pressed) are supported while in Glances: Quit the current Glances session ``r`` Reset history +``R`` + Show/Hide RAID plugins ``s`` Show/hide sensors stats ``t`` diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py index 9d998518c4632dfb77944c6d7d38d99cb5d7c779..483d1241bd2ba1e502541caa98ef98dc89dec7bb 100644 --- a/glances/outputs/glances_curses.py +++ b/glances/outputs/glances_curses.py @@ -85,6 +85,9 @@ class _GlancesCurses(object): # Init edit filter tag self.edit_filter = False + # Init the process min/max reset + self.args.reset_minmax_tag = False + # Catch key pressed with non blocking mode self.no_flash_cursor() self.term_window.nodelay(1) @@ -350,6 +353,9 @@ class _GlancesCurses(object): # 'm' > Sort processes by MEM usage glances_processes.auto_sort = False glances_processes.sort_key = 'memory_percent' + elif self.pressedkey == ord('M'): + # 'M' > Reset processes summary min/max + self.args.reset_minmax_tag = not self.args.reset_minmax_tag elif self.pressedkey == ord('n'): # 'n' > Show/hide network stats self.args.disable_network = not self.args.disable_network diff --git a/glances/plugins/glances_processlist.py b/glances/plugins/glances_processlist.py index e2ed9afbb405af47011a94862c29a1ebd790c326..b8717630a215c3b095f5e3543bcaac3abb19f842 100644 --- a/glances/plugins/glances_processlist.py +++ b/glances/plugins/glances_processlist.py @@ -421,6 +421,9 @@ class Plugin(GlancesPlugin): # End of extended stats first = False if glances_processes.process_filter is not None: + if args.reset_minmax_tag: + args.reset_minmax_tag = not args.reset_minmax_tag + self.__mmm_reset() self.__msg_curse_sum(ret, args=args) self.__msg_curse_sum(ret, mmm='min', args=args) self.__msg_curse_sum(ret, mmm='max', args=args) @@ -540,10 +543,12 @@ class Plugin(GlancesPlugin): ret.append(self.curse_add_line(msg, optional=True, additional=True)) ret.append(self.curse_add_line(msg, optional=True, additional=True)) if mmm is None: - msg = ' < {0:8}'.format('current') + msg = ' < {0}'.format('current') ret.append(self.curse_add_line(msg, optional=True)) else: - msg = ' < {0:8}'.format(mmm) + msg = ' < {0}'.format(mmm) + ret.append(self.curse_add_line(msg, optional=True)) + msg = ' (\'M\' to reset)' ret.append(self.curse_add_line(msg, optional=True)) def __mmm_deco(self, mmm): @@ -555,6 +560,13 @@ class Plugin(GlancesPlugin): else: return 'FILTER' + def __mmm_reset(self): + """ + Reset the MMM stats + """ + self.mmm_min = {} + self.mmm_max = {} + def __sum_stats(self, key, indice=None, mmm=None): """ Return the sum of the stats value for the given key diff --git a/man/glances.1 b/man/glances.1 index eeeab5fb0efd6023200d3adaa1eaf01d3a7beafd..5cbb4243c48912602da3f066944b1e57a7cfb16d 100644 --- a/man/glances.1 +++ b/man/glances.1 @@ -228,6 +228,9 @@ Show/hide log messages .B m Sort processes by MEM usage .TP +.B M +Reset processes summary min/max +.TP .B n Show/hide network stats .TP @@ -240,6 +243,9 @@ Quit .B r Reset history .TP +.B R +Disable/enable RAID plugins +.TP .B s Show/hide sensors stats .TP