Name | pt4cloud JSON |
Version |
0.3.0
JSON |
| download |
home_page | None |
Summary | Python implementation of PT4Cloud as descibed by He et al. https://doi.org/10.1145/3338906.3338912 |
upload_time | 2024-11-25 13:38:13 |
maintainer | None |
docs_url | None |
author | Fabian |
requires_python | <4.0,>=3.10 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# PT4Cloud
PT4Cloud (Performance Testing for Cloud) is a Python implementation of the performance testing methodology described by He et al. in their paper ["Performance Testing for Cloud Applications: A Systematic Approach"](https://doi.org/10.1145/3338906.3338912) (AST 2019). This project is not affiliated with the researchers.
## Overview
This package implements the PT4Cloud methodology for determining when cloud application performance characteristics have stabilized. It offers two variants:
- `pt4cloud`: Implements the full methodology as described in the paper (currently broken)
- `pt4cloud_lite`: A modified version for shorter testing intervals
The methodology uses statistical techniques to determine when a cloud application's performance distribution has stabilized, accounting for the inherent variability in cloud environments.
## Installation
```bash
pip install pt4cloud
```
## Quick Start
```python
from pt4cloud import pt4cloud, pt4cloud_lite
import random
# Example benchmark function that simulates latency measurements
def benchmark_function():
# Simulate some workload with variable latency
return random.normalvariate(100, 15) # mean=100ms, std=15ms
# For short-term analysis (< 7 days)
samples, distribution = pt4cloud_lite(
benchmark_function,
stability_probability=0.9, # 90% confidence level
interval_duration=3600, # 1 hour intervals
sampling_portion=0.5 # Sample 50% of the time
)
```
## Methodology
The implemented approach follows the process described by He et al.:
1. **Data Collection**: Continuously execute performance tests over specified time intervals
2. **Distribution Analysis**: Calculate performance distributions using Kernel Density Estimation
3. **Stability Detection**: Compare successive distributions using Kullback-Leibler divergence
4. **Iteration**: Continue testing until stability is achieved or maximum iterations reached
The methodology addresses key challenges in cloud performance testing:
- Temporal variations in performance
- Non-normal performance distributions
- Need for statistical stability before drawing conclusions
## Detailed Usage
### PT4Cloud Lite (Short-term Analysis)
Modified version for shorter testing intervals:
```python
from pt4cloud import pt4cloud_lite
samples = pt4cloud_lite(
benchmark_function=my_benchmark,
stability_probability=0.9, # 90% confidence level
max_intervals=10, # Maximum number of intervals to try
interval_duration=86400, # Duration of each interval in seconds (24 hours)
interval_increase=0.2, # Factor to increase interval duration by after each failed attempt
sampling_portion=1.0, # Fraction of time to spend sampling
validate=True # Whether to validate stability with additional interval
)
```
### Analyzing Results
```python
import numpy as np
# Get basic statistics
mean = np.mean(samples)
std = np.std(samples)
percentile_95 = np.percentile(samples, 95)
# Evaluate the probability density at specific points
x_points = np.linspace(min(samples), max(samples), 100)
density = distribution(x_points)
```
## Requirements
- Python 3.8+
- NumPy
- SciPy
## License
This work is licensed under the Creative Commons Attribution 4.0 International License. (https://creativecommons.org/licenses/by/4.0/)
Raw data
{
"_id": null,
"home_page": null,
"name": "pt4cloud",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Fabian",
"author_email": "1803fabian@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/05/46/6e2de0fbb8eb649e0d26f284894f0030da692eb5a08c0a72f68464422817/pt4cloud-0.3.0.tar.gz",
"platform": null,
"description": "# PT4Cloud\n\nPT4Cloud (Performance Testing for Cloud) is a Python implementation of the performance testing methodology described by He et al. in their paper [\"Performance Testing for Cloud Applications: A Systematic Approach\"](https://doi.org/10.1145/3338906.3338912) (AST 2019). This project is not affiliated with the researchers.\n\n## Overview\n\nThis package implements the PT4Cloud methodology for determining when cloud application performance characteristics have stabilized. It offers two variants:\n- `pt4cloud`: Implements the full methodology as described in the paper (currently broken)\n- `pt4cloud_lite`: A modified version for shorter testing intervals\n\nThe methodology uses statistical techniques to determine when a cloud application's performance distribution has stabilized, accounting for the inherent variability in cloud environments.\n\n## Installation\n\n```bash\npip install pt4cloud\n```\n\n## Quick Start\n\n```python\nfrom pt4cloud import pt4cloud, pt4cloud_lite\nimport random\n\n# Example benchmark function that simulates latency measurements\ndef benchmark_function():\n # Simulate some workload with variable latency\n return random.normalvariate(100, 15) # mean=100ms, std=15ms\n\n# For short-term analysis (< 7 days)\nsamples, distribution = pt4cloud_lite(\n benchmark_function,\n stability_probability=0.9, # 90% confidence level\n interval_duration=3600, # 1 hour intervals\n sampling_portion=0.5 # Sample 50% of the time\n)\n```\n\n## Methodology\n\nThe implemented approach follows the process described by He et al.:\n\n1. **Data Collection**: Continuously execute performance tests over specified time intervals\n2. **Distribution Analysis**: Calculate performance distributions using Kernel Density Estimation\n3. **Stability Detection**: Compare successive distributions using Kullback-Leibler divergence\n4. **Iteration**: Continue testing until stability is achieved or maximum iterations reached\n\nThe methodology addresses key challenges in cloud performance testing:\n- Temporal variations in performance\n- Non-normal performance distributions\n- Need for statistical stability before drawing conclusions\n\n## Detailed Usage\n\n### PT4Cloud Lite (Short-term Analysis)\n\nModified version for shorter testing intervals:\n\n```python\nfrom pt4cloud import pt4cloud_lite\n\nsamples = pt4cloud_lite(\n benchmark_function=my_benchmark,\n stability_probability=0.9, # 90% confidence level\n max_intervals=10, # Maximum number of intervals to try\n interval_duration=86400, # Duration of each interval in seconds (24 hours)\n interval_increase=0.2, # Factor to increase interval duration by after each failed attempt\n sampling_portion=1.0, # Fraction of time to spend sampling\n validate=True # Whether to validate stability with additional interval\n)\n```\n\n### Analyzing Results\n\n```python\nimport numpy as np\n\n# Get basic statistics\nmean = np.mean(samples)\nstd = np.std(samples)\npercentile_95 = np.percentile(samples, 95)\n\n# Evaluate the probability density at specific points\nx_points = np.linspace(min(samples), max(samples), 100)\ndensity = distribution(x_points)\n```\n\n## Requirements\n\n- Python 3.8+\n- NumPy\n- SciPy\n\n## License\n\nThis work is licensed under the Creative Commons Attribution 4.0 International License. (https://creativecommons.org/licenses/by/4.0/)\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Python implementation of PT4Cloud as descibed by He et al. https://doi.org/10.1145/3338906.3338912",
"version": "0.3.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7de8a40bd8663f0cef20005eac9fb50b80aacb6426af3ee3b902d3b0f4ab4a3e",
"md5": "273feef83fb2502733e77acbdedde7e3",
"sha256": "5172e7f8454c3cc1ad5d2f4c28f98dc5cacaf442d30349cd2af138462549f5ff"
},
"downloads": -1,
"filename": "pt4cloud-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "273feef83fb2502733e77acbdedde7e3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 6980,
"upload_time": "2024-11-25T13:38:12",
"upload_time_iso_8601": "2024-11-25T13:38:12.756350Z",
"url": "https://files.pythonhosted.org/packages/7d/e8/a40bd8663f0cef20005eac9fb50b80aacb6426af3ee3b902d3b0f4ab4a3e/pt4cloud-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "05466e2de0fbb8eb649e0d26f284894f0030da692eb5a08c0a72f68464422817",
"md5": "90fbec3e7066f06d8567328175a29824",
"sha256": "af5533211a244205e2d1a3a14ea7efbffd8369dc8aad0c53562f6e4fc33908e2"
},
"downloads": -1,
"filename": "pt4cloud-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "90fbec3e7066f06d8567328175a29824",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 5763,
"upload_time": "2024-11-25T13:38:13",
"upload_time_iso_8601": "2024-11-25T13:38:13.937499Z",
"url": "https://files.pythonhosted.org/packages/05/46/6e2de0fbb8eb649e0d26f284894f0030da692eb5a08c0a72f68464422817/pt4cloud-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-25 13:38:13",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pt4cloud"
}