Sha256: 6191ae83a56adbf196d32b6628b7a5c40df39b87feab71017f090e53980388b1

Contents?: true

Size: 647 Bytes

Versions: 37

Compression:

Stored size: 647 Bytes

Contents

require 'knife-spork/plugins/plugin'

module KnifeSpork
  module Plugins
    class Graphite < Plugin
      name :graphite
      hooks :after_promote_remote

      def perform
        environments.each do |environment|
          begin
            message = "deploys.chef.#{environment} 1 #{Time.now.to_i}\n"
            socket = TCPSocket.open(config.server, config.port)
            socket.write(message)
          rescue Exception => e
            ui.error 'Graphite was unable to process the request.'
            ui.error e.to_s
          ensure
            socket.close unless socket.nil?
          end
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
knife-spork-1.7.2 lib/knife-spork/plugins/graphite.rb
knife-spork-1.7.1 lib/knife-spork/plugins/graphite.rb
knife-spork-1.7.0 lib/knife-spork/plugins/graphite.rb
knife-spork-1.6.3 lib/knife-spork/plugins/graphite.rb
knife-spork-1.6.2 lib/knife-spork/plugins/graphite.rb
knife-spork-1.6.1 lib/knife-spork/plugins/graphite.rb
knife-spork-1.6.0 lib/knife-spork/plugins/graphite.rb
knife-spork-1.5.1 lib/knife-spork/plugins/graphite.rb
knife-spork-1.5.0 lib/knife-spork/plugins/graphite.rb
knife-spork-1.4.2 lib/knife-spork/plugins/graphite.rb
knife-spork-1.4.1 lib/knife-spork/plugins/graphite.rb
knife-spork-1.4.0 lib/knife-spork/plugins/graphite.rb
knife-spork-1.3.4 lib/knife-spork/plugins/graphite.rb
knife-spork-1.3.3 lib/knife-spork/plugins/graphite.rb
knife-spork-berks-1.3.2 lib/knife-spork/plugins/graphite.rb
knife-spork-1.3.2 lib/knife-spork/plugins/graphite.rb
knife-spork-1.3.1 lib/knife-spork/plugins/graphite.rb
knife-spork-1.3.0 lib/knife-spork/plugins/graphite.rb
knife-spork-1.2.2 lib/knife-spork/plugins/graphite.rb
knife-spork-1.2.1 lib/knife-spork/plugins/graphite.rb