eww.stats¶
Eww’s stats thread & interface. Receives and processes stats requests.
This module also contains any helper functions for stats.
- exception eww.stats.InvalidCounterOption[source]¶
Bases: exceptions.Exception
Raised when counter methods are called with invalid data
- __weakref__¶
list of weak references to the object (if defined)
- exception eww.stats.InvalidGraphDatapoint[source]¶
Bases: exceptions.Exception
Raised when stats.graph is called with invalid data
- __weakref__¶
list of weak references to the object (if defined)
- class eww.stats.Stat¶
Bases: tuple
Stat(name, type, action, value)
- __getnewargs__()¶
Return self as a plain tuple. Used by copy and pickle.
- __getstate__()¶
Exclude the OrderedDict from pickling
- static __new__(_cls, name, type, action, value)¶
Create new instance of Stat(name, type, action, value)
- __repr__()¶
Return a nicely formatted representation string
- _asdict()¶
Return a new OrderedDict which maps field names to their values
- classmethod _make(iterable, new=<built-in method __new__ of type object at 0x90aa40>, len=<built-in function len>)¶
Make a new Stat object from a sequence or iterable
- _replace(_self, **kwds)¶
Return a new Stat object replacing specified fields with new values
- action¶
Alias for field number 2
- name¶
Alias for field number 0
- type¶
Alias for field number 1
- value¶
Alias for field number 3
- class eww.stats.StatsThread(max_datapoints=500, timeout=1)[source]¶
Bases: eww.stoppable_thread.StoppableThread
StatsThread listens to STATS_QUEUE and processes incoming stats. As a StoppableThread subclass, this thread must check for the .stop_requested flag.
- eww.stats.counter_manipulation(stat)[source]¶
Backend to all counter changes.
Parameters: stat (Stat) – A populated Stat object. Returns: None