Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/benchmark/tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

Benchmark.ips do |bench|
bench.report("normalized tags with simple hash") do
StatsD::Instrument::Metric.normalize_tags(tag: "value")
StatsD::Instrument::DatagramBuilder.new.normalize_tags(tag: "value")
end

bench.report("normalized tags with simple array") do
StatsD::Instrument::Metric.normalize_tags(["test:test"])
StatsD::Instrument::DatagramBuilder.new.normalize_tags(["test:test"])
end

bench.report("normalized tags with large hash") do
StatsD::Instrument::Metric.normalize_tags(
StatsD::Instrument::DatagramBuilder.new.normalize_tags(
mobile: true,
pod: "1",
protocol: "https",
Expand All @@ -24,7 +24,7 @@
end

bench.report("normalized tags with large array") do
StatsD::Instrument::Metric.normalize_tags([
StatsD::Instrument::DatagramBuilder.new.normalize_tags([
"mobile:true",
"pod:1",
"protocol:https",
Expand Down
12 changes: 3 additions & 9 deletions test/dispatcher_stats_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,15 @@ def test_calculations_are_correct
end
assert_equal(batches.length, stats.instance_variable_get(:@batched_sends))
assert_equal(
batches.map { |b|
b[:buffer_len]
}.sum / batches.length,
batches.map { |b| b[:buffer_len] }.sum / batches.length,
stats.instance_variable_get(:@avg_buffer_length),
)
assert_equal(
batches.map { |b|
b[:packet_size]
}.sum / batches.length,
batches.map { |b| b[:packet_size] }.sum / batches.length,
stats.instance_variable_get(:@avg_batched_packet_size),
)
assert_equal(
batches.map { |b|
b[:batch_len]
}.sum / batches.length,
batches.map { |b| b[:batch_len] }.sum / batches.length,
stats.instance_variable_get(:@avg_batch_length),
)
end
Expand Down
Loading