Skip to content

Instantly share code, notes, and snippets.

@will
Created June 16, 2009 22:27
Show Gist options
  • Select an option

  • Save will/130946 to your computer and use it in GitHub Desktop.

Select an option

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

brynary commented Nov 11, 2011

Copy link
Copy Markdown

Hey Will,

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

-Bryan

@will

will commented Nov 11, 2011

Copy link
Copy Markdown
Author

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

@brynary

brynary commented Nov 11, 2011

Copy link
Copy Markdown

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

will commented Nov 11, 2011

Copy link
Copy Markdown
Author

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

brynary commented Nov 11, 2011

Copy link
Copy Markdown

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