github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

igrigorik / gmetric

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 30
    • 3
  • Source
  • Commits
  • Network (3)
  • Issues (0)
  • Downloads (0)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Switch Branches (1)
    • master ✓
  • Switch Tags (0)
  • Branch List
Sending Request…

Pure Ruby interface for generating Ganglia gmetric packets — Read more

  Cancel

http://www.igvita.com/2010/01/28/cluster-monitoring-with-ganglia-ruby/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

up version number, version gemspec 
igrigorik (author)
Thu Jul 29 06:42:16 -0700 2010
commit  9d694b523e2bf1cfa73f
tree    a527bdf06e09d096b80e
parent  161a3c70708cddcbe081
gmetric /
name age
history
message
file README.rdoc Fri Jan 29 19:28:06 -0800 2010 allow true/false for host spoofing [igrigorik]
file Rakefile Thu Jan 28 06:20:41 -0800 2010 Version bump to 0.1.0 [igrigorik]
file VERSION Thu Jul 29 06:42:16 -0700 2010 up version number, version gemspec [igrigorik]
file gmetric.gemspec Thu Jul 29 06:42:16 -0700 2010 up version number, version gemspec [igrigorik]
directory lib/ Thu Jul 29 06:41:24 -0700 2010 use EM reactor if used within event loop [igrigorik]
directory spec/ Thu Jul 29 06:41:24 -0700 2010 use EM reactor if used within event loop [igrigorik]
README.rdoc

GMetric

A pure Ruby client for generating Ganglia 3.1.x+ gmetric meta and metric packets and talking to your gmond / gmetad nodes over UDP protocol. Supports host spoofing, and all the same parameters as the gmetric command line executable.

  • www.igvita.com/2010/01/28/cluster-monitoring-with-ganglia-ruby/

Example: Sending a gmetric to a gmond over UDP

  Ganglia::GMetric.send("127.0.0.1", 8670, {
    :name => 'pageviews',
    :units => 'req/min',
    :type => 'uint8',
    :value => 7000,
    :tmax => 60,
    :dmax => 300
  })

Example: Generating the Meta and Metric packets

  g = Ganglia::GMetric.pack(
    :slope => 'positive',
    :name => 'ruby',
    :value => rand(100),
    :tmax => 60,
    :units => '',
    :dmax => 60,
    :type => 'uint8'
  )

  # g[0] = meta packet
  # g[1] = gmetric packet

  s = UDPSocket.new
  s.connect("127.0.0.1", 8670)
  s.send g[0], 0
  s.send g[1], 0

License

(The MIT License)

Copyright © 2009 Ilya Grigorik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文