Skip to content

Commit

Permalink
Merge branch 'main' into markdownlint-link
Browse files Browse the repository at this point in the history
  • Loading branch information
xuan-cao-swi authored Sep 13, 2024
2 parents a0c95c5 + eed7060 commit 172744b
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 474 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 172744b

Please sign in to comment.