{"id":20111775,"url":"https://github.com/openstack/monasca-statsd","last_synced_at":"2025-05-06T11:31:16.678Z","repository":{"id":21052185,"uuid":"24351170","full_name":"openstack/monasca-statsd","owner":"openstack","description":"Python Statsd library for sending statsd messages via the Monasca Agent. Mirror of code maintained at opendev.org.","archived":false,"fork":false,"pushed_at":"2024-04-29T10:25:44.000Z","size":213,"stargazers_count":24,"open_issues_count":0,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-09T18:46:04.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://opendev.org/openstack/monasca-statsd","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openstack.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-23T00:51:34.000Z","updated_at":"2023-11-05T17:15:28.000Z","dependencies_parsed_at":"2024-02-10T09:28:30.954Z","dependency_job_id":"8bb40d90-ec24-4f43-9310-5cffa25d5a34","html_url":"https://github.com/openstack/monasca-statsd","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fmonasca-statsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fmonasca-statsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fmonasca-statsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fmonasca-statsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openstack","download_url":"https://codeload.github.com/openstack/monasca-statsd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224499851,"owners_count":17321605,"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-13T18:17:40.066Z","updated_at":"2024-11-13T18:17:40.631Z","avatar_url":"https://github.com/openstack.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Openstack Monasca Statsd\n========================\n\n.. image:: https://governance.openstack.org/tc/badges/monasca-statsd.svg\n    :target: https://governance.openstack.org/tc/reference/tags/index.html\n\nA Monasca-Statsd Python Client.\n===============================\n\nQuick Start Guide\n-----------------\n\nFirst install the library with ``pip`` or ``easy_install``:\n\n::\n\n   # Install in system python ...\n   sudo pip install monasca-statsd\n\n   # .. or into a virtual env\n   pip install monasca-statsd\n\nThen start instrumenting your code:\n\n::\n\n   # Import the module.\n   import monascastatsd as mstatsd\n\n   # Create the connection\n   conn = mstatsd.Connection(host='localhost', port=8125)\n\n   # Create the client with optional dimensions\n   client = mstatsd.Client(connection=conn, dimensions={'env': 'test'})\n\n   NOTE: You can also create a client without specifying the connection and it will create the client\n   with the default connection information for the monasca-agent statsd processor daemon\n   which uses host='localhost' and port=8125.\n\n   client = mstatsd.Client(dimensions={'env': 'test'})\n\n   # Increment and decrement a counter.\n   counter = client.get_counter(name='page.views')\n\n   counter.increment()\n   counter += 3\n\n   counter.decrement()\n   counter -= 3\n\n   # Record a gauge 50% of the time.\n   gauge = client.get_gauge('gauge', dimensions={'env': 'test'})\n\n   gauge.send('metric', 123.4, sample_rate=0.5)\n\n   # Sample a histogram.\n   histogram = client.get_histogram('histogram', dimensions={'test': 'True'})\n\n   histogram.send('metric', 123.4, dimensions={'color': 'red'})\n\n   # Time a function call.\n   timer = client.get_timer()\n\n   @timer.timed('page.render')\n   def render_page():\n       # Render things ...\n       pass\n\n   # Time a block of code.\n   timer = client.get_timer()\n\n   with timer.time('t'):\n       # Do stuff\n       time.sleep(2)\n\n   # Add dimensions to any metric.\n   histogram = client.get_histogram('my_hist')\n   histogram.send('query.time', 10, dimensions = {'version': '1.0', 'environment': 'dev'})\n\nFeedback\n--------\n\nTo suggest a feature, report a bug, or participate in the general\ndiscussion, head over to `StoryBoard`_.\n\nLicense\n-------\n\nSee LICENSE file. Code was originally forked from Datadog’s\ndogstatsd-python, hence the dual license.\n\n.. _StoryBoard: https://storyboard.openstack.org/#!/project/872\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstack%2Fmonasca-statsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenstack%2Fmonasca-statsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstack%2Fmonasca-statsd/lists"}