Skip to main content

CLI tool for Metrics

Project description

Shopcloud Metric CLI

install

$ pip install shopcloud_metric

Usage

Job:

Metrics wenn ein Job ausgeführt wird

from shopcloud_metric import JobMetric

job = JobMetric('sage-supplier-update', 
    instance='airflow-production', 
    env='testing',
)
with job as j:
    j.gauge('job_last_success_unixtime', labels={'supplier': 'EP'})
    raise Exception('AS a')
    j.gauge('job_last_success_unixtime', labels={'supplier': 'SP'})

job.gauge('job_last_success_unixtime', labels={'supplier': 'SP'})
job.success()

RawMetrics:

from shopcloud_metric import MetricRegistry

registry = MetricRegistry()
registry.gauge('job_up', value=1, labels={'name': 'shopcloud-infrastructure-cli', 'instance': 'tests'})
registry.push()

registry.gauge('job_up', value=0, labels={'name': 'my-job', 'instance': 'airflow-production'})
registry.gauge('job_last_success_unixtime', labels=[{'name': 'test'}])
registry.gauge('api_http_requests_total', value=12, labels={'operation': 'create'})
registry.gauge('process_cpu_seconds_total', value=1)
registry.gauge('http_request_duration_seconds', value=1)
registry.push()

Deploy to PyPi

$ pip3 install wheel twine
$ python3 setup.py sdist bdist_wheel
$ twine upload dist/* 

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

shopcloud_metric-0.2.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

shopcloud_metric-0.2.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file shopcloud_metric-0.2.1.tar.gz.

File metadata

  • Download URL: shopcloud_metric-0.2.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.6

File hashes

Hashes for shopcloud_metric-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fc4be96ba34b2614ddb513cca38255a0119c70d6d6242575e2b54ed21d6f5144
MD5 6e70c44a579e20f7ec6b554321e42cb8
BLAKE2b-256 8cc4178ec812b7289fdde2e964a423ab788ead23819a0551fef07df4a7512fd8

See more details on using hashes here.

File details

Details for the file shopcloud_metric-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: shopcloud_metric-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.6

File hashes

Hashes for shopcloud_metric-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb6ba60abeba49206d53871ae158b6883b6711452aad2dac50c146d1896ac383
MD5 6c40f3593496c614449e48bd3f8de472
BLAKE2b-256 3f67246250134487575709a72a840c6d7a0e38578216867f18ffc1a37c05937c

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