Skip to content

Commit

Permalink
appeasing rubocop
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Tanaka <[email protected]>

fixing ci

Signed-off-by: Pedro Tanaka <[email protected]>
  • Loading branch information
pedro-stanaka committed Dec 18, 2024
1 parent c2aa9cd commit 38ce5c2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: push
jobs:
test:
name: Ruby ${{ matrix.ruby }} on ubuntu-latest
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 0 additions & 1 deletion lib/statsd/instrument/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ def service_check(name, status, timestamp: nil, hostname: nil, tags: nil, messag
# @note Supported by the Datadog implementation only.
def event(title, text, timestamp: nil, hostname: nil, aggregation_key: nil, priority: nil,
source_type_name: nil, alert_type: nil, tags: nil, no_prefix: false)

emit(datagram_builder(no_prefix: no_prefix)._e(
title,
text,
Expand Down
1 change: 0 additions & 1 deletion lib/statsd/instrument/dogstatsd_datagram_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def latency_metric_type
# @see https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/#events
def _e(title, text, timestamp: nil, hostname: nil, aggregation_key: nil, priority: nil,
source_type_name: nil, alert_type: nil, tags: nil)

escaped_title = "#{@prefix}#{title}".gsub("\n", '\n')
escaped_text = text.gsub("\n", '\n')

Expand Down
1 change: 0 additions & 1 deletion lib/statsd/instrument/expectation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def histogram(name, value = nil, **options)

def initialize(client: nil, type:, name:, value: nil,
sample_rate: nil, tags: nil, no_prefix: false, times: 1)

@type = type
@name = no_prefix ? name : StatsD::Instrument::Helpers.prefix_metric(name, client: client)
@value = normalized_value_for_type(type, value) if value
Expand Down
1 change: 0 additions & 1 deletion lib/statsd/instrument/strict.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def service_check(name, status, tags: nil, no_prefix: false, hostname: nil, time

def event(title, text, tags: nil, no_prefix: false,
hostname: nil, timestamp: nil, aggregation_key: nil, priority: nil, source_type_name: nil, alert_type: nil)

super
end

Expand Down
10 changes: 6 additions & 4 deletions test/environment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_client_from_env_uses_uds_sink_with_correct_packet_size_in_production
"STATSD_ENV" => "production",
"STATSD_SOCKET_PATH" => "/tmp/statsd.sock",
"STATSD_MAX_PACKET_SIZE" => "65507",
"STATSD_USE_NEW_CLIENT" => "1"
"STATSD_USE_NEW_CLIENT" => "1",
)

client = env.client
Expand All @@ -97,16 +97,18 @@ def test_client_from_env_uses_default_packet_size_for_uds_when_not_specified
env = StatsD::Instrument::Environment.new(
"STATSD_ENV" => "production",
"STATSD_SOCKET_PATH" => "/tmp/statsd.sock",
"STATSD_USE_NEW_CLIENT" => "1"
"STATSD_USE_NEW_CLIENT" => "1",
)

client = env.client
sink = client.sink
connection = sink.connection

assert_kind_of(StatsD::Instrument::UdsConnection, connection)
assert_equal(StatsD::Instrument::UdsConnection::DEFAULT_MAX_PACKET_SIZE,
connection.instance_variable_get(:@max_packet_size))
assert_equal(
StatsD::Instrument::UdsConnection::DEFAULT_MAX_PACKET_SIZE,
connection.instance_variable_get(:@max_packet_size),
)
end

def test_client_from_env_uses_batched_uds_sink_with_correct_packet_size
Expand Down

0 comments on commit 38ce5c2

Please sign in to comment.