{"id":21565129,"url":"https://github.com/cfware/queuelogger","last_synced_at":"2025-03-18T05:17:28.523Z","repository":{"id":57098468,"uuid":"111983863","full_name":"cfware/queuelogger","owner":"cfware","description":"CFWare queue_log mysql writer proxy","archived":false,"fork":false,"pushed_at":"2020-05-27T14:33:08.000Z","size":123,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T08:16:38.464Z","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/cfware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.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":"2017-11-25T07:02:37.000Z","updated_at":"2020-05-07T12:21:34.000Z","dependencies_parsed_at":"2022-08-20T16:51:07.884Z","dependency_job_id":null,"html_url":"https://github.com/cfware/queuelogger","commit_stats":null,"previous_names":["cfware/queue_log-mysql"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fqueuelogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fqueuelogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fqueuelogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fqueuelogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfware","download_url":"https://codeload.github.com/cfware/queuelogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244102832,"owners_count":20398386,"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-11-24T10:18:31.591Z","updated_at":"2025-03-18T05:17:28.501Z","avatar_url":"https://github.com/cfware.png","language":"JavaScript","readme":"# @aqm/queuelogger\n\n[![Travis CI][travis-image]][travis-url]\n[![Greenkeeper badge](https://badges.greenkeeper.io/cfware/queuelogger.svg)](https://greenkeeper.io/)\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![MIT][license-image]](LICENSE)\n\nCFWare AQM queue_log mysql writer\n\n### Install @aqm/queuelogger\n\nThis module requires node.js 13.8.0 or above.\n\n```sh\nnpm i --save @aqm/queuelogger\n```\n\n## Usage\n\n```js\nimport {QueueLogger} from '@aqm/queuelogger';\n\nclass QueueManager {\n\tconstructor() {\n\t\tthis.logger = new QueueLogger({\n\t\t\t/* Default is 'P001', used as value of partition column. */\n\t\t\tpartition: 'P001',\n\t\t\t/* Default is least significant part of hostname, used as value of serverid column. */\n\t\t\tserverID: 'serverid',\n\t\t\t/* Default: 'queue_log', the table we insert to. */\n\t\t\ttableName: 'queue_log',\n\t\t\t/* Override default settings used by require('mysql').createPool.\n\t\t\t * The default database is queuemetrics.\n\t\t\t */\n\t\t\tmysql: {},\n\t\t});\n\n\t\tprocess.on('SIGTERM', () =\u003e this.logger.end().catch(() =\u003e {}));\n\t}\n\n\tasync writeQueueLog(timeID, callID, queue, agent, verb, data1, data2, data3, data4, data5) {\n\t\t/* This is a pointless example.  In real life a queue manager would retrieve some\n\t\t * data from a channel or other object. */\n\t\ttry {\n\t\t\tawait this.logger.writeEntry(timeID, callID, queue, agent, verb, data1, data2, data3, data4, data5);\n\t\t} catch (err) {\n\t\t\t/* mysql write failed, record to a file. */\n\t\t}\n\t}\n}\n```\n\n## Running tests\n\nTests require access to a test mysql or mariadb daemon.  The test database server must\nhave a `queuemetrics` database and a `queuelogd` user as defined by `sampledb/qm.sql`.\n\nDefault test configuration:\n```sh\nnpm config set @aqm/queuelogger:dbhost 'localhost'\nnpm config set @aqm/queuelogger:dbprivuser 'root'\nnpm config set @aqm/queuelogger:dbprivpassword ''\n```\n\nThese settings can be changed to use a different server or to use an account less\nprivileged than root.  The `priv` account must have SELECT and DELETE access to\nthe `queuemetrics.queue_log` table.\n\nOnce the database is created and a privileged account configured the tests can be run:\n```sh\nnpm install\nnpm test\n```\n\n[npm-image]: https://img.shields.io/npm/v/@aqm/queuelogger.svg\n[npm-url]: https://npmjs.org/package/@aqm/queuelogger\n[travis-image]: https://travis-ci.org/cfware/queuelogger.svg?branch=master\n[travis-url]: https://travis-ci.org/cfware/queuelogger\n[downloads-image]: https://img.shields.io/npm/dm/@aqm/queuelogger.svg\n[downloads-url]: https://npmjs.org/package/@aqm/queuelogger\n[license-image]: https://img.shields.io/github/license/cfware/queuelogger.svg\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfware%2Fqueuelogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfware%2Fqueuelogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfware%2Fqueuelogger/lists"}