repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
nicolargo/glances
glances/plugins/glances_system.py
Plugin.update
def update(self): """Update the host/system info using the input method. Return the stats (dict) """ # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib stats['os_name'] = p...
python
def update(self): """Update the host/system info using the input method. Return the stats (dict) """ # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib stats['os_name'] = p...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "if", "self", ".", "input_method", "==", "'local'", ":", "# Update stats using the standard system lib", "stats", "[", "'os_name'", "]", "=", "plat...
Update the host/system info using the input method. Return the stats (dict)
[ "Update", "the", "host", "/", "system", "info", "using", "the", "input", "method", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_system.py#L95-L162
train
Update the host system info using the input method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_system.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the string to display in the curse interface.""" # Init the return message ret = [] # Build the string message if args.client: # Client mode if args.cs_status.lower() == "connected": ...
python
def msg_curse(self, args=None, max_width=None): """Return the string to display in the curse interface.""" # Init the return message ret = [] # Build the string message if args.client: # Client mode if args.cs_status.lower() == "connected": ...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "ret", "=", "[", "]", "# Build the string message", "if", "args", ".", "client", ":", "# Client mode", "if", "args", ".", "cs_sta...
Return the string to display in the curse interface.
[ "Return", "the", "string", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_system.py#L164-L201
train
Return the string to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_memswap.py
Plugin.update
def update(self): """Update swap memory stats using the input method.""" # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib # Grab SWAP using the psutil swap_memory method sm_st...
python
def update(self): """Update swap memory stats using the input method.""" # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib # Grab SWAP using the psutil swap_memory method sm_st...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "if", "self", ".", "input_method", "==", "'local'", ":", "# Update stats using the standard system lib", "# Grab SWAP using the psutil swap_memory method", ...
Update swap memory stats using the input method.
[ "Update", "swap", "memory", "stats", "using", "the", "input", "method", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_memswap.py#L60-L128
train
Update swap memory stats using the input method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_memswap.py
Plugin.update_views
def update_views(self): """Update stats views.""" # Call the father's method super(Plugin, self).update_views() # Add specifics informations # Alert and log self.views['used']['decoration'] = self.get_alert_log(self.stats['used'], maximum=self.stats['total'])
python
def update_views(self): """Update stats views.""" # Call the father's method super(Plugin, self).update_views() # Add specifics informations # Alert and log self.views['used']['decoration'] = self.get_alert_log(self.stats['used'], maximum=self.stats['total'])
[ "def", "update_views", "(", "self", ")", ":", "# Call the father's method", "super", "(", "Plugin", ",", "self", ")", ".", "update_views", "(", ")", "# Add specifics informations", "# Alert and log", "self", ".", "views", "[", "'used'", "]", "[", "'decoration'", ...
Update stats views.
[ "Update", "stats", "views", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_memswap.py#L130-L137
train
Update stats views.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_memswap.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and plugin not disabled if not self.stats or self.is_disable(): return ret # Build the s...
python
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and plugin not disabled if not self.stats or self.is_disable(): return ret # Build the s...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "ret", "=", "[", "]", "# Only process if stats exist and plugin not disabled", "if", "not", "self", ".", "stats", "or", "self", ".", ...
Return the dict to display in the curse interface.
[ "Return", "the", "dict", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_memswap.py#L139-L180
train
Return the dict to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_amps.py
Plugin.update
def update(self): """Update the AMP list.""" # Init new stats stats = self.get_init_value() if self.input_method == 'local': for k, v in iteritems(self.glances_amps.update()): stats.append({'key': k, 'name': v.NAME, ...
python
def update(self): """Update the AMP list.""" # Init new stats stats = self.get_init_value() if self.input_method == 'local': for k, v in iteritems(self.glances_amps.update()): stats.append({'key': k, 'name': v.NAME, ...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "if", "self", ".", "input_method", "==", "'local'", ":", "for", "k", ",", "v", "in", "iteritems", "(", "self", ".", "glances_amps", ".", ...
Update the AMP list.
[ "Update", "the", "AMP", "list", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_amps.py#L45-L67
train
Update the AMP list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_amps.py
Plugin.get_alert
def get_alert(self, nbprocess=0, countmin=None, countmax=None, header="", log=False): """Return the alert status relative to the process number.""" if nbprocess is None: return 'OK' if countmin is None: countmin = nbprocess if countmax is None: countma...
python
def get_alert(self, nbprocess=0, countmin=None, countmax=None, header="", log=False): """Return the alert status relative to the process number.""" if nbprocess is None: return 'OK' if countmin is None: countmin = nbprocess if countmax is None: countma...
[ "def", "get_alert", "(", "self", ",", "nbprocess", "=", "0", ",", "countmin", "=", "None", ",", "countmax", "=", "None", ",", "header", "=", "\"\"", ",", "log", "=", "False", ")", ":", "if", "nbprocess", "is", "None", ":", "return", "'OK'", "if", "...
Return the alert status relative to the process number.
[ "Return", "the", "alert", "status", "relative", "to", "the", "process", "number", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_amps.py#L69-L86
train
Return the alert status relative to the process number.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_amps.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message # Only process if stats exist and display plugin enable... ret = [] if not self.stats or args.disable_process or self.is_disable(): retu...
python
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message # Only process if stats exist and display plugin enable... ret = [] if not self.stats or args.disable_process or self.is_disable(): retu...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "# Only process if stats exist and display plugin enable...", "ret", "=", "[", "]", "if", "not", "self", ".", "stats", "or", "args", ...
Return the dict to display in the curse interface.
[ "Return", "the", "dict", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_amps.py#L88-L125
train
Return the dict to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_percpu.py
Plugin.update
def update(self): """Update per-CPU stats using the input method.""" # Init new stats stats = self.get_init_value() # Grab per-CPU stats using psutil's cpu_percent(percpu=True) and # cpu_times_percent(percpu=True) methods if self.input_method == 'local': stat...
python
def update(self): """Update per-CPU stats using the input method.""" # Init new stats stats = self.get_init_value() # Grab per-CPU stats using psutil's cpu_percent(percpu=True) and # cpu_times_percent(percpu=True) methods if self.input_method == 'local': stat...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "# Grab per-CPU stats using psutil's cpu_percent(percpu=True) and", "# cpu_times_percent(percpu=True) methods", "if", "self", ".", "input_method", "==", "'loca...
Update per-CPU stats using the input method.
[ "Update", "per", "-", "CPU", "stats", "using", "the", "input", "method", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_percpu.py#L57-L73
train
Update the stats for the current CPU and the per - CPU times.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_percpu.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist... if not self.stats or not self.args.percpu or self.is_disable(): return ret # Build th...
python
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist... if not self.stats or not self.args.percpu or self.is_disable(): return ret # Build th...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "ret", "=", "[", "]", "# Only process if stats exist...", "if", "not", "self", ".", "stats", "or", "not", "self", ".", "args", ...
Return the dict to display in the curse interface.
[ "Return", "the", "dict", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_percpu.py#L75-L117
train
Return the dict to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
Plugin.exit
def exit(self): """Overwrite the exit method to close threads.""" if self._thread is not None: self._thread.stop() # Call the father class super(Plugin, self).exit()
python
def exit(self): """Overwrite the exit method to close threads.""" if self._thread is not None: self._thread.stop() # Call the father class super(Plugin, self).exit()
[ "def", "exit", "(", "self", ")", ":", "if", "self", ".", "_thread", "is", "not", "None", ":", "self", ".", "_thread", ".", "stop", "(", ")", "# Call the father class", "super", "(", "Plugin", ",", "self", ")", ".", "exit", "(", ")" ]
Overwrite the exit method to close threads.
[ "Overwrite", "the", "exit", "method", "to", "close", "threads", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L67-L72
train
Overwrite the exit method to close threads.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
Plugin.update
def update(self): """Update the ports list.""" if self.input_method == 'local': # Only refresh: # * if there is not other scanning thread # * every refresh seconds (define in the configuration file) if self._thread is None: thread_is_runnin...
python
def update(self): """Update the ports list.""" if self.input_method == 'local': # Only refresh: # * if there is not other scanning thread # * every refresh seconds (define in the configuration file) if self._thread is None: thread_is_runnin...
[ "def", "update", "(", "self", ")", ":", "if", "self", ".", "input_method", "==", "'local'", ":", "# Only refresh:", "# * if there is not other scanning thread", "# * every refresh seconds (define in the configuration file)", "if", "self", ".", "_thread", "is", "None", ":"...
Update the ports list.
[ "Update", "the", "ports", "list", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L75-L98
train
Update the ports list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
Plugin.get_ports_alert
def get_ports_alert(self, port, header="", log=False): """Return the alert status relative to the port scan return value.""" ret = 'OK' if port['status'] is None: ret = 'CAREFUL' elif port['status'] == 0: ret = 'CRITICAL' elif (isinstance(port['status'], (...
python
def get_ports_alert(self, port, header="", log=False): """Return the alert status relative to the port scan return value.""" ret = 'OK' if port['status'] is None: ret = 'CAREFUL' elif port['status'] == 0: ret = 'CRITICAL' elif (isinstance(port['status'], (...
[ "def", "get_ports_alert", "(", "self", ",", "port", ",", "header", "=", "\"\"", ",", "log", "=", "False", ")", ":", "ret", "=", "'OK'", "if", "port", "[", "'status'", "]", "is", "None", ":", "ret", "=", "'CAREFUL'", "elif", "port", "[", "'status'", ...
Return the alert status relative to the port scan return value.
[ "Return", "the", "alert", "status", "relative", "to", "the", "port", "scan", "return", "value", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L104-L128
train
Return the alert status relative to the port scan return value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
Plugin.get_web_alert
def get_web_alert(self, web, header="", log=False): """Return the alert status relative to the web/url scan return value.""" ret = 'OK' if web['status'] is None: ret = 'CAREFUL' elif web['status'] not in [200, 301, 302]: ret = 'CRITICAL' elif web['rtt_warn...
python
def get_web_alert(self, web, header="", log=False): """Return the alert status relative to the web/url scan return value.""" ret = 'OK' if web['status'] is None: ret = 'CAREFUL' elif web['status'] not in [200, 301, 302]: ret = 'CRITICAL' elif web['rtt_warn...
[ "def", "get_web_alert", "(", "self", ",", "web", ",", "header", "=", "\"\"", ",", "log", "=", "False", ")", ":", "ret", "=", "'OK'", "if", "web", "[", "'status'", "]", "is", "None", ":", "ret", "=", "'CAREFUL'", "elif", "web", "[", "'status'", "]",...
Return the alert status relative to the web/url scan return value.
[ "Return", "the", "alert", "status", "relative", "to", "the", "web", "/", "url", "scan", "return", "value", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L130-L152
train
Return the alert status relative to the web scan return value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message # Only process if stats exist and display plugin enable... ret = [] if not self.stats or args.disable_ports: return ret # Max s...
python
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message # Only process if stats exist and display plugin enable... ret = [] if not self.stats or args.disable_ports: return ret # Max s...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "# Only process if stats exist and display plugin enable...", "ret", "=", "[", "]", "if", "not", "self", ".", "stats", "or", "args", ...
Return the dict to display in the curse interface.
[ "Return", "the", "dict", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L154-L211
train
Return the dict to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
ThreadScanner.run
def run(self): """Grab the stats. Infinite loop, should be stopped by calling the stop() method. """ for p in self._stats: # End of the thread has been asked if self.stopped(): break # Scan a port (ICMP or TCP) if 'port' in...
python
def run(self): """Grab the stats. Infinite loop, should be stopped by calling the stop() method. """ for p in self._stats: # End of the thread has been asked if self.stopped(): break # Scan a port (ICMP or TCP) if 'port' in...
[ "def", "run", "(", "self", ")", ":", "for", "p", "in", "self", ".", "_stats", ":", "# End of the thread has been asked", "if", "self", ".", "stopped", "(", ")", ":", "break", "# Scan a port (ICMP or TCP)", "if", "'port'", "in", "p", ":", "self", ".", "_por...
Grab the stats. Infinite loop, should be stopped by calling the stop() method.
[ "Grab", "the", "stats", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L232-L249
train
Run the main loop of the main loop.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
ThreadScanner.stop
def stop(self, timeout=None): """Stop the thread.""" logger.debug("ports plugin - Close thread for scan list {}".format(self._stats)) self._stopper.set()
python
def stop(self, timeout=None): """Stop the thread.""" logger.debug("ports plugin - Close thread for scan list {}".format(self._stats)) self._stopper.set()
[ "def", "stop", "(", "self", ",", "timeout", "=", "None", ")", ":", "logger", ".", "debug", "(", "\"ports plugin - Close thread for scan list {}\"", ".", "format", "(", "self", ".", "_stats", ")", ")", "self", ".", "_stopper", ".", "set", "(", ")" ]
Stop the thread.
[ "Stop", "the", "thread", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L261-L264
train
Stop the thread.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
ThreadScanner._web_scan
def _web_scan(self, web): """Scan the Web/URL (dict) and update the status key.""" try: req = requests.head(web['url'], allow_redirects=True, verify=web['ssl_verify'], proxies=web['proxies'], ...
python
def _web_scan(self, web): """Scan the Web/URL (dict) and update the status key.""" try: req = requests.head(web['url'], allow_redirects=True, verify=web['ssl_verify'], proxies=web['proxies'], ...
[ "def", "_web_scan", "(", "self", ",", "web", ")", ":", "try", ":", "req", "=", "requests", ".", "head", "(", "web", "[", "'url'", "]", ",", "allow_redirects", "=", "True", ",", "verify", "=", "web", "[", "'ssl_verify'", "]", ",", "proxies", "=", "w...
Scan the Web/URL (dict) and update the status key.
[ "Scan", "the", "Web", "/", "URL", "(", "dict", ")", "and", "update", "the", "status", "key", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L270-L285
train
Scan the Web URL and update the status key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
ThreadScanner._port_scan
def _port_scan(self, port): """Scan the port structure (dict) and update the status key.""" if int(port['port']) == 0: return self._port_scan_icmp(port) else: return self._port_scan_tcp(port)
python
def _port_scan(self, port): """Scan the port structure (dict) and update the status key.""" if int(port['port']) == 0: return self._port_scan_icmp(port) else: return self._port_scan_tcp(port)
[ "def", "_port_scan", "(", "self", ",", "port", ")", ":", "if", "int", "(", "port", "[", "'port'", "]", ")", "==", "0", ":", "return", "self", ".", "_port_scan_icmp", "(", "port", ")", "else", ":", "return", "self", ".", "_port_scan_tcp", "(", "port",...
Scan the port structure (dict) and update the status key.
[ "Scan", "the", "port", "structure", "(", "dict", ")", "and", "update", "the", "status", "key", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L287-L292
train
Scan the port structure and update the status key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
ThreadScanner._resolv_name
def _resolv_name(self, hostname): """Convert hostname to IP address.""" ip = hostname try: ip = socket.gethostbyname(hostname) except Exception as e: logger.debug("{}: Cannot convert {} to IP address ({})".format(self.plugin_name, hostname, e)) return ip
python
def _resolv_name(self, hostname): """Convert hostname to IP address.""" ip = hostname try: ip = socket.gethostbyname(hostname) except Exception as e: logger.debug("{}: Cannot convert {} to IP address ({})".format(self.plugin_name, hostname, e)) return ip
[ "def", "_resolv_name", "(", "self", ",", "hostname", ")", ":", "ip", "=", "hostname", "try", ":", "ip", "=", "socket", ".", "gethostbyname", "(", "hostname", ")", "except", "Exception", "as", "e", ":", "logger", ".", "debug", "(", "\"{}: Cannot convert {} ...
Convert hostname to IP address.
[ "Convert", "hostname", "to", "IP", "address", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L294-L301
train
Convert hostname to IP address.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
ThreadScanner._port_scan_icmp
def _port_scan_icmp(self, port): """Scan the (ICMP) port structure (dict) and update the status key.""" ret = None # Create the ping command # Use the system ping command because it already have the steacky bit set # Python can not create ICMP packet with non root right ...
python
def _port_scan_icmp(self, port): """Scan the (ICMP) port structure (dict) and update the status key.""" ret = None # Create the ping command # Use the system ping command because it already have the steacky bit set # Python can not create ICMP packet with non root right ...
[ "def", "_port_scan_icmp", "(", "self", ",", "port", ")", ":", "ret", "=", "None", "# Create the ping command", "# Use the system ping command because it already have the steacky bit set", "# Python can not create ICMP packet with non root right", "if", "WINDOWS", ":", "timeout_opt"...
Scan the (ICMP) port structure (dict) and update the status key.
[ "Scan", "the", "(", "ICMP", ")", "port", "structure", "(", "dict", ")", "and", "update", "the", "status", "key", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L303-L341
train
Scan the ICMP port structure and update the status key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ports.py
ThreadScanner._port_scan_tcp
def _port_scan_tcp(self, port): """Scan the (TCP) port structure (dict) and update the status key.""" ret = None # Create and configure the scanning socket try: socket.setdefaulttimeout(port['timeout']) _socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ...
python
def _port_scan_tcp(self, port): """Scan the (TCP) port structure (dict) and update the status key.""" ret = None # Create and configure the scanning socket try: socket.setdefaulttimeout(port['timeout']) _socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ...
[ "def", "_port_scan_tcp", "(", "self", ",", "port", ")", ":", "ret", "=", "None", "# Create and configure the scanning socket", "try", ":", "socket", ".", "setdefaulttimeout", "(", "port", "[", "'timeout'", "]", ")", "_socket", "=", "socket", ".", "socket", "("...
Scan the (TCP) port structure (dict) and update the status key.
[ "Scan", "the", "(", "TCP", ")", "port", "structure", "(", "dict", ")", "and", "update", "the", "status", "key", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ports.py#L343-L369
train
Scan the TCP port structure and update the status key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.load_modules
def load_modules(self, args): """Wrapper to load: plugins and export modules.""" # Init the plugins dict # Active plugins dictionnary self._plugins = collections.defaultdict(dict) # Load the plugins self.load_plugins(args=args) # Init the export modules dict ...
python
def load_modules(self, args): """Wrapper to load: plugins and export modules.""" # Init the plugins dict # Active plugins dictionnary self._plugins = collections.defaultdict(dict) # Load the plugins self.load_plugins(args=args) # Init the export modules dict ...
[ "def", "load_modules", "(", "self", ",", "args", ")", ":", "# Init the plugins dict", "# Active plugins dictionnary", "self", ".", "_plugins", "=", "collections", ".", "defaultdict", "(", "dict", ")", "# Load the plugins", "self", ".", "load_plugins", "(", "args", ...
Wrapper to load: plugins and export modules.
[ "Wrapper", "to", "load", ":", "plugins", "and", "export", "modules", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L86-L104
train
Wrapper to load plugins and export modules.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats._load_plugin
def _load_plugin(self, plugin_script, args=None, config=None): """Load the plugin (script), init it and add to the _plugin dict.""" # The key is the plugin name # for example, the file glances_xxx.py # generate self._plugins_list["xxx"] = ... name = plugin_script[len(self.header)...
python
def _load_plugin(self, plugin_script, args=None, config=None): """Load the plugin (script), init it and add to the _plugin dict.""" # The key is the plugin name # for example, the file glances_xxx.py # generate self._plugins_list["xxx"] = ... name = plugin_script[len(self.header)...
[ "def", "_load_plugin", "(", "self", ",", "plugin_script", ",", "args", "=", "None", ",", "config", "=", "None", ")", ":", "# The key is the plugin name", "# for example, the file glances_xxx.py", "# generate self._plugins_list[\"xxx\"] = ...", "name", "=", "plugin_script", ...
Load the plugin (script), init it and add to the _plugin dict.
[ "Load", "the", "plugin", "(", "script", ")", "init", "it", "and", "add", "to", "the", "_plugin", "dict", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L106-L129
train
Load the plugin script and add it to the _plugin dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.load_plugins
def load_plugins(self, args=None): """Load all plugins in the 'plugins' folder.""" for item in os.listdir(plugins_path): if (item.startswith(self.header) and item.endswith(".py") and item != (self.header + "plugin.py")): # Load the plug...
python
def load_plugins(self, args=None): """Load all plugins in the 'plugins' folder.""" for item in os.listdir(plugins_path): if (item.startswith(self.header) and item.endswith(".py") and item != (self.header + "plugin.py")): # Load the plug...
[ "def", "load_plugins", "(", "self", ",", "args", "=", "None", ")", ":", "for", "item", "in", "os", ".", "listdir", "(", "plugins_path", ")", ":", "if", "(", "item", ".", "startswith", "(", "self", ".", "header", ")", "and", "item", ".", "endswith", ...
Load all plugins in the 'plugins' folder.
[ "Load", "all", "plugins", "in", "the", "plugins", "folder", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L131-L142
train
Load all plugins in the plugins folder.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.load_exports
def load_exports(self, args=None): """Load all export modules in the 'exports' folder.""" if args is None: return False header = "glances_" # Build the export module available list args_var = vars(locals()['args']) for item in os.listdir(exports_path): ...
python
def load_exports(self, args=None): """Load all export modules in the 'exports' folder.""" if args is None: return False header = "glances_" # Build the export module available list args_var = vars(locals()['args']) for item in os.listdir(exports_path): ...
[ "def", "load_exports", "(", "self", ",", "args", "=", "None", ")", ":", "if", "args", "is", "None", ":", "return", "False", "header", "=", "\"glances_\"", "# Build the export module available list", "args_var", "=", "vars", "(", "locals", "(", ")", "[", "'ar...
Load all export modules in the 'exports' folder.
[ "Load", "all", "export", "modules", "in", "the", "exports", "folder", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L144-L178
train
Load all export modules in the exports folder.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.getPluginsList
def getPluginsList(self, enable=True): """Return the plugins list. if enable is True, only return the active plugins (default) if enable is False, return all the plugins Return: list of plugin name """ if enable: return [p for p in self._plugins if self._plu...
python
def getPluginsList(self, enable=True): """Return the plugins list. if enable is True, only return the active plugins (default) if enable is False, return all the plugins Return: list of plugin name """ if enable: return [p for p in self._plugins if self._plu...
[ "def", "getPluginsList", "(", "self", ",", "enable", "=", "True", ")", ":", "if", "enable", ":", "return", "[", "p", "for", "p", "in", "self", ".", "_plugins", "if", "self", ".", "_plugins", "[", "p", "]", ".", "is_enable", "(", ")", "]", "else", ...
Return the plugins list. if enable is True, only return the active plugins (default) if enable is False, return all the plugins Return: list of plugin name
[ "Return", "the", "plugins", "list", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L180-L191
train
Return the plugins list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.getExportsList
def getExportsList(self, enable=True): """Return the exports list. if enable is True, only return the active exporters (default) if enable is False, return all the exporters Return: list of export module name """ if enable: return [e for e in self._exports] ...
python
def getExportsList(self, enable=True): """Return the exports list. if enable is True, only return the active exporters (default) if enable is False, return all the exporters Return: list of export module name """ if enable: return [e for e in self._exports] ...
[ "def", "getExportsList", "(", "self", ",", "enable", "=", "True", ")", ":", "if", "enable", ":", "return", "[", "e", "for", "e", "in", "self", ".", "_exports", "]", "else", ":", "return", "[", "e", "for", "e", "in", "self", ".", "_exports_all", "]"...
Return the exports list. if enable is True, only return the active exporters (default) if enable is False, return all the exporters Return: list of export module name
[ "Return", "the", "exports", "list", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L193-L204
train
Return the exports list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.load_limits
def load_limits(self, config=None): """Load the stats limits (except the one in the exclude list).""" # For each plugins, call the load_limits method for p in self._plugins: self._plugins[p].load_limits(config)
python
def load_limits(self, config=None): """Load the stats limits (except the one in the exclude list).""" # For each plugins, call the load_limits method for p in self._plugins: self._plugins[p].load_limits(config)
[ "def", "load_limits", "(", "self", ",", "config", "=", "None", ")", ":", "# For each plugins, call the load_limits method", "for", "p", "in", "self", ".", "_plugins", ":", "self", ".", "_plugins", "[", "p", "]", ".", "load_limits", "(", "config", ")" ]
Load the stats limits (except the one in the exclude list).
[ "Load", "the", "stats", "limits", "(", "except", "the", "one", "in", "the", "exclude", "list", ")", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L206-L210
train
Load the stats limits except the one in the exclude list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.update
def update(self): """Wrapper method to update the stats.""" # For standalone and server modes # For each plugins, call the update method for p in self._plugins: if self._plugins[p].is_disable(): # If current plugin is disable # then continue to...
python
def update(self): """Wrapper method to update the stats.""" # For standalone and server modes # For each plugins, call the update method for p in self._plugins: if self._plugins[p].is_disable(): # If current plugin is disable # then continue to...
[ "def", "update", "(", "self", ")", ":", "# For standalone and server modes", "# For each plugins, call the update method", "for", "p", "in", "self", ".", "_plugins", ":", "if", "self", ".", "_plugins", "[", "p", "]", ".", "is_disable", "(", ")", ":", "# If curre...
Wrapper method to update the stats.
[ "Wrapper", "method", "to", "update", "the", "stats", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L212-L226
train
Wrapper method to update the stats.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.export
def export(self, input_stats=None): """Export all the stats. Each export module is ran in a dedicated thread. """ # threads = [] input_stats = input_stats or {} for e in self._exports: logger.debug("Export stats using the %s module" % e) thread =...
python
def export(self, input_stats=None): """Export all the stats. Each export module is ran in a dedicated thread. """ # threads = [] input_stats = input_stats or {} for e in self._exports: logger.debug("Export stats using the %s module" % e) thread =...
[ "def", "export", "(", "self", ",", "input_stats", "=", "None", ")", ":", "# threads = []", "input_stats", "=", "input_stats", "or", "{", "}", "for", "e", "in", "self", ".", "_exports", ":", "logger", ".", "debug", "(", "\"Export stats using the %s module\"", ...
Export all the stats. Each export module is ran in a dedicated thread.
[ "Export", "all", "the", "stats", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L228-L241
train
Export all the stats. Each export module is ran in a dedicated thread.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.getAllAsDict
def getAllAsDict(self): """Return all the stats (dict).""" return {p: self._plugins[p].get_raw() for p in self._plugins}
python
def getAllAsDict(self): """Return all the stats (dict).""" return {p: self._plugins[p].get_raw() for p in self._plugins}
[ "def", "getAllAsDict", "(", "self", ")", ":", "return", "{", "p", ":", "self", ".", "_plugins", "[", "p", "]", ".", "get_raw", "(", ")", "for", "p", "in", "self", ".", "_plugins", "}" ]
Return all the stats (dict).
[ "Return", "all", "the", "stats", "(", "dict", ")", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L247-L249
train
Return all the stats as a dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.getAllExports
def getAllExports(self, plugin_list=None): """ Return all the stats to be exported (list). Default behavor is to export all the stat if plugin_list is provided, only export stats of given plugin (list) """ if plugin_list is None: # All plugins should be export...
python
def getAllExports(self, plugin_list=None): """ Return all the stats to be exported (list). Default behavor is to export all the stat if plugin_list is provided, only export stats of given plugin (list) """ if plugin_list is None: # All plugins should be export...
[ "def", "getAllExports", "(", "self", ",", "plugin_list", "=", "None", ")", ":", "if", "plugin_list", "is", "None", ":", "# All plugins should be exported", "plugin_list", "=", "self", ".", "_plugins", "return", "[", "self", ".", "_plugins", "[", "p", "]", "....
Return all the stats to be exported (list). Default behavor is to export all the stat if plugin_list is provided, only export stats of given plugin (list)
[ "Return", "all", "the", "stats", "to", "be", "exported", "(", "list", ")", ".", "Default", "behavor", "is", "to", "export", "all", "the", "stat", "if", "plugin_list", "is", "provided", "only", "export", "stats", "of", "given", "plugin", "(", "list", ")" ...
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L251-L260
train
Get all the exported stats.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.getAllExportsAsDict
def getAllExportsAsDict(self, plugin_list=None): """ Return all the stats to be exported (list). Default behavor is to export all the stat if plugin_list is provided, only export stats of given plugin (list) """ if plugin_list is None: # All plugins should be ...
python
def getAllExportsAsDict(self, plugin_list=None): """ Return all the stats to be exported (list). Default behavor is to export all the stat if plugin_list is provided, only export stats of given plugin (list) """ if plugin_list is None: # All plugins should be ...
[ "def", "getAllExportsAsDict", "(", "self", ",", "plugin_list", "=", "None", ")", ":", "if", "plugin_list", "is", "None", ":", "# All plugins should be exported", "plugin_list", "=", "self", ".", "_plugins", "return", "{", "p", ":", "self", ".", "_plugins", "["...
Return all the stats to be exported (list). Default behavor is to export all the stat if plugin_list is provided, only export stats of given plugin (list)
[ "Return", "all", "the", "stats", "to", "be", "exported", "(", "list", ")", ".", "Default", "behavor", "is", "to", "export", "all", "the", "stat", "if", "plugin_list", "is", "provided", "only", "export", "stats", "of", "given", "plugin", "(", "list", ")" ...
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L262-L271
train
Returns all the stats to be exported as a dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.getAllLimitsAsDict
def getAllLimitsAsDict(self, plugin_list=None): """ Return all the stats limits (dict). Default behavor is to export all the limits if plugin_list is provided, only export limits of given plugin (list) """ if plugin_list is None: # All plugins should be export...
python
def getAllLimitsAsDict(self, plugin_list=None): """ Return all the stats limits (dict). Default behavor is to export all the limits if plugin_list is provided, only export limits of given plugin (list) """ if plugin_list is None: # All plugins should be export...
[ "def", "getAllLimitsAsDict", "(", "self", ",", "plugin_list", "=", "None", ")", ":", "if", "plugin_list", "is", "None", ":", "# All plugins should be exported", "plugin_list", "=", "self", ".", "_plugins", "return", "{", "p", ":", "self", ".", "_plugins", "[",...
Return all the stats limits (dict). Default behavor is to export all the limits if plugin_list is provided, only export limits of given plugin (list)
[ "Return", "all", "the", "stats", "limits", "(", "dict", ")", ".", "Default", "behavor", "is", "to", "export", "all", "the", "limits", "if", "plugin_list", "is", "provided", "only", "export", "limits", "of", "given", "plugin", "(", "list", ")" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L277-L286
train
Get all the limits for all the plugins in the list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.getAllViewsAsDict
def getAllViewsAsDict(self): """Return all the stats views (dict).""" return {p: self._plugins[p].get_views() for p in self._plugins}
python
def getAllViewsAsDict(self): """Return all the stats views (dict).""" return {p: self._plugins[p].get_views() for p in self._plugins}
[ "def", "getAllViewsAsDict", "(", "self", ")", ":", "return", "{", "p", ":", "self", ".", "_plugins", "[", "p", "]", ".", "get_views", "(", ")", "for", "p", "in", "self", ".", "_plugins", "}" ]
Return all the stats views (dict).
[ "Return", "all", "the", "stats", "views", "(", "dict", ")", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L292-L294
train
Return all the stats views as a dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/stats.py
GlancesStats.end
def end(self): """End of the Glances stats.""" # Close export modules for e in self._exports: self._exports[e].exit() # Close plugins for p in self._plugins: self._plugins[p].exit()
python
def end(self): """End of the Glances stats.""" # Close export modules for e in self._exports: self._exports[e].exit() # Close plugins for p in self._plugins: self._plugins[p].exit()
[ "def", "end", "(", "self", ")", ":", "# Close export modules", "for", "e", "in", "self", ".", "_exports", ":", "self", ".", "_exports", "[", "e", "]", ".", "exit", "(", ")", "# Close plugins", "for", "p", "in", "self", ".", "_plugins", ":", "self", "...
End of the Glances stats.
[ "End", "of", "the", "Glances", "stats", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/stats.py#L307-L314
train
End of the Glances stats.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_network.py
Plugin.update
def update(self): """Update network stats using the input method. Stats is a list of dict (one dict per interface) """ # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib #...
python
def update(self): """Update network stats using the input method. Stats is a list of dict (one dict per interface) """ # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib #...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "if", "self", ".", "input_method", "==", "'local'", ":", "# Update stats using the standard system lib", "# Grab network interface stat using the psutil net_...
Update network stats using the input method. Stats is a list of dict (one dict per interface)
[ "Update", "network", "stats", "using", "the", "input", "method", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_network.py#L69-L217
train
Update the stats of the network interface with the current stats.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_network.py
Plugin.update_views
def update_views(self): """Update stats views.""" # Call the father's method super(Plugin, self).update_views() # Add specifics informations # Alert for i in self.stats: ifrealname = i['interface_name'].split(':')[0] # Convert rate in bps ( to be ...
python
def update_views(self): """Update stats views.""" # Call the father's method super(Plugin, self).update_views() # Add specifics informations # Alert for i in self.stats: ifrealname = i['interface_name'].split(':')[0] # Convert rate in bps ( to be ...
[ "def", "update_views", "(", "self", ")", ":", "# Call the father's method", "super", "(", "Plugin", ",", "self", ")", ".", "update_views", "(", ")", "# Add specifics informations", "# Alert", "for", "i", "in", "self", ".", "stats", ":", "ifrealname", "=", "i",...
Update stats views.
[ "Update", "stats", "views", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_network.py#L219-L246
train
Update stats views.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_network.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and display plugin enable... if not self.stats or self.is_disable(): return ret # Max si...
python
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and display plugin enable... if not self.stats or self.is_disable(): return ret # Max si...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "ret", "=", "[", "]", "# Only process if stats exist and display plugin enable...", "if", "not", "self", ".", "stats", "or", "self", ...
Return the dict to display in the curse interface.
[ "Return", "the", "dict", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_network.py#L248-L336
train
Return the dict to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_elasticsearch.py
Export.init
def init(self): """Init the connection to the ES server.""" if not self.export_enable: return None self.index='{}-{}'.format(self.index, datetime.utcnow().strftime("%Y.%m.%d")) template_body = { "mappings": { "glances": { "dynamic_templat...
python
def init(self): """Init the connection to the ES server.""" if not self.export_enable: return None self.index='{}-{}'.format(self.index, datetime.utcnow().strftime("%Y.%m.%d")) template_body = { "mappings": { "glances": { "dynamic_templat...
[ "def", "init", "(", "self", ")", ":", "if", "not", "self", ".", "export_enable", ":", "return", "None", "self", ".", "index", "=", "'{}-{}'", ".", "format", "(", "self", ".", "index", ",", "datetime", ".", "utcnow", "(", ")", ".", "strftime", "(", ...
Init the connection to the ES server.
[ "Init", "the", "connection", "to", "the", "ES", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_elasticsearch.py#L55-L109
train
Init the connection to the ES server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_elasticsearch.py
Export.export
def export(self, name, columns, points): """Write the points to the ES server.""" logger.debug("Export {} stats to ElasticSearch".format(name)) # Create DB input # https://elasticsearch-py.readthedocs.io/en/master/helpers.html actions = [] for c, p in zip(columns, points...
python
def export(self, name, columns, points): """Write the points to the ES server.""" logger.debug("Export {} stats to ElasticSearch".format(name)) # Create DB input # https://elasticsearch-py.readthedocs.io/en/master/helpers.html actions = [] for c, p in zip(columns, points...
[ "def", "export", "(", "self", ",", "name", ",", "columns", ",", "points", ")", ":", "logger", ".", "debug", "(", "\"Export {} stats to ElasticSearch\"", ".", "format", "(", "name", ")", ")", "# Create DB input", "# https://elasticsearch-py.readthedocs.io/en/master/hel...
Write the points to the ES server.
[ "Write", "the", "points", "to", "the", "ES", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_elasticsearch.py#L111-L138
train
Write the points to the ES server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ip.py
Plugin.update
def update(self): """Update IP stats using the input method. Stats is dict """ # Init new stats stats = self.get_init_value() if self.input_method == 'local' and not import_error_tag: # Update stats using the netifaces lib try: de...
python
def update(self): """Update IP stats using the input method. Stats is dict """ # Init new stats stats = self.get_init_value() if self.input_method == 'local' and not import_error_tag: # Update stats using the netifaces lib try: de...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "if", "self", ".", "input_method", "==", "'local'", "and", "not", "import_error_tag", ":", "# Update stats using the netifaces lib", "try", ":", "d...
Update IP stats using the input method. Stats is dict
[ "Update", "IP", "stats", "using", "the", "input", "method", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ip.py#L69-L99
train
Update the stats using the input method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ip.py
Plugin.update_views
def update_views(self): """Update stats views.""" # Call the father's method super(Plugin, self).update_views() # Add specifics informations # Optional for key in iterkeys(self.stats): self.views[key]['optional'] = True
python
def update_views(self): """Update stats views.""" # Call the father's method super(Plugin, self).update_views() # Add specifics informations # Optional for key in iterkeys(self.stats): self.views[key]['optional'] = True
[ "def", "update_views", "(", "self", ")", ":", "# Call the father's method", "super", "(", "Plugin", ",", "self", ")", ".", "update_views", "(", ")", "# Add specifics informations", "# Optional", "for", "key", "in", "iterkeys", "(", "self", ".", "stats", ")", "...
Update stats views.
[ "Update", "stats", "views", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ip.py#L101-L109
train
Update stats views.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ip.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and display plugin enable... if not self.stats or self.is_disable(): return ret # Build ...
python
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and display plugin enable... if not self.stats or self.is_disable(): return ret # Build ...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "ret", "=", "[", "]", "# Only process if stats exist and display plugin enable...", "if", "not", "self", ".", "stats", "or", "self", ...
Return the dict to display in the curse interface.
[ "Return", "the", "dict", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ip.py#L111-L143
train
Return the dict to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ip.py
PublicIpAddress.get
def get(self): """Get the first public IP address returned by one of the online services.""" q = queue.Queue() for u, j, k in urls: t = threading.Thread(target=self._get_ip_public, args=(q, u, j, k)) t.daemon = True t.start() timer = Timer(self.timeo...
python
def get(self): """Get the first public IP address returned by one of the online services.""" q = queue.Queue() for u, j, k in urls: t = threading.Thread(target=self._get_ip_public, args=(q, u, j, k)) t.daemon = True t.start() timer = Timer(self.timeo...
[ "def", "get", "(", "self", ")", ":", "q", "=", "queue", ".", "Queue", "(", ")", "for", "u", ",", "j", ",", "k", "in", "urls", ":", "t", "=", "threading", ".", "Thread", "(", "target", "=", "self", ".", "_get_ip_public", ",", "args", "=", "(", ...
Get the first public IP address returned by one of the online services.
[ "Get", "the", "first", "public", "IP", "address", "returned", "by", "one", "of", "the", "online", "services", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ip.py#L161-L176
train
Get the first public IP address returned by one of the online services.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_ip.py
PublicIpAddress._get_ip_public
def _get_ip_public(self, queue_target, url, json=False, key=None): """Request the url service and put the result in the queue_target.""" try: response = urlopen(url, timeout=self.timeout).read().decode('utf-8') except Exception as e: logger.debug("IP plugin - Cannot open ...
python
def _get_ip_public(self, queue_target, url, json=False, key=None): """Request the url service and put the result in the queue_target.""" try: response = urlopen(url, timeout=self.timeout).read().decode('utf-8') except Exception as e: logger.debug("IP plugin - Cannot open ...
[ "def", "_get_ip_public", "(", "self", ",", "queue_target", ",", "url", ",", "json", "=", "False", ",", "key", "=", "None", ")", ":", "try", ":", "response", "=", "urlopen", "(", "url", ",", "timeout", "=", "self", ".", "timeout", ")", ".", "read", ...
Request the url service and put the result in the queue_target.
[ "Request", "the", "url", "service", "and", "put", "the", "result", "in", "the", "queue_target", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_ip.py#L178-L193
train
Request the url service and put the result in the queue_target.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/amps/glances_nginx.py
Amp.update
def update(self, process_list): """Update the AMP""" # Get the Nginx status logger.debug('{}: Update stats using status URL {}'.format(self.NAME, self.get('status_url'))) res = requests.get(self.get('status_url')) if res.ok: # u'Active connections: 1 \nserver accepts ...
python
def update(self, process_list): """Update the AMP""" # Get the Nginx status logger.debug('{}: Update stats using status URL {}'.format(self.NAME, self.get('status_url'))) res = requests.get(self.get('status_url')) if res.ok: # u'Active connections: 1 \nserver accepts ...
[ "def", "update", "(", "self", ",", "process_list", ")", ":", "# Get the Nginx status", "logger", ".", "debug", "(", "'{}: Update stats using status URL {}'", ".", "format", "(", "self", ".", "NAME", ",", "self", ".", "get", "(", "'status_url'", ")", ")", ")", ...
Update the AMP
[ "Update", "the", "AMP" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/amps/glances_nginx.py#L76-L87
train
Update the AMP
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_kafka.py
Export.init
def init(self): """Init the connection to the Kafka server.""" if not self.export_enable: return None # Build the server URI with host and port server_uri = '{}:{}'.format(self.host, self.port) try: s = KafkaProducer(bootstrap_servers=server_uri, ...
python
def init(self): """Init the connection to the Kafka server.""" if not self.export_enable: return None # Build the server URI with host and port server_uri = '{}:{}'.format(self.host, self.port) try: s = KafkaProducer(bootstrap_servers=server_uri, ...
[ "def", "init", "(", "self", ")", ":", "if", "not", "self", ".", "export_enable", ":", "return", "None", "# Build the server URI with host and port", "server_uri", "=", "'{}:{}'", ".", "format", "(", "self", ".", "host", ",", "self", ".", "port", ")", "try", ...
Init the connection to the Kafka server.
[ "Init", "the", "connection", "to", "the", "Kafka", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_kafka.py#L56-L74
train
Initialize the connection to the Kafka server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_kafka.py
Export.export
def export(self, name, columns, points): """Write the points to the kafka server.""" logger.debug("Export {} stats to Kafka".format(name)) # Create DB input data = dict(zip(columns, points)) # Send stats to the kafka topic # key=<plugin name> # value=JSON dict ...
python
def export(self, name, columns, points): """Write the points to the kafka server.""" logger.debug("Export {} stats to Kafka".format(name)) # Create DB input data = dict(zip(columns, points)) # Send stats to the kafka topic # key=<plugin name> # value=JSON dict ...
[ "def", "export", "(", "self", ",", "name", ",", "columns", ",", "points", ")", ":", "logger", ".", "debug", "(", "\"Export {} stats to Kafka\"", ".", "format", "(", "name", ")", ")", "# Create DB input", "data", "=", "dict", "(", "zip", "(", "columns", "...
Write the points to the kafka server.
[ "Write", "the", "points", "to", "the", "kafka", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_kafka.py#L76-L91
train
Write the points to the kafka server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_kafka.py
Export.exit
def exit(self): """Close the Kafka export module.""" # To ensure all connections are properly closed self.client.flush() self.client.close() # Call the father method super(Export, self).exit()
python
def exit(self): """Close the Kafka export module.""" # To ensure all connections are properly closed self.client.flush() self.client.close() # Call the father method super(Export, self).exit()
[ "def", "exit", "(", "self", ")", ":", "# To ensure all connections are properly closed", "self", ".", "client", ".", "flush", "(", ")", "self", ".", "client", ".", "close", "(", ")", "# Call the father method", "super", "(", "Export", ",", "self", ")", ".", ...
Close the Kafka export module.
[ "Close", "the", "Kafka", "export", "module", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_kafka.py#L93-L99
train
Close the Kafka export module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/processes.py
_sort_io_counters
def _sort_io_counters(process, sortedby='io_counters', sortedby_secondary='memory_percent'): """Specific case for io_counters Sum of io_r + io_w""" return process[sortedby][0] - process[sortedby][2] + process[sortedby][1] - process[sortedby][3]
python
def _sort_io_counters(process, sortedby='io_counters', sortedby_secondary='memory_percent'): """Specific case for io_counters Sum of io_r + io_w""" return process[sortedby][0] - process[sortedby][2] + process[sortedby][1] - process[sortedby][3]
[ "def", "_sort_io_counters", "(", "process", ",", "sortedby", "=", "'io_counters'", ",", "sortedby_secondary", "=", "'memory_percent'", ")", ":", "return", "process", "[", "sortedby", "]", "[", "0", "]", "-", "process", "[", "sortedby", "]", "[", "2", "]", ...
Specific case for io_counters Sum of io_r + io_w
[ "Specific", "case", "for", "io_counters", "Sum", "of", "io_r", "+", "io_w" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/processes.py#L381-L386
train
Sort the process by IO counters.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/processes.py
_sort_lambda
def _sort_lambda(sortedby='cpu_percent', sortedby_secondary='memory_percent'): """Return a sort lambda function for the sortedbykey""" ret = None if sortedby == 'io_counters': ret = _sort_io_counters elif sortedby == 'cpu_times': ret = _sort_cpu_times return ret
python
def _sort_lambda(sortedby='cpu_percent', sortedby_secondary='memory_percent'): """Return a sort lambda function for the sortedbykey""" ret = None if sortedby == 'io_counters': ret = _sort_io_counters elif sortedby == 'cpu_times': ret = _sort_cpu_times return ret
[ "def", "_sort_lambda", "(", "sortedby", "=", "'cpu_percent'", ",", "sortedby_secondary", "=", "'memory_percent'", ")", ":", "ret", "=", "None", "if", "sortedby", "==", "'io_counters'", ":", "ret", "=", "_sort_io_counters", "elif", "sortedby", "==", "'cpu_times'", ...
Return a sort lambda function for the sortedbykey
[ "Return", "a", "sort", "lambda", "function", "for", "the", "sortedbykey" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/processes.py#L400-L408
train
Return a sort lambda function for the sortedbykey
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/processes.py
sort_stats
def sort_stats(stats, sortedby='cpu_percent', sortedby_secondary='memory_percent', reverse=True): """Return the stats (dict) sorted by (sortedby). Reverse the sort if reverse is True. """ if sortedby is None and sortedby_secondary is None: # No need ...
python
def sort_stats(stats, sortedby='cpu_percent', sortedby_secondary='memory_percent', reverse=True): """Return the stats (dict) sorted by (sortedby). Reverse the sort if reverse is True. """ if sortedby is None and sortedby_secondary is None: # No need ...
[ "def", "sort_stats", "(", "stats", ",", "sortedby", "=", "'cpu_percent'", ",", "sortedby_secondary", "=", "'memory_percent'", ",", "reverse", "=", "True", ")", ":", "if", "sortedby", "is", "None", "and", "sortedby_secondary", "is", "None", ":", "# No need to sor...
Return the stats (dict) sorted by (sortedby). Reverse the sort if reverse is True.
[ "Return", "the", "stats", "(", "dict", ")", "sorted", "by", "(", "sortedby", ")", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/processes.py#L411-L447
train
Return the stats dict sorted by ( sortedby ).
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/processes.py
GlancesProcesses.update_processcount
def update_processcount(self, plist): """Update the global process count from the current processes list""" # Update the maximum process ID (pid) number self.processcount['pid_max'] = self.pid_max # For each key in the processcount dict # count the number of processes with the sa...
python
def update_processcount(self, plist): """Update the global process count from the current processes list""" # Update the maximum process ID (pid) number self.processcount['pid_max'] = self.pid_max # For each key in the processcount dict # count the number of processes with the sa...
[ "def", "update_processcount", "(", "self", ",", "plist", ")", ":", "# Update the maximum process ID (pid) number", "self", ".", "processcount", "[", "'pid_max'", "]", "=", "self", ".", "pid_max", "# For each key in the processcount dict", "# count the number of processes with...
Update the global process count from the current processes list
[ "Update", "the", "global", "process", "count", "from", "the", "current", "processes", "list" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/processes.py#L89-L102
train
Update the global process count from the current processes list plist
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/processes.py
GlancesProcesses.pid_max
def pid_max(self): """ Get the maximum PID value. On Linux, the value is read from the `/proc/sys/kernel/pid_max` file. From `man 5 proc`: The default value for this file, 32768, results in the same range of PIDs as on earlier kernels. On 32-bit platfroms, 32768 is the ...
python
def pid_max(self): """ Get the maximum PID value. On Linux, the value is read from the `/proc/sys/kernel/pid_max` file. From `man 5 proc`: The default value for this file, 32768, results in the same range of PIDs as on earlier kernels. On 32-bit platfroms, 32768 is the ...
[ "def", "pid_max", "(", "self", ")", ":", "if", "LINUX", ":", "# XXX: waiting for https://github.com/giampaolo/psutil/issues/720", "try", ":", "with", "open", "(", "'/proc/sys/kernel/pid_max'", ",", "'rb'", ")", "as", "f", ":", "return", "int", "(", "f", ".", "re...
Get the maximum PID value. On Linux, the value is read from the `/proc/sys/kernel/pid_max` file. From `man 5 proc`: The default value for this file, 32768, results in the same range of PIDs as on earlier kernels. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 6...
[ "Get", "the", "maximum", "PID", "value", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/processes.py#L123-L153
train
Get the maximum PID value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/processes.py
GlancesProcesses.reset_max_values
def reset_max_values(self): """Reset the maximum values dict.""" self._max_values = {} for k in self._max_values_list: self._max_values[k] = 0.0
python
def reset_max_values(self): """Reset the maximum values dict.""" self._max_values = {} for k in self._max_values_list: self._max_values[k] = 0.0
[ "def", "reset_max_values", "(", "self", ")", ":", "self", ".", "_max_values", "=", "{", "}", "for", "k", "in", "self", ".", "_max_values_list", ":", "self", ".", "_max_values", "[", "k", "]", "=", "0.0" ]
Reset the maximum values dict.
[ "Reset", "the", "maximum", "values", "dict", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/processes.py#L214-L218
train
Reset the maximum values dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/processes.py
GlancesProcesses.update
def update(self): """Update the processes stats.""" # Reset the stats self.processlist = [] self.reset_processcount() # Do not process if disable tag is set if self.disable_tag: return # Time since last update (for disk_io rate computation) t...
python
def update(self): """Update the processes stats.""" # Reset the stats self.processlist = [] self.reset_processcount() # Do not process if disable tag is set if self.disable_tag: return # Time since last update (for disk_io rate computation) t...
[ "def", "update", "(", "self", ")", ":", "# Reset the stats", "self", ".", "processlist", "=", "[", "]", "self", ".", "reset_processcount", "(", ")", "# Do not process if disable tag is set", "if", "self", ".", "disable_tag", ":", "return", "# Time since last update ...
Update the processes stats.
[ "Update", "the", "processes", "stats", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/processes.py#L220-L355
train
Update the processes stats.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/amps/glances_systemv.py
Amp.update
def update(self, process_list): """Update the AMP""" # Get the systemctl status logger.debug('{}: Update stats using service {}'.format(self.NAME, self.get('service_cmd'))) try: res = check_output(self.get('service_cmd').split(), stderr=STDOUT).decode('utf-8') except ...
python
def update(self, process_list): """Update the AMP""" # Get the systemctl status logger.debug('{}: Update stats using service {}'.format(self.NAME, self.get('service_cmd'))) try: res = check_output(self.get('service_cmd').split(), stderr=STDOUT).decode('utf-8') except ...
[ "def", "update", "(", "self", ",", "process_list", ")", ":", "# Get the systemctl status", "logger", ".", "debug", "(", "'{}: Update stats using service {}'", ".", "format", "(", "self", ".", "NAME", ",", "self", ".", "get", "(", "'service_cmd'", ")", ")", ")"...
Update the AMP
[ "Update", "the", "AMP" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/amps/glances_systemv.py#L67-L95
train
Update the AMP status using the systemctl command.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
seconds_to_hms
def seconds_to_hms(input_seconds): """Convert seconds to human-readable time.""" minutes, seconds = divmod(input_seconds, 60) hours, minutes = divmod(minutes, 60) hours = int(hours) minutes = int(minutes) seconds = str(int(seconds)).zfill(2) return hours, minutes, seconds
python
def seconds_to_hms(input_seconds): """Convert seconds to human-readable time.""" minutes, seconds = divmod(input_seconds, 60) hours, minutes = divmod(minutes, 60) hours = int(hours) minutes = int(minutes) seconds = str(int(seconds)).zfill(2) return hours, minutes, seconds
[ "def", "seconds_to_hms", "(", "input_seconds", ")", ":", "minutes", ",", "seconds", "=", "divmod", "(", "input_seconds", ",", "60", ")", "hours", ",", "minutes", "=", "divmod", "(", "minutes", ",", "60", ")", "hours", "=", "int", "(", "hours", ")", "mi...
Convert seconds to human-readable time.
[ "Convert", "seconds", "to", "human", "-", "readable", "time", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L34-L43
train
Convert seconds to hours minutes and seconds.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
split_cmdline
def split_cmdline(cmdline): """Return path, cmd and arguments for a process cmdline.""" path, cmd = os.path.split(cmdline[0]) arguments = ' '.join(cmdline[1:]) return path, cmd, arguments
python
def split_cmdline(cmdline): """Return path, cmd and arguments for a process cmdline.""" path, cmd = os.path.split(cmdline[0]) arguments = ' '.join(cmdline[1:]) return path, cmd, arguments
[ "def", "split_cmdline", "(", "cmdline", ")", ":", "path", ",", "cmd", "=", "os", ".", "path", ".", "split", "(", "cmdline", "[", "0", "]", ")", "arguments", "=", "' '", ".", "join", "(", "cmdline", "[", "1", ":", "]", ")", "return", "path", ",", ...
Return path, cmd and arguments for a process cmdline.
[ "Return", "path", "cmd", "and", "arguments", "for", "a", "process", "cmdline", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L46-L50
train
Return path cmd and arguments for a process cmdline.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
Plugin.update
def update(self): """Update processes stats using the input method.""" # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib # Note: Update is done in the processcount plugin # Jus...
python
def update(self): """Update processes stats using the input method.""" # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib # Note: Update is done in the processcount plugin # Jus...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "if", "self", ".", "input_method", "==", "'local'", ":", "# Update stats using the standard system lib", "# Note: Update is done in the processcount plugin",...
Update processes stats using the input method.
[ "Update", "processes", "stats", "using", "the", "input", "method", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L124-L146
train
Update the processes stats using the input method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
Plugin.get_nice_alert
def get_nice_alert(self, value): """Return the alert relative to the Nice configuration list""" value = str(value) try: if value in self.get_limit('nice_critical'): return 'CRITICAL' except KeyError: pass try: if value in self.g...
python
def get_nice_alert(self, value): """Return the alert relative to the Nice configuration list""" value = str(value) try: if value in self.get_limit('nice_critical'): return 'CRITICAL' except KeyError: pass try: if value in self.g...
[ "def", "get_nice_alert", "(", "self", ",", "value", ")", ":", "value", "=", "str", "(", "value", ")", "try", ":", "if", "value", "in", "self", ".", "get_limit", "(", "'nice_critical'", ")", ":", "return", "'CRITICAL'", "except", "KeyError", ":", "pass", ...
Return the alert relative to the Nice configuration list
[ "Return", "the", "alert", "relative", "to", "the", "Nice", "configuration", "list" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L148-L166
train
Return the alert relative to the Nice configuration list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
Plugin.get_process_curses_data
def get_process_curses_data(self, p, first, args): """Get curses data to display for a process. - p is the process to display - first is a tag=True if the process is the first on the list """ ret = [self.curse_new_line()] # CPU if 'cpu_percent' in p and p['cpu_pe...
python
def get_process_curses_data(self, p, first, args): """Get curses data to display for a process. - p is the process to display - first is a tag=True if the process is the first on the list """ ret = [self.curse_new_line()] # CPU if 'cpu_percent' in p and p['cpu_pe...
[ "def", "get_process_curses_data", "(", "self", ",", "p", ",", "first", ",", "args", ")", ":", "ret", "=", "[", "self", ".", "curse_new_line", "(", ")", "]", "# CPU", "if", "'cpu_percent'", "in", "p", "and", "p", "[", "'cpu_percent'", "]", "is", "not", ...
Get curses data to display for a process. - p is the process to display - first is a tag=True if the process is the first on the list
[ "Get", "curses", "data", "to", "display", "for", "a", "process", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L168-L406
train
Get the curses data for a process.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and display plugin enable... if not self.stats or args.disable_process: return ret # Com...
python
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and display plugin enable... if not self.stats or args.disable_process: return ret # Com...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "ret", "=", "[", "]", "# Only process if stats exist and display plugin enable...", "if", "not", "self", ".", "stats", "or", "args", ...
Return the dict to display in the curse interface.
[ "Return", "the", "dict", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L408-L439
train
Return the dict to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
Plugin.__msg_curse_header
def __msg_curse_header(self, ret, process_sort_key, args=None): """Build the header and add it to the ret dict.""" sort_style = 'SORT' if args.disable_irix and 0 < self.nb_log_core < 10: msg = self.layout_header['cpu'].format('CPU%/' + str(self.nb_log_core)) elif args.disabl...
python
def __msg_curse_header(self, ret, process_sort_key, args=None): """Build the header and add it to the ret dict.""" sort_style = 'SORT' if args.disable_irix and 0 < self.nb_log_core < 10: msg = self.layout_header['cpu'].format('CPU%/' + str(self.nb_log_core)) elif args.disabl...
[ "def", "__msg_curse_header", "(", "self", ",", "ret", ",", "process_sort_key", ",", "args", "=", "None", ")", ":", "sort_style", "=", "'SORT'", "if", "args", ".", "disable_irix", "and", "0", "<", "self", ".", "nb_log_core", "<", "10", ":", "msg", "=", ...
Build the header and add it to the ret dict.
[ "Build", "the", "header", "and", "add", "it", "to", "the", "ret", "dict", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L441-L475
train
Build the header and add it to the ret dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
Plugin.__msg_curse_sum
def __msg_curse_sum(self, ret, sep_char='_', mmm=None, args=None): """ Build the sum message (only when filter is on) and add it to the ret dict. * ret: list of string where the message is added * sep_char: define the line separation char * mmm: display min, max, mean or current...
python
def __msg_curse_sum(self, ret, sep_char='_', mmm=None, args=None): """ Build the sum message (only when filter is on) and add it to the ret dict. * ret: list of string where the message is added * sep_char: define the line separation char * mmm: display min, max, mean or current...
[ "def", "__msg_curse_sum", "(", "self", ",", "ret", ",", "sep_char", "=", "'_'", ",", "mmm", "=", "None", ",", "args", "=", "None", ")", ":", "ret", ".", "append", "(", "self", ".", "curse_new_line", "(", ")", ")", "if", "mmm", "is", "None", ":", ...
Build the sum message (only when filter is on) and add it to the ret dict. * ret: list of string where the message is added * sep_char: define the line separation char * mmm: display min, max, mean or current (if mmm=None) * args: Glances args
[ "Build", "the", "sum", "message", "(", "only", "when", "filter", "is", "on", ")", "and", "add", "it", "to", "the", "ret", "dict", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L477-L565
train
Build the sum message for the current page and add it to the ret dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
Plugin.__sum_stats
def __sum_stats(self, key, indice=None, mmm=None): """Return the sum of the stats value for the given key. * indice: If indice is set, get the p[key][indice] * mmm: display min, max, mean or current (if mmm=None) """ # Compute stats summary ret = 0 for p in self....
python
def __sum_stats(self, key, indice=None, mmm=None): """Return the sum of the stats value for the given key. * indice: If indice is set, get the p[key][indice] * mmm: display min, max, mean or current (if mmm=None) """ # Compute stats summary ret = 0 for p in self....
[ "def", "__sum_stats", "(", "self", ",", "key", ",", "indice", "=", "None", ",", "mmm", "=", "None", ")", ":", "# Compute stats summary", "ret", "=", "0", "for", "p", "in", "self", ".", "stats", ":", "if", "key", "not", "in", "p", ":", "# Correct issu...
Return the sum of the stats value for the given key. * indice: If indice is set, get the p[key][indice] * mmm: display min, max, mean or current (if mmm=None)
[ "Return", "the", "sum", "of", "the", "stats", "value", "for", "the", "given", "key", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L579-L622
train
Compute the sum of the stats value for the given key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_processlist.py
Plugin.__sort_stats
def __sort_stats(self, sortedby=None): """Return the stats (dict) sorted by (sortedby).""" return sort_stats(self.stats, sortedby, reverse=glances_processes.sort_reverse)
python
def __sort_stats(self, sortedby=None): """Return the stats (dict) sorted by (sortedby).""" return sort_stats(self.stats, sortedby, reverse=glances_processes.sort_reverse)
[ "def", "__sort_stats", "(", "self", ",", "sortedby", "=", "None", ")", ":", "return", "sort_stats", "(", "self", ".", "stats", ",", "sortedby", ",", "reverse", "=", "glances_processes", ".", "sort_reverse", ")" ]
Return the stats (dict) sorted by (sortedby).
[ "Return", "the", "stats", "(", "dict", ")", "sorted", "by", "(", "sortedby", ")", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_processlist.py#L630-L633
train
Return the stats dict sorted by sortedby.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_stdout_csv.py
GlancesStdoutCsv.build_header
def build_header(self, plugin, attribute, stat): """Build and return the header line""" line = '' if attribute is not None: line += '{}.{}{}'.format(plugin, attribute, self.separator) else: if isinstance(stat, dict): for k in stat.keys(): ...
python
def build_header(self, plugin, attribute, stat): """Build and return the header line""" line = '' if attribute is not None: line += '{}.{}{}'.format(plugin, attribute, self.separator) else: if isinstance(stat, dict): for k in stat.keys(): ...
[ "def", "build_header", "(", "self", ",", "plugin", ",", "attribute", ",", "stat", ")", ":", "line", "=", "''", "if", "attribute", "is", "not", "None", ":", "line", "+=", "'{}.{}{}'", ".", "format", "(", "plugin", ",", "attribute", ",", "self", ".", "...
Build and return the header line
[ "Build", "and", "return", "the", "header", "line" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_stdout_csv.py#L63-L86
train
Build and return the header line
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_stdout_csv.py
GlancesStdoutCsv.build_data
def build_data(self, plugin, attribute, stat): """Build and return the data line""" line = '' if attribute is not None: line += '{}{}'.format(str(stat.get(attribute, self.na)), self.separator) else: if isinstance(stat, dict): ...
python
def build_data(self, plugin, attribute, stat): """Build and return the data line""" line = '' if attribute is not None: line += '{}{}'.format(str(stat.get(attribute, self.na)), self.separator) else: if isinstance(stat, dict): ...
[ "def", "build_data", "(", "self", ",", "plugin", ",", "attribute", ",", "stat", ")", ":", "line", "=", "''", "if", "attribute", "is", "not", "None", ":", "line", "+=", "'{}{}'", ".", "format", "(", "str", "(", "stat", ".", "get", "(", "attribute", ...
Build and return the data line
[ "Build", "and", "return", "the", "data", "line" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_stdout_csv.py#L88-L107
train
Build and return the data line
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_stdout_csv.py
GlancesStdoutCsv.update
def update(self, stats, duration=3): """Display stats to stdout. Refresh every duration second. """ # Build the stats list line = '' for plugin, attribute in self.plugins_list: # Check if the plugin exist and is enable ...
python
def update(self, stats, duration=3): """Display stats to stdout. Refresh every duration second. """ # Build the stats list line = '' for plugin, attribute in self.plugins_list: # Check if the plugin exist and is enable ...
[ "def", "update", "(", "self", ",", "stats", ",", "duration", "=", "3", ")", ":", "# Build the stats list", "line", "=", "''", "for", "plugin", ",", "attribute", "in", "self", ".", "plugins_list", ":", "# Check if the plugin exist and is enable", "if", "plugin", ...
Display stats to stdout. Refresh every duration second.
[ "Display", "stats", "to", "stdout", ".", "Refresh", "every", "duration", "second", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_stdout_csv.py#L109-L139
train
Display stats to stdout.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_riemann.py
Export.init
def init(self): """Init the connection to the Riemann server.""" if not self.export_enable: return None try: client = bernhard.Client(host=self.host, port=self.port) return client except Exception as e: logger.critical("Connection to Rieman...
python
def init(self): """Init the connection to the Riemann server.""" if not self.export_enable: return None try: client = bernhard.Client(host=self.host, port=self.port) return client except Exception as e: logger.critical("Connection to Rieman...
[ "def", "init", "(", "self", ")", ":", "if", "not", "self", ".", "export_enable", ":", "return", "None", "try", ":", "client", "=", "bernhard", ".", "Client", "(", "host", "=", "self", ".", "host", ",", "port", "=", "self", ".", "port", ")", "return...
Init the connection to the Riemann server.
[ "Init", "the", "connection", "to", "the", "Riemann", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_riemann.py#L61-L70
train
Init the connection to the Riemann server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_riemann.py
Export.export
def export(self, name, columns, points): """Write the points in Riemann.""" for i in range(len(columns)): if not isinstance(points[i], Number): continue else: data = {'host': self.hostname, 'service': name + " " + columns[i], 'metric': points[i]} ...
python
def export(self, name, columns, points): """Write the points in Riemann.""" for i in range(len(columns)): if not isinstance(points[i], Number): continue else: data = {'host': self.hostname, 'service': name + " " + columns[i], 'metric': points[i]} ...
[ "def", "export", "(", "self", ",", "name", ",", "columns", ",", "points", ")", ":", "for", "i", "in", "range", "(", "len", "(", "columns", ")", ")", ":", "if", "not", "isinstance", "(", "points", "[", "i", "]", ",", "Number", ")", ":", "continue"...
Write the points in Riemann.
[ "Write", "the", "points", "in", "Riemann", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_riemann.py#L72-L83
train
Write the points in Riemann.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/timer.py
getTimeSinceLastUpdate
def getTimeSinceLastUpdate(IOType): """Return the elapsed time since last update.""" global last_update_times # assert(IOType in ['net', 'disk', 'process_disk']) current_time = time() last_time = last_update_times.get(IOType) if not last_time: time_since_update = 1 else: time...
python
def getTimeSinceLastUpdate(IOType): """Return the elapsed time since last update.""" global last_update_times # assert(IOType in ['net', 'disk', 'process_disk']) current_time = time() last_time = last_update_times.get(IOType) if not last_time: time_since_update = 1 else: time...
[ "def", "getTimeSinceLastUpdate", "(", "IOType", ")", ":", "global", "last_update_times", "# assert(IOType in ['net', 'disk', 'process_disk'])", "current_time", "=", "time", "(", ")", "last_time", "=", "last_update_times", ".", "get", "(", "IOType", ")", "if", "not", "...
Return the elapsed time since last update.
[ "Return", "the", "elapsed", "time", "since", "last", "update", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/timer.py#L29-L40
train
Return the elapsed time since last update.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/compat.py
subsample
def subsample(data, sampling): """Compute a simple mean subsampling. Data should be a list of numerical itervalues Return a subsampled list of sampling lenght """ if len(data) <= sampling: return data sampling_length = int(round(len(data) / float(sampling))) return [mean(data[s * s...
python
def subsample(data, sampling): """Compute a simple mean subsampling. Data should be a list of numerical itervalues Return a subsampled list of sampling lenght """ if len(data) <= sampling: return data sampling_length = int(round(len(data) / float(sampling))) return [mean(data[s * s...
[ "def", "subsample", "(", "data", ",", "sampling", ")", ":", "if", "len", "(", "data", ")", "<=", "sampling", ":", "return", "data", "sampling_length", "=", "int", "(", "round", "(", "len", "(", "data", ")", "/", "float", "(", "sampling", ")", ")", ...
Compute a simple mean subsampling. Data should be a list of numerical itervalues Return a subsampled list of sampling lenght
[ "Compute", "a", "simple", "mean", "subsampling", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/compat.py#L209-L219
train
Compute a simple mean subsampling.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/compat.py
time_serie_subsample
def time_serie_subsample(data, sampling): """Compute a simple mean subsampling. Data should be a list of set (time, value) Return a subsampled list of sampling lenght """ if len(data) <= sampling: return data t = [t[0] for t in data] v = [t[1] for t in data] sampling_length = i...
python
def time_serie_subsample(data, sampling): """Compute a simple mean subsampling. Data should be a list of set (time, value) Return a subsampled list of sampling lenght """ if len(data) <= sampling: return data t = [t[0] for t in data] v = [t[1] for t in data] sampling_length = i...
[ "def", "time_serie_subsample", "(", "data", ",", "sampling", ")", ":", "if", "len", "(", "data", ")", "<=", "sampling", ":", "return", "data", "t", "=", "[", "t", "[", "0", "]", "for", "t", "in", "data", "]", "v", "=", "[", "t", "[", "1", "]", ...
Compute a simple mean subsampling. Data should be a list of set (time, value) Return a subsampled list of sampling lenght
[ "Compute", "a", "simple", "mean", "subsampling", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/compat.py#L222-L236
train
Compute a simple mean subsampling.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_couchdb.py
Export.init
def init(self): """Init the connection to the CouchDB server.""" if not self.export_enable: return None if self.user is None: server_uri = 'http://{}:{}/'.format(self.host, self.port) else: server_uri = ...
python
def init(self): """Init the connection to the CouchDB server.""" if not self.export_enable: return None if self.user is None: server_uri = 'http://{}:{}/'.format(self.host, self.port) else: server_uri = ...
[ "def", "init", "(", "self", ")", ":", "if", "not", "self", ".", "export_enable", ":", "return", "None", "if", "self", ".", "user", "is", "None", ":", "server_uri", "=", "'http://{}:{}/'", ".", "format", "(", "self", ".", "host", ",", "self", ".", "po...
Init the connection to the CouchDB server.
[ "Init", "the", "connection", "to", "the", "CouchDB", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_couchdb.py#L57-L88
train
Init the connection to the CouchDB server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_couchdb.py
Export.export
def export(self, name, columns, points): """Write the points to the CouchDB server.""" logger.debug("Export {} stats to CouchDB".format(name)) # Create DB input data = dict(zip(columns, points)) # Set the type to the current stat name data['type'] = name data['t...
python
def export(self, name, columns, points): """Write the points to the CouchDB server.""" logger.debug("Export {} stats to CouchDB".format(name)) # Create DB input data = dict(zip(columns, points)) # Set the type to the current stat name data['type'] = name data['t...
[ "def", "export", "(", "self", ",", "name", ",", "columns", ",", "points", ")", ":", "logger", ".", "debug", "(", "\"Export {} stats to CouchDB\"", ".", "format", "(", "name", ")", ")", "# Create DB input", "data", "=", "dict", "(", "zip", "(", "columns", ...
Write the points to the CouchDB server.
[ "Write", "the", "points", "to", "the", "CouchDB", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_couchdb.py#L94-L110
train
Write the points to the CouchDB server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_core.py
Plugin.update
def update(self): """Update core stats. Stats is a dict (with both physical and log cpu number) instead of a integer. """ # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib ...
python
def update(self): """Update core stats. Stats is a dict (with both physical and log cpu number) instead of a integer. """ # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the standard system lib ...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "if", "self", ".", "input_method", "==", "'local'", ":", "# Update stats using the standard system lib", "# The psutil 2.0 include psutil.cpu_count() and psu...
Update core stats. Stats is a dict (with both physical and log cpu number) instead of a integer.
[ "Update", "core", "stats", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_core.py#L43-L73
train
Update core stats.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.is_theme
def is_theme(self, name): """Return True if the theme *name* should be used.""" return getattr(self.args, 'theme_' + name) or self.theme['name'] == name
python
def is_theme(self, name): """Return True if the theme *name* should be used.""" return getattr(self.args, 'theme_' + name) or self.theme['name'] == name
[ "def", "is_theme", "(", "self", ",", "name", ")", ":", "return", "getattr", "(", "self", ".", "args", ",", "'theme_'", "+", "name", ")", "or", "self", ".", "theme", "[", "'name'", "]", "==", "name" ]
Return True if the theme *name* should be used.
[ "Return", "True", "if", "the", "theme", "*", "name", "*", "should", "be", "used", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L164-L166
train
Return True if the theme name should be used.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses._init_cursor
def _init_cursor(self): """Init cursors.""" if hasattr(curses, 'noecho'): curses.noecho() if hasattr(curses, 'cbreak'): curses.cbreak() self.set_cursor(0)
python
def _init_cursor(self): """Init cursors.""" if hasattr(curses, 'noecho'): curses.noecho() if hasattr(curses, 'cbreak'): curses.cbreak() self.set_cursor(0)
[ "def", "_init_cursor", "(", "self", ")", ":", "if", "hasattr", "(", "curses", ",", "'noecho'", ")", ":", "curses", ".", "noecho", "(", ")", "if", "hasattr", "(", "curses", ",", "'cbreak'", ")", ":", "curses", ".", "cbreak", "(", ")", "self", ".", "...
Init cursors.
[ "Init", "cursors", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L173-L180
train
Init cursors.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses._init_colors
def _init_colors(self): """Init the Curses color layout.""" # Set curses options try: if hasattr(curses, 'start_color'): curses.start_color() if hasattr(curses, 'use_default_colors'): curses.use_default_colors() except Exception as...
python
def _init_colors(self): """Init the Curses color layout.""" # Set curses options try: if hasattr(curses, 'start_color'): curses.start_color() if hasattr(curses, 'use_default_colors'): curses.use_default_colors() except Exception as...
[ "def", "_init_colors", "(", "self", ")", ":", "# Set curses options", "try", ":", "if", "hasattr", "(", "curses", ",", "'start_color'", ")", ":", "curses", ".", "start_color", "(", ")", "if", "hasattr", "(", "curses", ",", "'use_default_colors'", ")", ":", ...
Init the Curses color layout.
[ "Init", "the", "Curses", "color", "layout", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L182-L295
train
Initialize the colors for the current terminal.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.loop_position
def loop_position(self): """Return the current sort in the loop""" for i, v in enumerate(self._sort_loop): if v == glances_processes.sort_key: return i return 0
python
def loop_position(self): """Return the current sort in the loop""" for i, v in enumerate(self._sort_loop): if v == glances_processes.sort_key: return i return 0
[ "def", "loop_position", "(", "self", ")", ":", "for", "i", ",", "v", "in", "enumerate", "(", "self", ".", "_sort_loop", ")", ":", "if", "v", "==", "glances_processes", ".", "sort_key", ":", "return", "i", "return", "0" ]
Return the current sort in the loop
[ "Return", "the", "current", "sort", "in", "the", "loop" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L414-L419
train
Return the current sort in the loop
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.enable_fullquicklook
def enable_fullquicklook(self): """Disable the full quicklook mode""" self.args.disable_quicklook = False for p in ['cpu', 'gpu', 'mem', 'memswap']: setattr(self.args, 'disable_' + p, True)
python
def enable_fullquicklook(self): """Disable the full quicklook mode""" self.args.disable_quicklook = False for p in ['cpu', 'gpu', 'mem', 'memswap']: setattr(self.args, 'disable_' + p, True)
[ "def", "enable_fullquicklook", "(", "self", ")", ":", "self", ".", "args", ".", "disable_quicklook", "=", "False", "for", "p", "in", "[", "'cpu'", ",", "'gpu'", ",", "'mem'", ",", "'memswap'", "]", ":", "setattr", "(", "self", ".", "args", ",", "'disab...
Disable the full quicklook mode
[ "Disable", "the", "full", "quicklook", "mode" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L436-L440
train
Disable the full quicklook mode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.end
def end(self): """Shutdown the curses window.""" if hasattr(curses, 'echo'): curses.echo() if hasattr(curses, 'nocbreak'): curses.nocbreak() if hasattr(curses, 'curs_set'): try: curses.curs_set(1) except Exception: ...
python
def end(self): """Shutdown the curses window.""" if hasattr(curses, 'echo'): curses.echo() if hasattr(curses, 'nocbreak'): curses.nocbreak() if hasattr(curses, 'curs_set'): try: curses.curs_set(1) except Exception: ...
[ "def", "end", "(", "self", ")", ":", "if", "hasattr", "(", "curses", ",", "'echo'", ")", ":", "curses", ".", "echo", "(", ")", "if", "hasattr", "(", "curses", ",", "'nocbreak'", ")", ":", "curses", ".", "nocbreak", "(", ")", "if", "hasattr", "(", ...
Shutdown the curses window.
[ "Shutdown", "the", "curses", "window", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L442-L453
train
Shutdown the curses window.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.__get_stat_display
def __get_stat_display(self, stats, layer): """Return a dict of dict with all the stats display. stats: Global stats dict layer: ~ cs_status "None": standalone or server mode "Connected": Client is connected to a Glances server "SNMP": Client is connected to a...
python
def __get_stat_display(self, stats, layer): """Return a dict of dict with all the stats display. stats: Global stats dict layer: ~ cs_status "None": standalone or server mode "Connected": Client is connected to a Glances server "SNMP": Client is connected to a...
[ "def", "__get_stat_display", "(", "self", ",", "stats", ",", "layer", ")", ":", "ret", "=", "{", "}", "for", "p", "in", "stats", ".", "getPluginsList", "(", "enable", "=", "False", ")", ":", "if", "p", "==", "'quicklook'", "or", "p", "==", "'processl...
Return a dict of dict with all the stats display. stats: Global stats dict layer: ~ cs_status "None": standalone or server mode "Connected": Client is connected to a Glances server "SNMP": Client is connected to a SNMP server "Disconnected": Client is disc...
[ "Return", "a", "dict", "of", "dict", "with", "all", "the", "stats", "display", ".", "stats", ":", "Global", "stats", "dict", "layer", ":", "~", "cs_status", "None", ":", "standalone", "or", "server", "mode", "Connected", ":", "Client", "is", "connected", ...
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L478-L511
train
Return a dict with all the stats display.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.display
def display(self, stats, cs_status=None): """Display stats on the screen. stats: Stats database to display cs_status: "None": standalone or server mode "Connected": Client is connected to a Glances server "SNMP": Client is connected to a SNMP server ...
python
def display(self, stats, cs_status=None): """Display stats on the screen. stats: Stats database to display cs_status: "None": standalone or server mode "Connected": Client is connected to a Glances server "SNMP": Client is connected to a SNMP server ...
[ "def", "display", "(", "self", ",", "stats", ",", "cs_status", "=", "None", ")", ":", "# Init the internal line/column for Glances Curses", "self", ".", "init_line_column", "(", ")", "# Update the stats messages", "###########################", "# Get all the plugins but quic...
Display stats on the screen. stats: Stats database to display cs_status: "None": standalone or server mode "Connected": Client is connected to a Glances server "SNMP": Client is connected to a SNMP server "Disconnected": Client is disconnected from the se...
[ "Display", "stats", "on", "the", "screen", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L513-L625
train
Display the stats on the screen.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.__display_header
def __display_header(self, stat_display): """Display the firsts lines (header) in the Curses interface. system + ip + uptime (cloud) """ # First line self.new_line() self.space_between_column = 0 l_uptime = (self.get_stats_display_width(stat_display["syst...
python
def __display_header(self, stat_display): """Display the firsts lines (header) in the Curses interface. system + ip + uptime (cloud) """ # First line self.new_line() self.space_between_column = 0 l_uptime = (self.get_stats_display_width(stat_display["syst...
[ "def", "__display_header", "(", "self", ",", "stat_display", ")", ":", "# First line", "self", ".", "new_line", "(", ")", "self", ".", "space_between_column", "=", "0", "l_uptime", "=", "(", "self", ".", "get_stats_display_width", "(", "stat_display", "[", "\"...
Display the firsts lines (header) in the Curses interface. system + ip + uptime (cloud)
[ "Display", "the", "firsts", "lines", "(", "header", ")", "in", "the", "Curses", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L627-L652
train
Display the firsts lines in the Curses interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.__display_top
def __display_top(self, stat_display, stats): """Display the second line in the Curses interface. <QUICKLOOK> + CPU|PERCPU + <GPU> + MEM + SWAP + LOAD """ self.init_column() self.new_line() # Init quicklook stat_display['quicklook'] = {'msgdict': []} # ...
python
def __display_top(self, stat_display, stats): """Display the second line in the Curses interface. <QUICKLOOK> + CPU|PERCPU + <GPU> + MEM + SWAP + LOAD """ self.init_column() self.new_line() # Init quicklook stat_display['quicklook'] = {'msgdict': []} # ...
[ "def", "__display_top", "(", "self", ",", "stat_display", ",", "stats", ")", ":", "self", ".", "init_column", "(", ")", "self", ".", "new_line", "(", ")", "# Init quicklook", "stat_display", "[", "'quicklook'", "]", "=", "{", "'msgdict'", ":", "[", "]", ...
Display the second line in the Curses interface. <QUICKLOOK> + CPU|PERCPU + <GPU> + MEM + SWAP + LOAD
[ "Display", "the", "second", "line", "in", "the", "Curses", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L654-L727
train
Display the second line in the Curses interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.__display_left
def __display_left(self, stat_display): """Display the left sidebar in the Curses interface.""" self.init_column() if self.args.disable_left_sidebar: return for s in self._left_sidebar: if ((hasattr(self.args, 'enable_' + s) or hasattr(self.args...
python
def __display_left(self, stat_display): """Display the left sidebar in the Curses interface.""" self.init_column() if self.args.disable_left_sidebar: return for s in self._left_sidebar: if ((hasattr(self.args, 'enable_' + s) or hasattr(self.args...
[ "def", "__display_left", "(", "self", ",", "stat_display", ")", ":", "self", ".", "init_column", "(", ")", "if", "self", ".", "args", ".", "disable_left_sidebar", ":", "return", "for", "s", "in", "self", ".", "_left_sidebar", ":", "if", "(", "(", "hasatt...
Display the left sidebar in the Curses interface.
[ "Display", "the", "left", "sidebar", "in", "the", "Curses", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L729-L740
train
Display the left sidebar in the Curses interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.__display_right
def __display_right(self, stat_display): """Display the right sidebar in the Curses interface. docker + processcount + amps + processlist + alert """ # Do not display anything if space is not available... if self.screen.getmaxyx()[1] < self._left_sidebar_min_width: r...
python
def __display_right(self, stat_display): """Display the right sidebar in the Curses interface. docker + processcount + amps + processlist + alert """ # Do not display anything if space is not available... if self.screen.getmaxyx()[1] < self._left_sidebar_min_width: r...
[ "def", "__display_right", "(", "self", ",", "stat_display", ")", ":", "# Do not display anything if space is not available...", "if", "self", ".", "screen", ".", "getmaxyx", "(", ")", "[", "1", "]", "<", "self", ".", "_left_sidebar_min_width", ":", "return", "# Re...
Display the right sidebar in the Curses interface. docker + processcount + amps + processlist + alert
[ "Display", "the", "right", "sidebar", "in", "the", "Curses", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L742-L767
train
Display the right sidebar in the Curses interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.display_popup
def display_popup(self, message, size_x=None, size_y=None, duration=3, is_input=False, input_size=30, input_value=None): """ Display a centered popup. If is_input is False: Dis...
python
def display_popup(self, message, size_x=None, size_y=None, duration=3, is_input=False, input_size=30, input_value=None): """ Display a centered popup. If is_input is False: Dis...
[ "def", "display_popup", "(", "self", ",", "message", ",", "size_x", "=", "None", ",", "size_y", "=", "None", ",", "duration", "=", "3", ",", "is_input", "=", "False", ",", "input_size", "=", "30", ",", "input_value", "=", "None", ")", ":", "# Center th...
Display a centered popup. If is_input is False: Display a centered popup with the given message during duration seconds If size_x and size_y: set the popup size else set it automatically Return True if the popup could be displayed If is_input is True: Displ...
[ "Display", "a", "centered", "popup", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L769-L845
train
Display a popup with the given message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.display_plugin
def display_plugin(self, plugin_stats, display_optional=True, display_additional=True, max_y=65535, add_space=0): """Display the plugin_stats on the screen. If display_optional=True display the optional stats ...
python
def display_plugin(self, plugin_stats, display_optional=True, display_additional=True, max_y=65535, add_space=0): """Display the plugin_stats on the screen. If display_optional=True display the optional stats ...
[ "def", "display_plugin", "(", "self", ",", "plugin_stats", ",", "display_optional", "=", "True", ",", "display_additional", "=", "True", ",", "max_y", "=", "65535", ",", "add_space", "=", "0", ")", ":", "# Exit if:", "# - the plugin_stats message is empty", "# - t...
Display the plugin_stats on the screen. If display_optional=True display the optional stats If display_additional=True display additionnal stats max_y: do not display line > max_y add_space: add x space (line) after the plugin
[ "Display", "the", "plugin_stats", "on", "the", "screen", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L847-L937
train
Display the plugin_stats on the screen.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.flush
def flush(self, stats, cs_status=None): """Clear and update the screen. stats: Stats database to display cs_status: "None": standalone or server mode "Connected": Client is connected to the server "Disconnected": Client is disconnected from the server ...
python
def flush(self, stats, cs_status=None): """Clear and update the screen. stats: Stats database to display cs_status: "None": standalone or server mode "Connected": Client is connected to the server "Disconnected": Client is disconnected from the server ...
[ "def", "flush", "(", "self", ",", "stats", ",", "cs_status", "=", "None", ")", ":", "self", ".", "erase", "(", ")", "self", ".", "display", "(", "stats", ",", "cs_status", "=", "cs_status", ")" ]
Clear and update the screen. stats: Stats database to display cs_status: "None": standalone or server mode "Connected": Client is connected to the server "Disconnected": Client is disconnected from the server
[ "Clear", "and", "update", "the", "screen", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L943-L953
train
Clear and update the screen.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.update
def update(self, stats, duration=3, cs_status=None, return_to_browser=False): """Update the screen. INPUT stats: Stats database to display duration: duration of the loop cs_status: "None": standalone or serv...
python
def update(self, stats, duration=3, cs_status=None, return_to_browser=False): """Update the screen. INPUT stats: Stats database to display duration: duration of the loop cs_status: "None": standalone or serv...
[ "def", "update", "(", "self", ",", "stats", ",", "duration", "=", "3", ",", "cs_status", "=", "None", ",", "return_to_browser", "=", "False", ")", ":", "# Flush display", "self", ".", "flush", "(", "stats", ",", "cs_status", "=", "cs_status", ")", "# If ...
Update the screen. INPUT stats: Stats database to display duration: duration of the loop cs_status: "None": standalone or server mode "Connected": Client is connected to the server "Disconnected": Client is disconnected from the server return_...
[ "Update", "the", "screen", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L955-L1002
train
Update the screen.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.get_stats_display_width
def get_stats_display_width(self, curse_msg, without_option=False): """Return the width of the formatted curses message.""" try: if without_option: # Size without options c = len(max(''.join([(u(u(nativestr(i['msg'])).encode('ascii', 'replace')) if not i['opti...
python
def get_stats_display_width(self, curse_msg, without_option=False): """Return the width of the formatted curses message.""" try: if without_option: # Size without options c = len(max(''.join([(u(u(nativestr(i['msg'])).encode('ascii', 'replace')) if not i['opti...
[ "def", "get_stats_display_width", "(", "self", ",", "curse_msg", ",", "without_option", "=", "False", ")", ":", "try", ":", "if", "without_option", ":", "# Size without options", "c", "=", "len", "(", "max", "(", "''", ".", "join", "(", "[", "(", "u", "(...
Return the width of the formatted curses message.
[ "Return", "the", "width", "of", "the", "formatted", "curses", "message", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L1008-L1023
train
Return the width of the formatted curses message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/outputs/glances_curses.py
_GlancesCurses.get_stats_display_height
def get_stats_display_height(self, curse_msg): r"""Return the height of the formatted curses message. The height is defined by the number of '\n' (new line). """ try: c = [i['msg'] for i in curse_msg['msgdict']].count('\n') except Exception as e: logger.d...
python
def get_stats_display_height(self, curse_msg): r"""Return the height of the formatted curses message. The height is defined by the number of '\n' (new line). """ try: c = [i['msg'] for i in curse_msg['msgdict']].count('\n') except Exception as e: logger.d...
[ "def", "get_stats_display_height", "(", "self", ",", "curse_msg", ")", ":", "try", ":", "c", "=", "[", "i", "[", "'msg'", "]", "for", "i", "in", "curse_msg", "[", "'msgdict'", "]", "]", ".", "count", "(", "'\\n'", ")", "except", "Exception", "as", "e...
r"""Return the height of the formatted curses message. The height is defined by the number of '\n' (new line).
[ "r", "Return", "the", "height", "of", "the", "formatted", "curses", "message", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/outputs/glances_curses.py#L1025-L1036
train
r Return the height of the formatted curses message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/snmp.py
GlancesSNMPClient.__buid_result
def __buid_result(self, varBinds): """Build the results.""" ret = {} for name, val in varBinds: if str(val) == '': ret[name.prettyPrint()] = '' else: ret[name.prettyPrint()] = val.prettyPrint() # In Python 3, prettyPrint() r...
python
def __buid_result(self, varBinds): """Build the results.""" ret = {} for name, val in varBinds: if str(val) == '': ret[name.prettyPrint()] = '' else: ret[name.prettyPrint()] = val.prettyPrint() # In Python 3, prettyPrint() r...
[ "def", "__buid_result", "(", "self", ",", "varBinds", ")", ":", "ret", "=", "{", "}", "for", "name", ",", "val", "in", "varBinds", ":", "if", "str", "(", "val", ")", "==", "''", ":", "ret", "[", "name", ".", "prettyPrint", "(", ")", "]", "=", "...
Build the results.
[ "Build", "the", "results", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/snmp.py#L51-L62
train
Build the results.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/snmp.py
GlancesSNMPClient.get_by_oid
def get_by_oid(self, *oid): """SNMP simple request (list of OID). One request per OID list. * oid: oid list > Return a dict """ if self.version == '3': errorIndication, errorStatus, errorIndex, varBinds = self.cmdGen.getCmd( cmdgen.UsmUserDat...
python
def get_by_oid(self, *oid): """SNMP simple request (list of OID). One request per OID list. * oid: oid list > Return a dict """ if self.version == '3': errorIndication, errorStatus, errorIndex, varBinds = self.cmdGen.getCmd( cmdgen.UsmUserDat...
[ "def", "get_by_oid", "(", "self", ",", "*", "oid", ")", ":", "if", "self", ".", "version", "==", "'3'", ":", "errorIndication", ",", "errorStatus", ",", "errorIndex", ",", "varBinds", "=", "self", ".", "cmdGen", ".", "getCmd", "(", "cmdgen", ".", "UsmU...
SNMP simple request (list of OID). One request per OID list. * oid: oid list > Return a dict
[ "SNMP", "simple", "request", "(", "list", "of", "OID", ")", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/snmp.py#L71-L91
train
This function returns a dict of the related object that is identified by the OID.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...