Skip to content

Commit

Permalink
Remove the async sink since performance did not look stable.
Browse files Browse the repository at this point in the history
  • Loading branch information
nscott committed Jan 17, 2023
1 parent 807010f commit 5a9ff2c
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 212 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ See this https://keepachangelog.com link for information on how we want this docu

### Added

- Two new sinks now exists, `Tcp` and `Async`. The `Tcp` sink can EMF messages to any valid TCP endpoint, and `Async` can wrap any sink to ensure your program isn't impacted by writing to the network/disk/etc.
- Included a new dependency, `tcp-client`. Originally a small hand-written TCP client was used but it proved unreliable and well outside the scope of this library.
- A new `Tcp` sink is added. The `Tcp` sink can send EMF messages to any valid TCP endpoint.
- `tcp-client` will be required at runtime if you use the `Tcp` sink. Originally a small hand-written TCP client was used but it proved unreliable and well outside the scope of this library.
- Added the new `Units` class for easy reference to the accepted metric units.

## v0.6.0
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ gem 'rubocop'
group :test do
gem 'mocha'
gem 'pry'
gem 'tcp-client'
end
48 changes: 26 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,44 @@ PATH
specs:
aws-embedded-metrics-customink (0.7.0)
concurrent-ruby
tcp-client

GEM
remote: https://rubygems.org/
specs:
ast (2.4.1)
ast (2.4.2)
coderay (1.1.3)
concurrent-ruby (1.1.10)
json (2.6.3)
method_source (1.0.0)
minitest (5.14.1)
mocha (1.11.2)
parallel (1.19.2)
parser (2.7.1.4)
minitest (5.17.0)
mocha (2.0.2)
ruby2_keywords (>= 0.0.5)
parallel (1.22.1)
parser (3.2.0.0)
ast (~> 2.4.1)
pry (0.13.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
rainbow (3.0.0)
rake (13.0.1)
regexp_parser (1.7.1)
rexml (3.2.3)
rubocop (0.88.0)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.6.1)
rexml (3.2.5)
rubocop (1.43.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 2.7.1.1)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.7)
rexml
rubocop-ast (>= 0.1.0, < 1.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.24.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.2.0)
parser (>= 2.7.0.1)
ruby-progressbar (1.10.1)
tcp-client (0.11.2)
unicode-display_width (1.7.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.24.1)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
tcp-client (0.11.4)
unicode-display_width (2.4.2)

PLATFORMS
ruby
Expand All @@ -49,6 +52,7 @@ DEPENDENCIES
pry
rake
rubocop
tcp-client

BUNDLED WITH
2.3.5
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Pulled from these two projects using the [Embedded Metric Format Specification](
However, unlike these projects, we differ in the following ways. Again, contributions are very much welcome if you want to see more or change this.

* Initial focus on Lambda. A TCP sink has been added, but no UDP sink exists.
* An async sink wrapper exists that allows messages to be queued and sent on a separate thread.
* No default Dimensions or Configuration for:
- `ServiceName`
- `ServiceType`
Expand Down Expand Up @@ -61,15 +60,6 @@ Aws::Embedded::Metrics.configure do |c|
end
```

Using the `Async` sink wrapper to incur no latency or errors on writes:
```ruby
Aws::Embedded::Metrics.configure do |c|
tcp_sink = Aws::Embedded::Metrics::Sinks::Tcp.new(conn_str: "tcp:https://localhost:25888",
logger: Rails.logger)
c.sink = Aws::Embedded::Metrics::Sinks::Async.new(tcp_sink, logger: Rails.logger, max_queue_size: 1_000)
end
```

Usage is in a scope block. All metrics are flushed afterward

```ruby
Expand Down
1 change: 0 additions & 1 deletion aws-embedded-metrics-customink.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_dependency 'concurrent-ruby'
spec.add_dependency 'tcp-client'
end
1 change: 0 additions & 1 deletion lib/aws-embedded-metrics-customink/sinks.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'aws-embedded-metrics-customink/sinks/async'
require 'aws-embedded-metrics-customink/sinks/logger'
require 'aws-embedded-metrics-customink/sinks/stdout'
require 'aws-embedded-metrics-customink/sinks/tcp'
Expand Down
110 changes: 0 additions & 110 deletions lib/aws-embedded-metrics-customink/sinks/async.rb

This file was deleted.

1 change: 1 addition & 0 deletions lib/aws-embedded-metrics-customink/sinks/tcp.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

gem 'tcp-client'
require 'tcp-client'

module Aws
Expand Down
66 changes: 0 additions & 66 deletions test/cases/sinks/async_test.rb

This file was deleted.

0 comments on commit 5a9ff2c

Please sign in to comment.