Skip to content

Instantly share code, notes, and snippets.

@will
Created June 16, 2009 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save will/130946 to your computer and use it in GitHub Desktop.
Save will/130946 to your computer and use it in GitHub Desktop.
require 'metric_fu'
task "metrics:all" do
require 'yaml'
require 'couchrest'
require 'grit'
report = File.open( File.join( RAILS_ROOT, "tmp", "metric_fu", "report.yml") ) { |f| YAML::load f }
repo = Grit::Repo.new(Dir.pwd)
commit = repo.commits.first
record = {
"_id" => commit.id,
:message => commit.message,
:date => commit.date,
:committer => { :name => commit.committer.name, :email => commit.committer.email },
:report => report
}
db = CouchRest.database!("http://localhost:5984/metric_fu")
begin
db.save_doc record
rescue RestClient::RequestFailed
record["_rev"] = db.get(record["_id"])["_rev"]
db.save_doc record
end
end
@brynary
Copy link

brynary commented Nov 11, 2011

Hey Will,

This came across my Google Alerts. Are you still using this?

-Bryan

@will
Copy link
Author

will commented Nov 11, 2011

No, but it was great when I was, had it on my CI server

@brynary
Copy link

brynary commented Nov 11, 2011

Cool. Very interesting. How did you use it?

You might find what I've been working on useful: https://codeclimate.com/

It's in some ways like hosted metric_fu that keeps track of stats over time and makes it easier to use.

-Bryan

@will
Copy link
Author

will commented Nov 11, 2011

Yeah it was for seeing trends over time, with some adhoc scripts. Your thing does look cool, I'll see if I can get the okay to run some internal heroku stuff through it.

@brynary
Copy link

brynary commented Nov 11, 2011

Awesome. Let me know how it goes. If you have any feedback I'd love to hear it!

-Bryan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment