adapto 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- adapto/scaler.py +5 -2
- {adapto-0.1.1.dist-info → adapto-0.1.3.dist-info}/METADATA +1 -1
- adapto-0.1.3.dist-info/RECORD +9 -0
- adapto-0.1.1.dist-info/RECORD +0 -9
- {adapto-0.1.1.dist-info → adapto-0.1.3.dist-info}/LICENSE +0 -0
- {adapto-0.1.1.dist-info → adapto-0.1.3.dist-info}/WHEEL +0 -0
- {adapto-0.1.1.dist-info → adapto-0.1.3.dist-info}/top_level.txt +0 -0
adapto/scaler.py
CHANGED
@@ -9,7 +9,7 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(
|
|
9
9
|
|
10
10
|
|
11
11
|
class AutoScaler:
|
12
|
-
def __init__(self, scale_up_threshold=
|
12
|
+
def __init__(self, scale_up_threshold=75, scale_down_threshold=30, memory_threshold=75,
|
13
13
|
bandwidth_threshold=100000000, min_instances=1, max_instances=10, history_size=10, custom_scaling=None):
|
14
14
|
self.scale_up_threshold = scale_up_threshold
|
15
15
|
self.scale_down_threshold = scale_down_threshold
|
@@ -20,6 +20,9 @@ class AutoScaler:
|
|
20
20
|
self.max_instances = max_instances
|
21
21
|
self.previous_network = psutil.net_io_counters()
|
22
22
|
|
23
|
+
# Alias for test compatibility
|
24
|
+
self.cpu_threshold = scale_up_threshold # Fix for test cases
|
25
|
+
|
23
26
|
# Optional custom scaling function; should accept (metrics, predictions) and return 'scale_up', 'scale_down', or 'no_change'
|
24
27
|
self.custom_scaling = custom_scaling
|
25
28
|
|
@@ -125,4 +128,4 @@ class AutoScaler:
|
|
125
128
|
# Example usage
|
126
129
|
if __name__ == "__main__":
|
127
130
|
scaler = AutoScaler()
|
128
|
-
scaler.monitor()
|
131
|
+
scaler.monitor()
|
@@ -0,0 +1,9 @@
|
|
1
|
+
adapto/__init__.py,sha256=8SWysOKRVNsD3cOXLOfIdVZx6MxzIqGKEh9Z26QuCyM,30
|
2
|
+
adapto/predictor.py,sha256=ze-cMHdf290o3_9D-PQ7yQ8eMz1Utv3E3qTHRUFQiAI,842
|
3
|
+
adapto/scaler.py,sha256=BqAs7rlIbrK4kkeBQzz3CgLHwpKWjhyQCciACqbFqTY,5654
|
4
|
+
adapto/utils.py,sha256=6TgDvowlXL__v-OkLSTZF12ZOEqEKCLuNv1LmL70eAY,140
|
5
|
+
adapto-0.1.3.dist-info/LICENSE,sha256=B73NNEiUy-CCs4zrOPlOWR39PfoG4zKtK97OnNctjvg,1070
|
6
|
+
adapto-0.1.3.dist-info/METADATA,sha256=I09ftZmmqq2srMzQ2-ITC8hBIspuVym29oI9dZXYWjQ,609
|
7
|
+
adapto-0.1.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
8
|
+
adapto-0.1.3.dist-info/top_level.txt,sha256=IYsgAr6fnEC1R1ztYmK2ZpFNNGV0qRaf3Tvf-R8j0cM,7
|
9
|
+
adapto-0.1.3.dist-info/RECORD,,
|
adapto-0.1.1.dist-info/RECORD
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
adapto/__init__.py,sha256=8SWysOKRVNsD3cOXLOfIdVZx6MxzIqGKEh9Z26QuCyM,30
|
2
|
-
adapto/predictor.py,sha256=ze-cMHdf290o3_9D-PQ7yQ8eMz1Utv3E3qTHRUFQiAI,842
|
3
|
-
adapto/scaler.py,sha256=qyILt7ob6i9gXHx9LfB4x6C_rXuFjIbbHxfxwR-555w,5545
|
4
|
-
adapto/utils.py,sha256=6TgDvowlXL__v-OkLSTZF12ZOEqEKCLuNv1LmL70eAY,140
|
5
|
-
adapto-0.1.1.dist-info/LICENSE,sha256=B73NNEiUy-CCs4zrOPlOWR39PfoG4zKtK97OnNctjvg,1070
|
6
|
-
adapto-0.1.1.dist-info/METADATA,sha256=1FEIK8WyYwqgdx1D6iNMXZXJcGKoRAFh7yktYOCG8tA,609
|
7
|
-
adapto-0.1.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
8
|
-
adapto-0.1.1.dist-info/top_level.txt,sha256=IYsgAr6fnEC1R1ztYmK2ZpFNNGV0qRaf3Tvf-R8j0cM,7
|
9
|
-
adapto-0.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|