Append a JSON object to the queue for background writing. :param data: The JSON object to append.
(self, data)
| 159 | atexit.register(self.close) |
| 160 | |
| 161 | def append(self, data): |
| 162 | """ |
| 163 | Append a JSON object to the queue for background writing. |
| 164 | |
| 165 | :param data: The JSON object to append. |
| 166 | """ |
| 167 | data.update({"metrics_dumper_pid": self.pid, "metrics_dumper_timestamp": int(time.time() * 1000)}) |
| 168 | self.queue.put(data) |
| 169 | |
| 170 | def _write_json(self, queue): |
| 171 | """ |