Register Record Object
Project description
Register Record Object
Register Record Object is a Python package that simplifies the process of registering metrics and testing a service through HTTP requests. There is a synchronous and an asynchronous version of the object.
Installation
To use this module, you need to have Node.js installed on your machine. Then, you can install it using npm:
pip install recordregisterobject
Usage
- Import the package into your project:
from registerrecordobject import RegisterRecordObjectSync
- Create an instance of RegisterRecordObject by providing the base URL of your service:
registerRecord = RegisterRecordObjectSync('http://localhost:3001/');
- Use the register method to send metrics data:
registerRecord.register({ "key1": 'value1', "key2": 'value2', "timestamp": time.time(), "service": 'service1' })
- Use the test method to test your service:
response = registerRecord.test()
assert(response.status_code == 200)
Ensure that your service has the corresponding endpoints for metrics registration and testing.
Full code example:
from registerrecordobject import RegisterRecordObjectSync
from registerrecordobject import RegisterRecordObjectAsync
def run_sync():
register_record = RegisterRecordObjectSync(url="http://localhost:3001")
response_test = register_record.test()
assert(response_test.status_code == 200)
response_register = register_record.register(data={"test": "test", "service": "test-python"})
assert(response_register.status_code == 200)
async def run_async():
register_record = RegisterRecordObjectAsync(url="http://localhost:3001")
response_test = await register_record.test()
assert (response_test.status == 200)
response_register = await register_record.register(data={"test": "test", "service": "test-python"})
assert (response_register.status == 200)
License This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to customize this README to include more details or specific instructions related to your project.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file registerrecordobject-0.0.2.tar.gz.
File metadata
- Download URL: registerrecordobject-0.0.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c00f34d066fafc5bd11b06e35410d05931b9f49847e53158fc07f9bd482fdc35
|
|
| MD5 |
33fd9e3a63db20d722de4cee63392658
|
|
| BLAKE2b-256 |
295e406bfdd1799665d88b4ebba9b6f768680f8e739e5273935855f31400bd5e
|
File details
Details for the file registerrecordobject-0.0.2-py3-none-any.whl.
File metadata
- Download URL: registerrecordobject-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59df4dd62ac64c35b6f646f069271132f029eb32682029a0808c298962289751
|
|
| MD5 |
7d4cbc61dfa20213d6dc11ec789ce097
|
|
| BLAKE2b-256 |
2e2c12d3118620e275bf33347f6b6e3a737a12307652006fd49459c7c7c14817
|