{"id":22407522,"url":"https://github.com/amor71/mnqueues","last_synced_at":"2026-03-16T13:02:19.831Z","repository":{"id":37962068,"uuid":"382556559","full_name":"amor71/mnqueues","owner":"amor71","description":"Monitored Multiprocessing Queues","archived":false,"fork":false,"pushed_at":"2024-04-08T14:01:12.000Z","size":456,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-08T16:56:25.876Z","etag":null,"topics":["monitor","monitoring","multiprocessing","multithreading","python","python-3","python-library","python3","queue","queue-manager","queue-tasks","queueing","scale","scaleable","tracing"],"latest_commit_sha":null,"homepage":"https://github.com/amor71/mnqueues","language":"Python","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/amor71.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null}},"created_at":"2021-07-03T07:43:55.000Z","updated_at":"2024-04-15T15:36:08.091Z","dependencies_parsed_at":"2024-02-19T15:27:37.775Z","dependency_job_id":"4d84011b-c49a-4bf5-8a3b-1b7f81d19c86","html_url":"https://github.com/amor71/mnqueues","commit_stats":{"total_commits":155,"total_committers":3,"mean_commits":"51.666666666666664","dds":"0.44516129032258067","last_synced_commit":"cb25458f55fdef4f25a83749ad35be9acba4c0c8"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amor71%2Fmnqueues","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amor71%2Fmnqueues/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amor71%2Fmnqueues/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amor71%2Fmnqueues/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amor71","download_url":"https://codeload.github.com/amor71/mnqueues/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228283748,"owners_count":17896267,"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":["monitor","monitoring","multiprocessing","multithreading","python","python-3","python-library","python3","queue","queue-manager","queue-tasks","queueing","scale","scaleable","tracing"],"created_at":"2024-12-05T11:14:38.175Z","updated_at":"2025-11-03T15:02:58.606Z","avatar_url":"https://github.com/amor71.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/amor71/mnqueues/tree/main.svg?style=shield)](https://circleci.com/gh/amor71/mnqueues/tree/main)\n[![Updates](https://pyup.io/repos/github/amor71/mnqueues/shield.svg)](https://pyup.io/repos/github/amor71/mnqueues/)\n[![Python 3](https://pyup.io/repos/github/amor71/mnqueues/python-3-shield.svg)](https://pyup.io/repos/github/amor71/mnqueues/)\n[![Sourcery](https://img.shields.io/badge/Sourcery-enabled-brightgreen)](https://sourcery.ai)\n\n# What are mnqueues?\n\n`mnqueues` stands for Monitored Queues - a coupling between Python `multiprocessing` Queue() and a Monitor entity. A Monitor collect and alerts on Queue usage statistics. \n## Tracked measures\n\n`mnqueues` tracks several measures per queue:\n\n1. Average number of writes to queue per minute,\n2. Average number of reads to queue per minute,\n3. Time spend in queue (latency) in milliseconds. \n## Installation\n\nTo install `mnqueues` type: \n\n`pip install mnqueues`\n\n## How-To use\n\nTo create a monitored queue:\n\n    import mnqueues as mnq\n    from mnqueues.gcp_monitor import GCPMonitor\n\n    q = mnq.MNQueue(monitor=GCPMonitor(\"some-unique-name\"))\n\nThe `MNQueue()` object encapsulated Python `multiprocessing.Queue()` and supports same functions. The MNQueue() object can be passed between processes, like a Queue() object. \n\n## Monitors\n\n### File Logger\n\n    from mnqueues.log_monitor import LOGMonitor\n\n    monitor = LOGMonitor(\"log-file-name\")\n\nLog all `put()` and `get()` calls to a log file with the the name `log-file-name.log` with the following format:\n\n    [\u003cOS process-id\u003e]-\u003e2021-07-07 21:31:14 INFO:get counter: 5003\n    [\u003cOS process-id\u003e]-\u003e2021-07-07 21:31:14 INFO:get counter: 4997\n\n\n### Google Cloud Monitor (using StackDriver)\n\n    from mnqueues.gcp_monitor import GCPMonitor\n\n    monitor = GCPMonitor(\"unique-name\")\n\nAll calls to `put()` and `get()` are sent to Google Cloud Monitor. The Monitor class sends data to two custom measures:\n1. `OpenCensus/mnqueues.{name}.number_queue_get` (line, no aggregation on GCP required)\n2. `OpenCensus/mnqueues.{name}.number_queue_put` (line, no aggregation on GCP required)\n3. `OpenCensus/mnqueues.{name}.time_in_queue_distribution` (heat-map with sum, shows latency distribution)\n\nNote that `{name}` is passed as a parameter when constructing the Monitor and it aims to assist in creating dash-boards for specific use-cases. \n\n[See](https://amor71.github.io/mnqueues/gcp-metric-explorer.png) for details.\n\n## Examples\n\n### GCP\n1. [View](https://amor71.github.io/mnqueues/gcp-mnqueues-sample.png) Google Cloud (GCP) Monitoring dashboard showing queue.put() and queue.get() rates per second, generated by running `pytest` on the project [tests](https://github.com/amor71/mnqueues/tree/main/tests) folder.\n2. [Monitoring](https://amor71.github.io/mnqueues/liu-monitor.png) queues with real-time web-socket trading data for [LiuAlgoTrader](https://github.com/amor71/LiuAlgoTrader).\n\n### Further examples\n\nCan be found in the [tests](https://github.com/amor71/mnqueues/tree/main/tests) folder.\n\n## Contributing\n\nContributions are highly appreciated. Please review our \n[Code of Conduct](https://github.com/amor71/mnqueues/blob/master/CODE_OF_CONDUCT.md). Bug reports \u0026 feature requests can be left in the `Issues` section, or email me at amor71@sgeltd.com\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famor71%2Fmnqueues","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famor71%2Fmnqueues","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famor71%2Fmnqueues/lists"}