GithubHelp home page GithubHelp logo

simple-graphite's Introduction

simple-graphite

A simple interface to Graphite.

Compatible with 1.9.x, 2.0.x, and 2.1.0-preview1.

<img src=“https://drone.io/github.com/imeyer/simple-graphite/status.png”/>

How-to

%w{simple-graphite}.each { |l| require l } # Must require rubygems on < 1.9.x
g = Graphite.new({:host => "your.graphite.host", :port => 2003})

or

g = Graphite.new
g.host = 'your.graphite.host'
g.port = 2003

To push data to Graphite:

g.push_to_graphite do |graphite|
  graphite.puts "your.metric.name 3.1415926 #{g.time_now}"
end

Or:

g.send_metrics({
  'foo.bar1' => 250,
  'foo.bar2' => 114
})

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Ian Meyer. See LICENSE for details.

simple-graphite's People

Contributors

imeyer avatar mckern avatar pdf avatar pelletier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

simple-graphite's Issues

Version installed by gem is out of date

Heya, Not being an expert with the underlying mechanisms of the 'gem' distribution system, I'm not quite sure where to ask this.. However, the version of simple-graphite that is is currently available via 'gem install simple-graphite', currently, seems to be out of date?

The send_metrics function doesn't appear to exist, so I'm guessing that it represents an older version of the library.

Is this something that you maintain or have any level of control over?

Ordering of "Graphite sends metrics from an hash" test

When running that test, I think as hashes aren't ordering dependent on 1.8.7. I get the following:

[enlil:simple-graphite]% rspec ./spec/simple-graphite_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
.....

Finished in 0.00159 seconds
5 examples, 0 failures
[enlil:simple-graphite]% rspec ./spec/simple-graphite_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
....F

Failures:

  1) Graphite sends metrics from an hash
     Failure/Error: ftcp.buffer.should == "foo.bar 200 #{time}\nfoo.test 10.2 #{time}\n"
       expected: "foo.bar 200 1340930488\nfoo.test 10.2 1340930488\n"
            got: "foo.test 10.2 1340930488\nfoo.bar 200 1340930488\n" (using ==)
       Diff:
       
       @@ -1,3 +1,3 @@
       -foo.bar 200 1340930488
        foo.test 10.2 1340930488
       +foo.bar 200 1340930488
     # ./spec/simple-graphite_spec.rb:40

Finished in 0.00215 seconds
5 examples, 1 failure

Failed examples:

rspec ./spec/simple-graphite_spec.rb:32 # Graphite sends metrics from an hash

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.