Created
February 11, 2014 20:31
-
-
Save toddboom/8943459 to your computer and use it in GitHub Desktop.
influxdb-rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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