Logs json stats. Args: stats (dict): a dictionary of statistical information to log.
(stats)
| 85 | |
| 86 | |
| 87 | def log_json_stats(stats): |
| 88 | """ |
| 89 | Logs json stats. |
| 90 | Args: |
| 91 | stats (dict): a dictionary of statistical information to log. |
| 92 | """ |
| 93 | stats = { |
| 94 | k: decimal.Decimal("{:.5f}".format(v)) if isinstance(v, float) else v |
| 95 | for k, v in stats.items() |
| 96 | } |
| 97 | json_stats = simplejson.dumps(stats, sort_keys=True, use_decimal=True) |
| 98 | logger = get_logger(__name__) |
| 99 | logger.info("json_stats: {:s}".format(json_stats)) |
nothing calls this directly
no test coverage detected