Definition at line 128 of file models.py.
◆ __init__()
searx.metrics.models.CounterStorage.__init__ |
( |
| self | ) |
|
Definition at line 132 of file models.py.
132 def __init__(self):
133 self.lock = threading.Lock()
134 self.clear()
135
◆ add()
searx.metrics.models.CounterStorage.add |
( |
| self, |
|
|
| value, |
|
|
* | args ) |
◆ clear()
searx.metrics.models.CounterStorage.clear |
( |
| self | ) |
|
Definition at line 136 of file models.py.
136 def clear(self):
137 with self.lock:
138 self.counters = {}
139
References lock.
◆ configure()
searx.metrics.models.CounterStorage.configure |
( |
| self, |
|
|
* | args ) |
Definition at line 140 of file models.py.
140 def configure(self, *args):
141 with self.lock:
142 self.counters[args] = 0
143
References counters, and lock.
◆ dump()
searx.metrics.models.CounterStorage.dump |
( |
| self | ) |
|
Definition at line 151 of file models.py.
151 def dump(self):
152 with self.lock:
153 ks = sorted(self.counters.keys(), key='/'.join)
154 logger.debug("Counters:")
155 for k in ks:
156 logger.debug("- %-60s %s", '|'.join(k), self.counters[k])
157
158
References counters, and lock.
◆ get()
searx.metrics.models.CounterStorage.get |
( |
| self, |
|
|
* | args ) |
◆ __slots__
str searx.metrics.models.CounterStorage.__slots__ = 'counters', 'lock' |
|
staticprivate |
◆ counters
dict searx.metrics.models.CounterStorage.counters = {} |
◆ lock
searx.metrics.models.CounterStorage.lock = threading.Lock() |
The documentation for this class was generated from the following file:
- /home/andrew/Documents/code/public/searxng/searx/metrics/models.py