Skip to content

Commit 268a16d

Browse files
committed
Compress serialized of perf stats
1 parent 05797c6 commit 268a16d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/serialization.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ Base.convert(::Type{LinuxPerf.Stats}, d::Dict{String}) = LinuxPerf.Stats(d["thre
4040
function Base.convert(::Type{LinuxPerf.ThreadStats}, d::Dict{String})
4141
return LinuxPerf.ThreadStats(d["pid"], d["groups"])
4242
end
43-
function Base.convert(::Type{LinuxPerf.EventType}, d::Dict{String})
44-
return LinuxPerf.EventType(d["category"], d["event"])
45-
end
46-
function Base.convert(::Type{LinuxPerf.Counter}, d::Dict{String})
43+
JSON.lower(counter::LinuxPerf.Counter) = [counter.event.category, counter.event.event, counter.value, counter.enabled, counter.running]
44+
function Base.convert(::Type{LinuxPerf.Counter}, v::Vector)
4745
return LinuxPerf.Counter(
48-
convert(LinuxPerf.EventType, d["event"]), d["value"], d["enabled"], d["running"]
46+
LinuxPerf.EventType(v[1], v[2]),
47+
v[3],
48+
v[4],
49+
v[5],
4950
)
5051
end
5152

0 commit comments

Comments
 (0)