{"id":16726871,"url":"https://github.com/tpitale/tremolo","last_synced_at":"2025-04-10T10:32:01.890Z","repository":{"id":19786701,"uuid":"23045760","full_name":"tpitale/tremolo","owner":"tpitale","description":"InfluxDB UDP Tracker built on Celluloid::IO","archived":false,"fork":false,"pushed_at":"2016-04-28T14:44:43.000Z","size":26,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T09:21:09.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpitale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-17T17:17:10.000Z","updated_at":"2023-02-01T11:01:13.000Z","dependencies_parsed_at":"2022-09-20T22:01:18.443Z","dependency_job_id":null,"html_url":"https://github.com/tpitale/tremolo","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpitale%2Ftremolo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpitale%2Ftremolo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpitale%2Ftremolo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpitale%2Ftremolo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpitale","download_url":"https://codeload.github.com/tpitale/tremolo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199136,"owners_count":21063641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T22:54:49.262Z","updated_at":"2025-04-10T10:32:01.866Z","avatar_url":"https://github.com/tpitale.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tremolo\n\nInfluxDB UDP Tracker built on Celluloid::IO\n\n[![Build Status](https://travis-ci.org/tpitale/tremolo.svg?branch=master)](https://travis-ci.org/tpitale/tremolo)\n[![Code Climate](https://codeclimate.com/github/tpitale/tremolo.png)](https://codeclimate.com/github/tpitale/tremolo)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'tremolo'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install tremolo\n\n## Is it any good? ##\n\nIt's getting there, but some of the nuance of the method API and Celluloid's behavior are still being worked out. I'll let you know when it's settled down a bit more.\n\n## Usage ##\n\n```ruby\n# Start by creating a supervised tracker\n#   and point it at our InfluxDB server's UDP port\nTremolo.supervised_tracker(:tracker, '0.0.0.0', 4444)\n\n# options that can be set on the tracker:\n# namespace, a string prefix for all series names on this tracker, joined with '.' (default=\"\")\ntracker = Tremolo.supervised_tracker(:tracker, '0.0.0.0', 4444, namespace: 'appname')\n\n# whenever you want to use this tracker, you can fetch it\ntracker = Tremolo.fetch(:tracker)\n\n# if there is no tracker by this name, it will return a NoopTracker\n#   useful when in testing or development\ntracker = Tremolo.fetch(:notreallythere)\n```\n\nNow that we have our tracker, let's send some data to InfluxDB:\n\n```ruby\n# Write a point to 'series-name' series\ntracker.write_point('series-name', {:value =\u003e 121, :otherdata =\u003e 998142})\n\n# Create a series for repeated tracking\nseries = tracker.series('series-name')\n\n# Write multiple points to the series with this name\nseries.write_point({:value =\u003e 18, :otherdata =\u003e 1986})\nseries.write_point({:value =\u003e 82, :otherdata =\u003e 1984})\nseries.write_point({:value =\u003e 11, :otherdata =\u003e 1984})\n\n# track a value of 1 to a series\ntracker.increment('count.series-name')\nseries = tracker.series('count.series-name')\nseries.increment\n\n# track a value of -1 to a series\ntracker.decrement('count.series-name')\nseries = tracker.series('count.series-name')\nseries.increment\n\n# send some timing data\ntracker.timing('timing.series-name', 48) # integer for ms\nseries = tracker.series('timing.series-name')\nseries.timing(210)\n\n# returns the result of the block, and tracks the timing into series-name\nvalue = tracker.time('timing.series-name') { Net::HTTP.get(URI('http://google.com')) }\nseries = tracker.series('timing.series-name')\nvalue = series.time { Net::HTTP.get(URI('http://google.com')) }\n```\n\n## Tags ##\n\nA Hash of `tags` data can be passed to `increment`, `decrement`, `timing`, `time`, and `write_point`, as the last argument. Very useful for segmenting data by some \"metadata\".\n\n```ruby\nseries.write_point({:value =\u003e 18}, {:otherdata =\u003e 1986})\n```\n\n## Databases, Namespace and Series names\n\nSince version 0.7.1 of InfluxDB, multiple databases can be configured for different UDP ports. All\ntracking in Tremolo is done by way of UDP.\n\nSo, port 4444 from the examples above goes to one database as configured, and port 8191 could go to a second DB.\n\nThis somewhat negates the need for the `namespace` option to be set for a `tracker` since each application\ncould be configured to go to its own InfluxDB database.\n\n**Note** If disconnected, the tracker will silently fail to send stats to InfluxDB. These stats will be lost.\nIt will try to send each time, though. so when the server comes back up stats will begin sending again.\n\nSome thought should be given to the design and structure of the namespace and series name. I like to have pattern like:\n\n* use 'count.series-names' for any individual values, such as `increment` and `decrement`\n* use 'timing.series-names' for any value tracked as milliseconds\n\n**Note** The default precision is `ms` it appears. So far there is no way to configure `time_precision` when using UDP. More info here: http://influxdb.com/docs/v0.7/api/reading_and_writing_data.html#time-precision-on-written-data\n\n**Note** Be careful passing data to `write_point` that includes the keys `time` or `sequence_number`, they have special meaning to InfluxDB: http://influxdb.com/docs/v0.7/api/reading_and_writing_data.html#specifying-time-and-sequence-number-on-writes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpitale%2Ftremolo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpitale%2Ftremolo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpitale%2Ftremolo/lists"}