This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
SliceSight-Next
Advanced Redis hotspot detection and analysis tool for identifying load imbalances in Redis clusters.
Features
- Real-time hotspot detection using multiple statistical metrics
- Adaptive thresholding that adjusts based on cluster size and key distribution
- Comprehensive analysis with load ratios, coefficient of variation, and Gini coefficients
- CLI interface for simulation, scanning, and scoring
- High performance with optimized algorithms for large-scale deployments
Installation
pip install slicesight-next
Quick Start
Command Line Usage
# Simulate key distribution
slicesight-hotshard simulate --keys 1000 --buckets 3 --auto-thresh
# Score existing load distribution
slicesight-hotshard score 100.0 200.0 150.0 --auto-thresh
# Check system health
slicesight-hotshard health
Python API
from slicesight_next import (
redis_cluster_slot,
load_ratio,
calc_cv,
calc_gini,
auto_ratio_thresh,
verdict
)
# Calculate Redis cluster slot
key = "user:12345"
slot = redis_cluster_slot(key)
print(f"Key '{key}' maps to slot {slot}")
# Analyze load distribution
loads = [100.0, 200.0, 150.0]
ratio = load_ratio(loads)
cv = calc_cv(loads)
gini = calc_gini(loads)
print(f"Load ratio: {ratio:.2f}")
print(f"Coefficient of variation: {cv:.2f}")
print(f"Gini coefficient: {gini:.2f}")
# Use adaptive threshold
n_keys = 1000
n_buckets = 3
threshold = auto_ratio_thresh(n_keys, n_buckets)
print(f"Adaptive threshold: {threshold:.3f}")
# Generate hotspot verdict
result = verdict(ratio, cv, gini, 0.1, threshold, 0.05)
print(f"Hotspot detected: {result['hotspot_detected']}")
Adaptive Threshold Formula
The adaptive threshold automatically adjusts based on your cluster configuration:
ρ_auto(n,k) = 1 / (1 + 3√((k−1)/n))
Where:
n= number of keysk= number of buckets/nodes
This formula ensures that:
- Small clusters get higher thresholds (more tolerance for imbalance)
- Large clusters get lower thresholds (expect better distribution)
- More keys result in lower thresholds (better distribution expected)
CLI Commands
simulate
Simulate Redis key distribution and detect hotspots:
slicesight-hotshard simulate [OPTIONS]
Options:
--keys INTEGER Number of keys to simulate [default: 1000]
--buckets INTEGER Number of buckets/nodes [default: 3]
--ratio-thresh FLOAT Load ratio threshold
--auto-thresh Use adaptive threshold
--p-thresh FLOAT P-value threshold [default: 0.05]
--json Output in JSON format
--seed INTEGER Random seed for reproducibility
score
Score given load distribution:
slicesight-hotshard score LOADS... [OPTIONS]
Arguments:
LOADS... Load values for each node
Options:
--buckets INTEGER Number of buckets
--ratio-thresh FLOAT Load ratio threshold
--auto-thresh Use adaptive threshold
--p-thresh FLOAT P-value threshold [default: 0.05]
--json Output in JSON format
scan
Scan Redis instance (future implementation):
slicesight-hotshard scan [OPTIONS]
Options:
--host TEXT Redis host [default: localhost]
--port INTEGER Redis port [default: 6379]
--buckets INTEGER Number of buckets/nodes [default: 3]
--auto-thresh Use adaptive threshold
--json Output in JSON format
Metrics Explained
Load Ratio
The ratio between the highest and lowest loaded nodes:
- 1.0 = Perfect balance
- >2.0 = Potential hotspot concern
- >5.0 = Significant imbalance
Coefficient of Variation (CV)
Measures relative variability in the distribution:
- 0.0 = No variation (perfect balance)
- >1.0 = High variability, potential hotspots
Gini Coefficient
Measures inequality in load distribution:
- 0.0 = Perfect equality
- >0.5 = Significant inequality
- 1.0 = Maximum inequality
Chi-square P-value
Tests if distribution differs significantly from uniform:
- >0.05 = Distribution appears uniform
- <0.05 = Significant deviation from uniform
Development
Setup
git clone https://github.com/slicesight/slicesight-next.git
cd slicesight-next
pip install -e ".[dev,test]"
Testing
# Run all tests
pytest
# Run with coverage
pytest --cov=slicesight_next --cov-report=html
# Run performance benchmarks
pytest tests/performance/ -v
# Run property-based tests
pytest tests/property/ -v
Code Quality
# Format and lint
ruff check .
ruff format .
# Type checking
mypy slicesight_next --strict
# Security scan
bandit -r slicesight_next
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Performance
SliceSight-Next is optimized for production use:
- CRC16 calculation: >100k ops/sec
- Slot distribution: >50k keys/sec
- Metrics calculation: >10k distributions/sec
- Memory efficient: O(1) space complexity for most operations
Use Cases
- Redis Cluster Monitoring: Detect hotspots in production clusters
- Load Testing: Analyze key distribution in test scenarios
- Capacity Planning: Model cluster behavior under different loads
- Performance Tuning: Identify and resolve load imbalances
💬 Feedback & Support
We'd love to hear from you! SliceSight-Next is actively seeking user feedback to improve.
Quick Feedback
# Submit feedback directly via CLI
slicesight-hotshard feedback "Your thoughts here"
slicesight-hotshard feedback "Found a bug" --category bug --email you@company.com
Community & Support
- 🐛 Report Issues
- 💬 Join Discussions
- 📖 Documentation
- ⭐ Star us on GitHub if you find this useful!
What We're Looking For
- Real-world Redis key patterns you're testing
- Performance feedback on large datasets
- Feature requests for better Redis monitoring
- Use cases we haven't considered
- Integration pain points
Metadata
Release files for slicesight-next-mang 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| slicesight_next_mang-0.2.0.tar.gz | 23.0 kB | Without provenance | Details for slicesight_next_mang-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| slicesight_next_mang-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for slicesight_next_mang-0.2.0-py3-none-any.whl |
Total release size: 35.2 kB
Release files / slicesight_next_mang-0.2.0.tar.gz
| Download URL | slicesight_next_mang-0.2.0.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b5b16486ce3a43f14af406ccd0354f503ed5b904ae3fab0cb2c9ae8c3168c2f
|
|
BLAKE2b-256 checksum How to use checksums |
14f3eae50d68c3f051b8f0d06a4c9093c8888b0305f5c9a01b10620a0ee1cf98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Release files / slicesight_next_mang-0.2.0-py3-none-any.whl
| Download URL | slicesight_next_mang-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4190ad60459f9a7a314c08acdba7d986a68270f4fab8a632103939a8ecd96fa6
|
|
BLAKE2b-256 checksum How to use checksums |
b2757e690f7a285053194adf72868c4a0cb33e3206828fdb6ea6c51f747e8aaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Security for slicesight-next-mang 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.