Permalink
Browse files

Merge remote-tracking branch 'origin/patch-1'

  • Loading branch information...
2 parents 006d217 + d2bac11 commit f8929c482da91967da1914e78d2f5e0d7326daf5 @gja committed Mar 7, 2012
Showing with 8 additions and 6 deletions.
  1. +1 −0 CHANGELOG
  2. +5 −4 lib/logstash/event.rb
  3. +2 −2 lib/logstash/outputs/ganglia.rb
View
@@ -5,6 +5,7 @@
* New filter plugins: zeromq
* Fixes for gelf output
* Fixes for elasticsearch_river output
+ * Fixes for ganglia output
## IMPORTANT CHANGES FOR UPGRADES FROM 1.1.0
- zeromq input and output rewritten
View
@@ -69,11 +69,12 @@ def timestamp=(val); @data["@timestamp"] = val; end # def timestamp=
public
def unix_timestamp
if RUBY_ENGINE != "jruby"
- # TODO(sissel): LOGSTASH-217
- raise Exception.new("LogStash::Event#unix_timestamp is not supported yet in this version of ruby")
+ # This is really slow. See LOGSTASH-217
+ return Time.parse(timestamp).to_f
+ else
+ time = @@date_parser.parseDateTime(timestamp)
+ return time.getMillis.to_f / 1000
end
- time = @@date_parser.parseDateTime(timestamp)
- return time.getMillis.to_f / 1000
end
public
@@ -44,7 +44,7 @@ def receive(event)
return unless output?(event)
# gmetric only takes integer values, so convert it to int.
- case @type
+ case @metric_type
when "string"
localvalue = event.sprintf(@value)
when "float"
@@ -57,7 +57,7 @@ def receive(event)
Ganglia::GMetric.send(@host, @port, {
:name => event.sprintf(@metric),
:units => @units,
- :type => @type,
+ :type => @metric_type,
:value => localvalue,
:tmax => @tmax,
:dmax => @dmax

0 comments on commit f8929c4

Please sign in to comment.