semvec/pypi-packages huggingface dataset:
statsd-asgi 0.1.0b1
Export metrics about requests in your ASGI apps to statsd or Datadog
License: MIT
Requires Python: >=3.6
Keywords: asgi,statsd,datadog,starlette,fastapi

statsd-asgi
===========

An ASGI middleware to emit metrics to statsd for requests

Mostly designed to work with Datadog, but should work with any statsd metric

# Config
========

statsd_client: Pass along your own statsd client. Must implement increment and timing methods

statsd_options: Options to configure the datadog statsd client

service: Name of your service, prepended to all metrics. Defaults to asgi

logger: optional logger

# Metric naming pattern
=======================

{service_name}.path

i.e.

myservice.api.v1.foo

# TimingMiddleware
==================

Emits timing metrics for each endpoint for requests. Will emit clock time and cpu time.
## Tags
=======

type: wall or cpu, depending on time source

status_code: The status code of the http request

method: the http method (get, post, put, delete)
# StatusCodeMetricsMiddleware
=============================

Emits counter metrics for each endpoint
## Tags
=======

status_code: The status code of the http request

method: the http method (get, post, put, delete)

Usage with FastAPI
==================

This ASGI middleware should work with any Starlette app, but I work with FastAPI so that's the example I've got for you. PRs welcome for more examples

.. code-block:: python

	from fastapi import FastAPI

	app = FastAPI()

	from statsd_asgi import TimingMiddleware, StatusCodeMetricsMiddleware

	from logging import getLogger

	statsd*options = {'statsd*host': os.environ.get("STATSD_HOST"),

					'statsd\_port': os.environ.get("STATSD\_PORT")

	}

	app.add*middleware(TimingMiddleware, service="testapi", statsd*options=statsd_options)

	app.add*middleware(StatusCodeMetricsMiddleware, service="testapi", statsd*client=statsd_options)

	@app.get("/api")

	async def root():

		return {"message": "Hello World"}
couplet-composer 1.9.0
Tool for building, testing, and preparing binary distribution archives of Obliging Ode and Unsung Anthem.
License: MIT
Requires Python: >=2.7.11

# Couplet Composer

![](https://github.com/anttikivi/couplet-composer/workflows/Main%20workflow/badge.svg)

Couplet Composer is a build utility for [Obliging Ode and Unsung Anthem](https://github.com/anttikivi/unsung-anthem). It takes care of setting up the build environment, installing the dependencies, and building the project incrementally.

## Install

    pip install couplet-composer


## Contribute

Contributions to Couplet Composer are welcome and encouraged! There are many ways to [contribute](https://github.com/anttikivi/.github/blob/main/CONTRIBUTING.md) to it.

This project adheres to the Contributor Covenant [Code of Conduct](https://github.com/anttikivi/.github/blob/main/CODE_OF_CONDUCT.md). By participating, you’re expected to uphold this code. Please report unacceptable behaviour to antti.kivi@visiosto.fi.

## Licence

Couplet Composer is licensed under the [MIT License](LICENCE).