Metadata-Version: 2.1
Name: esguard
Version: 0.1.6
Summary: esguard provides a Python decorator that waits for processing while monitoring the load of Elasticsearch.
Home-page: http://github.com/po3rin/esguard
License: Apache-2.0
Author: po3rin
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: docker (>=5.0.0,<6.0.0)
Requires-Dist: elasticsearch (>=7.12.1,<8.0.0)
Requires-Dist: six (>=1.16.0,<2.0.0)
Requires-Dist: tenacity (>=8.0.1,<9.0.0)
Project-URL: Repository, http://github.com/po3rin/esguard
Description-Content-Type: text/markdown

<p align="center">
  <img alt="esguard-logo" src="esguard.png" height="100" />
  <h2 align="center">esguard</h2>
  <p align="center">esguard provides a Python decorator that waits for processing while monitoring the load of Elasticsearch.</p>
</p>

[![PyPi version](https://img.shields.io/pypi/v/esguard.svg)](https://pypi.python.org/pypi/esguard/) [![](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/release/python-390/) ![PyTest](https://github.com/po3rin/esguard/workflows/PyTest/badge.svg)

## Quick Start

You need to launch elasticsearch before quick start.

```python
from esguard import ESGuard


@ESGuard(os_cpu_percent=95).decotator
def mock_func(x):
    return x

self.assertEqual(mock_func(1), 1)
```

## Test

You need to launch elasticsearch before testing.

```sh
$ docker compose up -d --build
$ poetry run pytest
```

