Skip to main content

Module for keeping metrics about your application in Redis. The goal is to have an easy way to measure an application, and then expose these metrics through a HTTP API, either to process it in some web ui, or expose it to Prometheus.

Project description

Aka Stats

GitHub license Test/Lint

Aka (赤 - red in japanese) Stats.

Unified module for keeping stats in Redis.

The goal is to have an easy way to measure an application, and then expose these metrics through a HTTP API, either to process it in some web ui, or expose it to Prometheus.

from aka_stats import Stats, timer

with Stats() as stats:

    t = timer()
    ...

    stats("task_done", next(t).stat)

Or for asynchronouse code:

from aka_stats import Stats, timer

async def process_device(device_id: str):

    async with Stats() as stat:
        t = timer()
        ...
        stats("task_done", next(t).stat, extra_labels={"device_id": device_id})

Installation

And add this package to your project:

poetry add aka-stats

Usage Guide

Check out the usage guide here: Usage.md

Prometheus formatters

Information how to write a formatter is here: PrometheusFormatters.md

Optional Standalone HTTP API

Check out this guide here: Included HTTP API

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aka-stats-21.1.4.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

aka_stats-21.1.4-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file aka-stats-21.1.4.tar.gz.

File metadata

  • Download URL: aka-stats-21.1.4.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.9.1 Linux/5.4.0-1032-azure

File hashes

Hashes for aka-stats-21.1.4.tar.gz
Algorithm Hash digest
SHA256 0048dc868849663c88f4d6845b014f73eab957f5f33a6552bc29a62b7eec31b5
MD5 fe70537944db2844dcb0f46fda36b398
BLAKE2b-256 623092d71a6ed8fbde2dfff737ce777b82352d9a07ee81f19c230ce5befe231b

See more details on using hashes here.

File details

Details for the file aka_stats-21.1.4-py3-none-any.whl.

File metadata

  • Download URL: aka_stats-21.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.9.1 Linux/5.4.0-1032-azure

File hashes

Hashes for aka_stats-21.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 375ca77ac09519e44fced38ab28a4caee73258fd1fa09d28499e89310d283c98
MD5 828ad4913f5189b945a3eb54c8071ff0
BLAKE2b-256 372172c09b106227ab4226c57f228f75acdac9a671d8f6df7f41767cce53967f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page