Permalink
Browse files

Tiny example for the metrics agent

  • Loading branch information...
1 parent 1eb778e commit c5d8cf7692687f26480564e08346fb2a3097b39c @paukul committed Aug 5, 2011
Showing with 21 additions and 0 deletions.
  1. +21 −0 examples/metrics.rb
View
@@ -0,0 +1,21 @@
+require 'rubygems'
+require 'bundler'
+Bundler.require
+
+logger = Logger.new($stdout)
+agent = AMQPLogging::MetricsAgent.new
+agent.wrap_logger(logger)
+agent.logger = Logger.new("agent.log")
+
+logger.debug "1. foo"
+logger.info "1. bar"
+logger.warn "1. baz"
+
+agent.flush
+
+logger.debug "2. foo"
+logger.info "2. bar"
+logger.warn "2. baz"
+
+agent.flush
+

0 comments on commit c5d8cf7

Please sign in to comment.