forked from Yelp/paasta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A new autoscaling policy that scales number of containers proportiona…
…lly, and can be extended to incorporate load predictions.
- Loading branch information
Showing
4 changed files
with
294 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Feature: service autoscaling works as expected | ||
Scenario: save_historical_load and fetch_historical_load can save and fetch data. | ||
Given a working paasta cluster, with docker registry doesntmatter.lol | ||
Given some fake historical load data | ||
When I save the fake historical load data | ||
Then I should get the same fake historical load data back when I fetch it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import absolute_import | ||
from __future__ import unicode_literals | ||
|
||
from behave import given | ||
from behave import then | ||
from behave import when | ||
|
||
from paasta_tools.autoscaling import autoscaling_service_lib | ||
|
||
|
||
@given('some fake historical load data') | ||
def make_fake_historical_load_data(context): | ||
context.fake_historical_load_data = [ | ||
(1, 10), | ||
(2, 20), | ||
(3, 10), | ||
(4, 1337), | ||
] | ||
|
||
|
||
@when('I save the fake historical load data') | ||
def save_fake_historical_load_data(context): | ||
autoscaling_service_lib.save_historical_load(context.fake_historical_load_data, '/itest/fake_historical_load_data') | ||
|
||
|
||
@then('I should get the same fake historical load data back when I fetch it') | ||
def load_fake_historical_load_data(context): | ||
actual = autoscaling_service_lib.fetch_historical_load('/itest/fake_historical_load_data') | ||
expected = context.fake_historical_load_data | ||
assert actual == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.