-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
193 additions
and
51 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
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,23 @@ | ||
{ | ||
"Provider": "azure", | ||
"Runtime": "python3.8", | ||
"SubExperiments": [ | ||
{ | ||
"Title": "azure-chunk-1-kbytes", | ||
"Function": "hellopy-read-per-1024-bytes", | ||
"Handler": "main.main", | ||
"PackageType": "Zip", | ||
"PackagePattern": "main.py", | ||
"Bursts": 500, | ||
"BurstSizes": [ | ||
1 | ||
], | ||
"IATSeconds": 600, | ||
"DesiredServiceTimes": [ | ||
"0ms" | ||
], | ||
"Parallelism": 50, | ||
"FunctionImageSizeMB": 100 | ||
} | ||
] | ||
} |
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,23 @@ | ||
{ | ||
"Provider": "azure", | ||
"Runtime": "python3.8", | ||
"SubExperiments": [ | ||
{ | ||
"Title": "azure-chunk-6-kbytes", | ||
"Function": "hellopy-read-per-6144-bytes", | ||
"Handler": "main.main", | ||
"PackageType": "Zip", | ||
"PackagePattern": "main.py", | ||
"Bursts": 500, | ||
"BurstSizes": [ | ||
1 | ||
], | ||
"IATSeconds": 600, | ||
"DesiredServiceTimes": [ | ||
"0ms" | ||
], | ||
"Parallelism": 50, | ||
"FunctionImageSizeMB": 100 | ||
} | ||
] | ||
} |
48 changes: 48 additions & 0 deletions
48
src/setup/deployment/raw-code/serverless/azure/hellopy-read-per-1024-bytes/main.py
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,48 @@ | ||
import json | ||
import os | ||
import time | ||
import random | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: | ||
incr_limit = int(req.params.get('IncrementLimit')) if req.params.get('IncrementLimit') else None | ||
if not incr_limit: | ||
try: | ||
req_body = req.get_json() | ||
except ValueError: | ||
incr_limit = 0 | ||
pass | ||
else: | ||
incr_limit = int(req_body.get('IncrementLimit')) if req_body.get('IncrementLimit') else 0 | ||
else: | ||
incr_limit = 0 | ||
|
||
simulate_work(incr_limit) | ||
read_filler_file(f"{context.function_directory}/../filler.file") | ||
|
||
return func.HttpResponse( | ||
body=json.dumps({ | ||
"RequestID": context.invocation_id, | ||
"TimestampChain": [str(time.time_ns())] | ||
}, indent=4), | ||
status_code=200, | ||
headers={ | ||
"Content-Type": "application/json" | ||
} | ||
) | ||
|
||
|
||
def simulate_work(increment): | ||
# MAXNUM = 6103705 | ||
num = 0 | ||
while num < increment: | ||
num += 1 | ||
|
||
|
||
def read_filler_file(path: str) -> None: | ||
with open(path, 'rb') as f: | ||
for i in range(1024): | ||
f.seek(i * 1024) | ||
f.read(1) |
48 changes: 48 additions & 0 deletions
48
src/setup/deployment/raw-code/serverless/azure/hellopy-read-per-6144-bytes/main.py
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,48 @@ | ||
import json | ||
import os | ||
import time | ||
import random | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: | ||
incr_limit = int(req.params.get('IncrementLimit')) if req.params.get('IncrementLimit') else None | ||
if not incr_limit: | ||
try: | ||
req_body = req.get_json() | ||
except ValueError: | ||
incr_limit = 0 | ||
pass | ||
else: | ||
incr_limit = int(req_body.get('IncrementLimit')) if req_body.get('IncrementLimit') else 0 | ||
else: | ||
incr_limit = 0 | ||
|
||
simulate_work(incr_limit) | ||
read_filler_file(f"{context.function_directory}/../filler.file") | ||
|
||
return func.HttpResponse( | ||
body=json.dumps({ | ||
"RequestID": context.invocation_id, | ||
"TimestampChain": [str(time.time_ns())] | ||
}, indent=4), | ||
status_code=200, | ||
headers={ | ||
"Content-Type": "application/json" | ||
} | ||
) | ||
|
||
|
||
def simulate_work(increment): | ||
# MAXNUM = 6103705 | ||
num = 0 | ||
while num < increment: | ||
num += 1 | ||
|
||
|
||
def read_filler_file(path: str) -> None: | ||
with open(path, 'rb') as f: | ||
for i in range(1024): | ||
f.seek(i * 6144) | ||
f.read(1) |