Skip to content

Instantly share code, notes, and snippets.

@toddboom
Created February 11, 2014 20:31
Show Gist options
  • Select an option

  • Save toddboom/8943459 to your computer and use it in GitHub Desktop.

Select an option

Save toddboom/8943459 to your computer and use it in GitHub Desktop.
influxdb-rails
# install the gem
gem "influxdb-rails"
# generate the initializer
rails generate influxdb
# what the initializer looks like
InfluxDB::Rails.configure do |config|
config.influxdb_database = "rails"
config.influxdb_username = "root"
config.influxdb_password = "root"
config.influxdb_host = "localhost"
config.influxdb_port = 8086
# config.series_name_for_controller_runtimes = "rails.controller"
# config.series_name_for_view_runtimes = "rails.view"
# config.series_name_for_db_runtimes = "rails.db"
end
# write some custom data
InfluxDB::Rails.client.write_point "page_views", {url: "/foo", user_id: user.id}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment