-
Notifications
You must be signed in to change notification settings - Fork 1
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
11 changed files
with
59 additions
and
46 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 |
---|---|---|
|
@@ -31,4 +31,3 @@ python: | |
- requirements: docs/requirements.txt | ||
- method: pip | ||
path: . | ||
|
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
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
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
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
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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
import os | ||
|
||
from algbench import Benchmark | ||
|
||
def test_file_splitting(): | ||
|
||
def test_file_splitting(): | ||
benchmark = Benchmark("./test_file_split_benchmark") | ||
|
||
# random data generation taken from https://stackoverflow.com/questions/16308989/ | ||
def generate_one_mb_results(args): | ||
offset = ord(b'A') | ||
def generate_one_mb_results(args): | ||
offset = ord(b"A") | ||
rand_bytes = os.urandom(1024 * 1024) | ||
array = bytearray(rand_bytes) | ||
for i, bt in enumerate(array): | ||
array[i] = offset + bt % 26 | ||
return {str(args["index"]) : bytes(array).decode()} | ||
return {str(args["index"]): bytes(array).decode()} | ||
|
||
for i in range(100): | ||
benchmark.add(generate_one_mb_results, {"index" : i}) | ||
benchmark.add(generate_one_mb_results, {"index": i}) | ||
|
||
# Hardcoded for now. The file splits are hardcoded in nfs_json_list to be made at 30 MB. | ||
# For the 100MB + some curly brackets and environments, this should produce 4 files. | ||
assert len(os.listdir("./test_file_split_benchmark/results")) == 4 | ||
# Hardcoded for now. The file splits are hardcoded in nfs_json_list to be made at 30 MB. | ||
# For the 100MB + some curly brackets and environments, this should produce 4 files. | ||
assert len(os.listdir("./test_file_split_benchmark/results")) == 4 | ||
|
||
benchmark.delete() | ||
benchmark.delete() |