Skip to content

Commit

Permalink
Log compression statistics;
Browse files Browse the repository at this point in the history
Work relating to #302.
  • Loading branch information
gavinlaking committed Nov 12, 2015
1 parent 642eff6 commit 03b40a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/vedeu/output/compressor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def content

# @return [String]
def compress
Vedeu.timer("Compression for #{content.size} characters".freeze) do
Vedeu.timer("Compression for #{content.size} objects".freeze) do
out = ''

content.each do |cell|
Expand All @@ -68,6 +68,10 @@ def compress
out << cell.value
end

Vedeu.log(type: :output,
message: "Compression: #{content.size} objects -> " \
"#{out.size} characters".freeze)

out
end
end
Expand All @@ -80,6 +84,10 @@ def uncompress
out << cell.to_s
end

Vedeu.log(type: :output,
message: "No compression: #{content.size} objects -> " \
"#{out.size} characters".freeze)

out
end

Expand Down

0 comments on commit 03b40a0

Please sign in to comment.