(self)
| 398 | self._write_stat() |
| 399 | |
| 400 | def _write_stat(self): |
| 401 | tmp_filename = self._fname + '.tmp' |
| 402 | try: |
| 403 | with open(tmp_filename, 'w') as f: |
| 404 | json.dump(self._stats, f) |
| 405 | shutil.move(tmp_filename, self._fname) |
| 406 | except IOError: # disk error sometimes.. |
| 407 | logger.exception("Exception in JSONWriter._write_stat()!") |
| 408 | |
| 409 | |
| 410 | class ScalarPrinter(MonitorBase): |