{"id":20634140,"url":"https://github.com/samn/mongo-size-check","last_synced_at":"2026-04-22T06:04:08.781Z","repository":{"id":65998301,"uuid":"9756695","full_name":"samn/mongo-size-check","owner":"samn","description":"monitoring for collection size rates of growth","archived":false,"fork":false,"pushed_at":"2013-06-04T19:19:40.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T03:31:50.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-29T19:54:03.000Z","updated_at":"2013-11-27T21:23:00.000Z","dependencies_parsed_at":"2023-02-19T20:55:19.600Z","dependency_job_id":null,"html_url":"https://github.com/samn/mongo-size-check","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samn/mongo-size-check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fmongo-size-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fmongo-size-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fmongo-size-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fmongo-size-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samn","download_url":"https://codeload.github.com/samn/mongo-size-check/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fmongo-size-check/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32123605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-16T14:23:57.532Z","updated_at":"2026-04-22T06:04:08.767Z","avatar_url":"https://github.com/samn.png","language":"Python","readme":"## mongo-size-check\n\nA rate of growth check for mongo collection sizes\nmeant to be used with [Riemann](https://github.com/aphyr/riemann)\nand [riemann-sumd](https://github.com/bmhatfield/riemann-sumd).\n\n### Usage\n\n    Usage: mongo-size-check.py [options]\n    \n    Options:\n      -h, --help            show this help message and exit\n      --database=DATABASE   Monitor the collections of this database\n      --host=HOST           The host of the database to monitor.\n                            (default=localhost)\n      --max-collection-size=MAX_COLLECTION_SIZE\n                            The max allowed size of a collection in GB.\n                            (default=256)\n      --growth-interval=GROWTH_INTERVAL\n                            The number of days to look at the growth rate for.\n                            Alert if growth will exceed max-collection-size within\n                            this interval.  (default=30)\n\nCall `mongo-size-check.py` with the name of the database to monitor.\nThe current size of each collection will be emitted as an event to riemann-sumd, which will sent to Riemann.  \nYour Riemann config should calculate the rate of growth on collection sizes so you can shard before it's\n[too late](http://docs.mongodb.org/manual/reference/limits/#Sharding%20Existing%20Collection%20Data%20Size).\n\n### riemann-sumd config\n\n    service: 'mongo-collection-size'\n    arg: 'mongo-collection-size.py --database DATABASE'\n    ttl: 86400\n    tags: ['notify', 'mongo-collection', 'rate-of-change']\n    type: 'json'\n\n### Riemann config\n\n````\n(defn when-growth-exceeds\n  \"Call children when the the metric of events\n  will exceeed a threshold within some interval.\n  Calculates the rate-of-growth of metric between events.\n  Uses attributes on the event to determine the threshold\n  and interval.  The names of those attribute keys are passed\n  as args to this function.\"\n  [growth_interval_key threshold_key \u0026 children]\n  ;; the metric of the event emitted by this function is the rate-of-change\n  (ddt-events\n    (smap\n      ;; call children if the growth is exceeding the threshold within the interval\n      (fn [event]\n        (let [growth_interval (growth_interval_key event)\n              threshold (threshold_key event)\n              rate-of-change (:metric event)]\n          (when (\u003e threshold (* growth_interval rate-of-change))\n            event)))\n      (apply sdo children))))\n\n(streams\n  (by [:host :service]\n    (where (and (not (expired? event)) (tagged \"rate-of-change\"))\n      (when-growth-exceeds :growth_interval :max_size\n        (with {:state \"error\"}\n            (rollup 1 rollup-ttl (email notify-email)))))))\n````\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamn%2Fmongo-size-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamn%2Fmongo-size-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamn%2Fmongo-size-check/lists"}