+4
indexer.py
+4
indexer.py
···
131
131
prom_metrics.insert_duration.labels(kind="follow", status=status).observe(
132
132
time() - start_time
133
133
)
134
+
prom_metrics.inserted.labels(kind="follow", status=status).inc(len(follows))
134
135
135
136
def insert_unfollow(self, unfollow: Unfollow):
136
137
to_insert: Optional[List[Unfollow]] = None
···
166
167
finally:
167
168
prom_metrics.insert_duration.labels(kind="unfollow", status=status).observe(
168
169
time() - start_time
170
+
)
171
+
prom_metrics.inserted.labels(kind="unfollow", status=status).inc(
172
+
len(unfollows)
169
173
)
170
174
171
175
def flush_all(self):
+7
metrics.py
+7
metrics.py
···
54
54
documentation="Time taken to insert a batch",
55
55
)
56
56
57
+
self.inserted = Counter(
58
+
name="inserted",
59
+
namespace=NAMESPACE,
60
+
documentation="Number of items inserted",
61
+
labelnames=["kind", "status"],
62
+
)
63
+
57
64
self._initialized = True
58
65
59
66
def start_http(self, port: int, addr: str = "0.0.0.0"):