mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Change JSON timing values to seconds as a float
This commit is contained in:
parent
4eb8eadd9e
commit
44e681ae79
2 changed files with 6 additions and 6 deletions
|
@ -20,7 +20,7 @@ module Spectator
|
||||||
# and fields specific to finished results.
|
# and fields specific to finished results.
|
||||||
private def add_json_fields(json : ::JSON::Builder)
|
private def add_json_fields(json : ::JSON::Builder)
|
||||||
super
|
super
|
||||||
json.field("time", elapsed.to_s)
|
json.field("time", elapsed.total_seconds)
|
||||||
json.field("expectations", expectations)
|
json.field("expectations", expectations)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -58,9 +58,9 @@ module Spectator::Formatting
|
||||||
private def timing(report)
|
private def timing(report)
|
||||||
@json.field("timing") do
|
@json.field("timing") do
|
||||||
@json.object do
|
@json.object do
|
||||||
@json.field("runtime", report.runtime.to_s)
|
@json.field("runtime", report.runtime.total_seconds)
|
||||||
@json.field("examples", report.example_runtime.to_s)
|
@json.field("examples", report.example_runtime.total_seconds)
|
||||||
@json.field("overhead", report.overhead_time.to_s)
|
@json.field("overhead", report.overhead_time.total_seconds)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -70,7 +70,7 @@ module Spectator::Formatting
|
||||||
@json.field("profile") do
|
@json.field("profile") do
|
||||||
@json.object do
|
@json.object do
|
||||||
@json.field("count", profile.size)
|
@json.field("count", profile.size)
|
||||||
@json.field("time", profile.total_time.to_s)
|
@json.field("time", profile.total_time.total_seconds)
|
||||||
@json.field("percentage", profile.percentage)
|
@json.field("percentage", profile.percentage)
|
||||||
@json.field("results") do
|
@json.field("results") do
|
||||||
@json.array do
|
@json.array do
|
||||||
|
@ -87,7 +87,7 @@ module Spectator::Formatting
|
||||||
private def profile_entry(result)
|
private def profile_entry(result)
|
||||||
@json.object do
|
@json.object do
|
||||||
@json.field("example", result.example)
|
@json.field("example", result.example)
|
||||||
@json.field("time", result.elapsed.to_s)
|
@json.field("time", result.elapsed.total_seconds)
|
||||||
@json.field("source", result.example.source)
|
@json.field("source", result.example.source)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue