Skip to content

Commit

Permalink
Merge branch 'main' into issues-1704
Browse files Browse the repository at this point in the history
  • Loading branch information
xuan-cao-swi authored Sep 4, 2024
2 parents ee5c13a + 3ff81bd commit e5f3bae
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 473 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def send_bytes(bytes, timeout:)
@http.read_timeout = remaining_timeout
@http.write_timeout = remaining_timeout
@http.start unless @http.started?
response = measure_request_duration { @http.request(request) }
response = @http.request(request)
case response
when Net::HTTPOK
response.body # Read and discard body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Exporter
module OTLP
module Metrics
# Util module provide essential functionality for exporter
module Util # rubocop:disable Metrics/ModuleLength
module Util
KEEP_ALIVE_TIMEOUT = 30
RETRY_COUNT = 5
ERROR_MESSAGE_INVALID_HEADERS = 'headers must be a String with comma-separated URL Encoded UTF-8 k=v pairs or a Hash'
Expand Down Expand Up @@ -67,16 +67,6 @@ def prepare_headers(config_headers)
headers
end

def measure_request_duration
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
begin
yield
ensure
stop = Process.clock_gettime(Process::CLOCK_MONOTONIC)
1000.0 * (stop - start)
end
end

def parse_headers(raw)
entries = raw.split(',')
raise ArgumentError, ERROR_MESSAGE_INVALID_HEADERS if entries.empty?
Expand Down

This file was deleted.

Loading

0 comments on commit e5f3bae

Please sign in to comment.