Definition at line 130 of file models.py.
◆ __init__()
searx.metrics.models.CounterStorage.__init__ |
( |
| self | ) |
|
Definition at line 134 of file models.py.
134 def __init__(self):
135 self.lock = threading.Lock()
136 self.clear()
137
◆ add()
searx.metrics.models.CounterStorage.add |
( |
| self, |
|
|
int | value, |
|
|
*str | args ) |
◆ clear()
searx.metrics.models.CounterStorage.clear |
( |
| self | ) |
|
Definition at line 138 of file models.py.
138 def clear(self):
139 with self.lock:
140 self.counters: dict[t.Hashable, int] = {}
141
References lock.
◆ configure()
searx.metrics.models.CounterStorage.configure |
( |
| self, |
|
|
*str | args ) |
Definition at line 142 of file models.py.
142 def configure(self, *args: str):
143 with self.lock:
144 self.counters[args] = 0
145
References counters, and lock.
◆ dump()
searx.metrics.models.CounterStorage.dump |
( |
| self | ) |
|
Definition at line 153 of file models.py.
153 def dump(self):
154 with self.lock:
155 ks = sorted(self.counters.keys(), key='/'.join)
156 logger.debug("Counters:")
157 for k in ks:
158 logger.debug("- %-60s %s", '|'.join(k), self.counters[k])
159
160
References counters, and lock.
◆ get()
searx.metrics.models.CounterStorage.get |
( |
| self, |
|
|
*str | 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