Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 1.92 KB

File metadata and controls

77 lines (56 loc) · 1.92 KB

CI PyPI

Measure

Image of Vernier

Overview

Measure is a metrics library that allows the user to swap metrics provider ie. (statsd, cloudwatch). It also provides an abstraction for creating metrics.

Example

import measure

stat = measure.stats.Stats("homepage", measure.Meter("pageviews", "Pageview on homepage"), client=measure.client.PyStatsdClient())

stat.pageviews.mark()

Concepts

#TODO define each of these and their usage / verb|function

  • Timer
  • TimerDict
  • Counter
  • CounterDict
  • Meter
  • MeterDict
  • Gauge
  • GuageDict
  • Set
  • SetDict
  • FakeStat

Development

This project uses uv and mise for tooling.

# install tooling and create the virtualenv
mise install
mise run sync

# run tests
mise run test

# lint and format
mise run lint
mise run fmt

# type check
mise run typecheck

# build sdist + wheel into dist/
mise run build

Releases

Releases are published automatically to PyPI by .github/workflows/release.yaml whenever the version in pyproject.toml changes on the default branch. The workflow uses PyPI Trusted Publishing via OIDC, so no API tokens are needed — configure trusted publishing on PyPI for the measure project, pointing at this repo, the release.yaml workflow, and the pypi GitHub environment.

To cut a release:

mise run bump-patch   # or bump-minor / bump-major
git commit -am "release: vX.Y.Z"
git push

The workflow will detect the new version, build, publish to PyPI, push a vX.Y.Z tag, and create a GitHub release.