mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-02-12 12:56:58 +00:00
20 lines
328 B
Nim
20 lines
328 B
Nim
|
import asyncprofiler
|
||
|
|
||
|
import ../json
|
||
|
|
||
|
|
||
|
proc `%`*(o: MetricsSummary): JsonNode =
|
||
|
var rows = newJArray()
|
||
|
for (location, metric) in o.pairs:
|
||
|
var row = %(metric)
|
||
|
row["location"] = %(location[])
|
||
|
rows.add(row)
|
||
|
|
||
|
rows
|
||
|
|
||
|
proc `%`*(o: Duration): JsonNode =
|
||
|
%(o.nanoseconds)
|
||
|
|
||
|
proc `%`*(o: cstring): JsonNode =
|
||
|
%($(o))
|