ffwd 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ffwd/debug/monitor_session.rb +1 -0
- data/lib/ffwd/plugin/json.rb +13 -2
- data/lib/ffwd/processor/count.rb +1 -1
- data/lib/ffwd/producing_client.rb +10 -5
- data/lib/ffwd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d359f0408acc2d8dc01aefbe73d265da27a87588
|
4
|
+
data.tar.gz: 079caae120a06beb6907796af8f7fd750cf11ffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf92d43e1a7542b291bd46ef5ccb12cda382b881ce1c2addbb882debd1c66c39d449b9f1ddfff217a923ea94e9ea9bcd391db92a764d3e259777ac4054ecf922
|
7
|
+
data.tar.gz: 76daa87ebb9972b3cfeb095d2fea347de78ff1bb46cb998ddd19c40dccb95aeaa783b33c2758899e3988047c0f048ae91436c4952aabb9d0f6d58ab8f8c6a3da
|
data/lib/ffwd/plugin/json.rb
CHANGED
@@ -27,7 +27,7 @@ module FFWD::Plugin::JSON
|
|
27
27
|
|
28
28
|
DEFAULT_HOST = "localhost"
|
29
29
|
DEFAULT_PORT = 19000
|
30
|
-
DEFAULT_PROTOCOL = "tcp"
|
30
|
+
DEFAULT_PROTOCOL = {"line" => "tcp", "frame" => "udp"}
|
31
31
|
DEFAULT_KIND = "line"
|
32
32
|
|
33
33
|
register_plugin "json",
|
@@ -80,11 +80,22 @@ module FFWD::Plugin::JSON
|
|
80
80
|
KINDS = {"frame" => FrameConnection, "line" => LineConnection}
|
81
81
|
|
82
82
|
def self.setup_input opts, core
|
83
|
-
protocol = FFWD.parse_protocol opts[:protocol] || DEFAULT_PROTOCOL
|
84
83
|
kind = (opts[:kind] || DEFAULT_KIND).to_s
|
85
84
|
raise "No such kind: #{kind}" unless connection = KINDS[kind]
|
85
|
+
protocol = FFWD.parse_protocol opts[:protocol] || DEFAULT_PROTOCOL[kind]
|
86
86
|
opts[:host] ||= DEFAULT_HOST
|
87
87
|
opts[:port] ||= DEFAULT_PORT
|
88
|
+
|
89
|
+
if connection == FrameConnection and protocol != FFWD::UDP
|
90
|
+
log.warning "When using :frame kind, you should use the UDP protocol." +
|
91
|
+
" Not #{protocol.family.to_s.upcase}"
|
92
|
+
end
|
93
|
+
|
94
|
+
if connection == LineConnection and protocol != FFWD::TCP
|
95
|
+
log.warning "When using :line kind, you should use the TCP protocol. " +
|
96
|
+
"Not #{protocol.family.to_s.upcase}"
|
97
|
+
end
|
98
|
+
|
88
99
|
protocol.bind opts, core, log, connection
|
89
100
|
end
|
90
101
|
|
data/lib/ffwd/processor/count.rb
CHANGED
@@ -146,15 +146,20 @@ module FFWD
|
|
146
146
|
return
|
147
147
|
end
|
148
148
|
|
149
|
+
# store buffer sizes for use in callbacks.
|
150
|
+
events_size = @events.size
|
151
|
+
metrics_size = @metrics.size
|
152
|
+
|
149
153
|
@request.callback do
|
150
|
-
increment :sent_events,
|
151
|
-
increment :sent_metrics,
|
154
|
+
increment :sent_events, events_size
|
155
|
+
increment :sent_metrics, metrics_size
|
152
156
|
@request = nil
|
153
157
|
end
|
154
158
|
|
155
|
-
@request.errback do
|
156
|
-
|
157
|
-
increment :
|
159
|
+
@request.errback do |e|
|
160
|
+
log.error "Failed to produce", e
|
161
|
+
increment :failed_events, events_size
|
162
|
+
increment :failed_metrics, metrics_size
|
158
163
|
@request = nil
|
159
164
|
end
|
160
165
|
rescue => e
|
data/lib/ffwd/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffwd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John-John Tedro
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|