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
Release history Release notifications | RSS feed
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.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for shopcloud_metric-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b13fdefb117ed3e98474c01eab6b6bbc7aab1ea83817866849f051e6c2906bc |
|
MD5 | ffdb2b1a7d2b7baf479acbb0cf5a291f |
|
BLAKE2b-256 | e78a254c0f14c87b722d03383d2d955031d2be558e5dd93022dfc2352d758d0d |