Benchmark Utilities
filesender.benchmark.benchmark
benchmark(
paths: List[Path],
limit: int,
base_url: str,
username: str,
apikey: str,
recipient: str,
) -> List[BenchResult]
Runs a test upload using a variety of semaphore settings, and return one result for each.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
paths |
List[Path]
|
A list of files to upload. Typically generated by |
required |
limit |
int
|
The value for |
required |
base_url |
str
|
The FileSender instance URL |
required |
username |
str
|
Your username for accessing the FileSender instance |
required |
apikey |
str
|
Your API key for accessing the FileSender instance |
required |
recipient |
str
|
A valid email address that will be sent the files |
required |
filesender.benchmark.BenchResult
dataclass
filesender.benchmark.make_tempfiles
Makes n
temporary files of size size
and yields them as a list via context manager.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
The size of each file in bytes |
required |
n |
int
|
The number of files to generate |
2
|
kwargs |
Any
|
Additional args to pass to [tempfile.NamedTemporaryFile] |
{}
|