marquise 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/marquise.rb +12 -2
- metadata +4 -4
data/.gitignore
CHANGED
data/lib/marquise.rb
CHANGED
@@ -41,8 +41,13 @@ class Marquise
|
|
41
41
|
# possibility of losing data points in the event of a spectacular
|
42
42
|
# failure, but also improves performance.
|
43
43
|
def initialize(zmq_url, batch_period = 5)
|
44
|
+
if ENV['LIBMARQUISE_ORIGIN'].nil?
|
45
|
+
raise RuntimeError,
|
46
|
+
"LIBMARQUISE_ORIGIN env var not set -- Marquise will not work"
|
47
|
+
end
|
48
|
+
|
44
49
|
@consumer = Marquise::FFI.marquise_consumer_new(zmq_url, batch_period)
|
45
|
-
|
50
|
+
|
46
51
|
if @consumer.nil?
|
47
52
|
raise RuntimeError,
|
48
53
|
"libmarquise failed; check syslog (no, seriously)"
|
@@ -61,6 +66,11 @@ class Marquise
|
|
61
66
|
"Connection has been closed"
|
62
67
|
end
|
63
68
|
|
69
|
+
if connection.nil?
|
70
|
+
raise RuntimeError,
|
71
|
+
"Connection is nil -- this is a bad thing"
|
72
|
+
end
|
73
|
+
|
64
74
|
val, ts, opts = parse_tell_opts(args)
|
65
75
|
|
66
76
|
k, v, len = if opts.length == 0
|
@@ -79,7 +89,7 @@ class Marquise
|
|
79
89
|
k,
|
80
90
|
v,
|
81
91
|
len,
|
82
|
-
ts.to_f * 1_000_000_000
|
92
|
+
(ts.to_f * 1_000_000_000).to_i
|
83
93
|
)
|
84
94
|
elsif val.respond_to? :to_str and val.respond_to? :encoding
|
85
95
|
s = val.to_str
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marquise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -240,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
240
|
version: '0'
|
241
241
|
segments:
|
242
242
|
- 0
|
243
|
-
hash:
|
243
|
+
hash: 532184526219450439
|
244
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
245
|
none: false
|
246
246
|
requirements:
|
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
249
|
version: '0'
|
250
250
|
segments:
|
251
251
|
- 0
|
252
|
-
hash:
|
252
|
+
hash: 532184526219450439
|
253
253
|
requirements: []
|
254
254
|
rubyforge_project:
|
255
255
|
rubygems_version: 1.8.23
|