{"id":13463857,"url":"https://github.com/janajri/analytics-influxdb","last_synced_at":"2025-03-25T09:31:11.547Z","repository":{"id":30933596,"uuid":"34491587","full_name":"janajri/analytics-influxdb","owner":"janajri","description":"Simple analytics logging for InfluxDB","archived":true,"fork":false,"pushed_at":"2021-08-24T13:56:23.000Z","size":10,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T21:44:20.570Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/janajri.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGE.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-24T01:40:53.000Z","updated_at":"2024-03-06T03:31:25.000Z","dependencies_parsed_at":"2022-09-14T02:30:44.950Z","dependency_job_id":null,"html_url":"https://github.com/janajri/analytics-influxdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janajri%2Fanalytics-influxdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janajri%2Fanalytics-influxdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janajri%2Fanalytics-influxdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janajri%2Fanalytics-influxdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janajri","download_url":"https://codeload.github.com/janajri/analytics-influxdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245097841,"owners_count":20560316,"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-07-31T14:00:29.486Z","updated_at":"2025-03-25T09:31:08.915Z","avatar_url":"https://github.com/janajri.png","language":"JavaScript","funding_links":[],"categories":["Performance"],"sub_categories":[],"readme":"[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n# DEPRECATED Analytics-InfluxDB\n\nSimple analytics logging for InfluxDB, heavily inspired by [analytics-node](https://github.com/segmentio/analytics-node)\n\nInstantiate a new series queue to begin recording json data\n\n\n###Install: \n  \n  - `npm install analytics-influxdb --save`\n\n###Usage:\n\n``` javascript\n\n\tvar Analytics = require('analytics-influxdb');\n\tvar Signups = new Analytics(\"foo\", \"bar\", {\n\t\t\thost: \"http://inflxudb.mydomain.com:8086\",\n\t\t\tdbName: \"production\",\n\t\t\tseries: \"signups\"\n\t});\n\n\tvar data = {\n\t\tusername: \"greenbeans\",\n\t\tsubscription: \"1-month\",\n\t\taddress: {\n\t\t\tstreet: \"1 milky way\",\n\t\t\tcity: \"New York City\",\n\t\t\tzip: 10012,\n\t\t\tstate: \"NY\"\n\t\t}\n\t}\n\n\tSignups.track(data);\n```\n\nDisplayed in influxDB as:\n\n| time | host | pid| username | subscription | address.street | address.city | address.zip | address.state |\n| ---- | ---| ---- |------- | -----| ------------- | -------------| ------------- | -------------|\n| 1429842043737 | api.mydomain.com | 4563 | \"greenbeans\" | \"1-month\" | \"1 milky way\" | \"New York City\" |  10012 | NY |\n\n\n* * *\n\n### Analytics(username, password, options) \n\nInitialize a new `Analytics` with user, pass and and\noptional dictionary of `options` including host.\n\n\u003e Note: \n - All messages being tracked will flatten all nested fields i.e. { top: { nested: 'hi' } } =\u003e { \"top.nested\" : \"hi }\n - All messages append process's host, pid, and time upon tracking\n\n**Parameters**\n* username: `String`\n* password: `String`\n* options: `Object`, (optional)\n\n\n### flush(fn) \n\nFlush the current queue and callback `fn(err, batch)`.\n\n**Parameters**\n* fn: `function`, (optional)\n\n### track(message, fn) \n\nAdd a `message` to the queue and check whether it should be\nflushed.\n\n**Parameters**\n* message: `Object`, fields\n* fn: `Function`, (optional)\n\n* * *\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanajri%2Fanalytics-influxdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanajri%2Fanalytics-influxdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanajri%2Fanalytics-influxdb/lists"}