Skip to content

Commit

Permalink
mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andgineer committed Aug 31, 2021
1 parent 19d0990 commit 5cb1737
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions bombard/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import statistics
from array import array
from copy import deepcopy
from typing import Optional, Set

from bombard.pretty_ns import pretty_ns, time_ns
from bombard.pretty_sz import pretty_sz
Expand All @@ -31,12 +32,15 @@ class Reporter:
"""

def __init__(
self, time_units: str = "ms", time_threshold_ms: int = 1, success_statuses: dict = [200]
self,
time_units: Optional[str] = "ms",
time_threshold_ms: int = 1,
success_statuses: Set[int] = {200},
):
"""
:param time_units: time representation fixed in the units (see names in bombard.pretty_ns)
:param time_threshold_ms: show times bigger than that in red
:param success_statuses: dict of statuses treated as success
:param success_statuses: set of statuses treated as success
"""
self.DIMENSIONS = {
TIME: {
Expand Down
4 changes: 2 additions & 2 deletions bombard/weaver_mill.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from copy import deepcopy
from queue import Queue
from threading import Thread
from typing import Any, Dict
from typing import Any, Dict, Optional


class WeaverMill:
Expand All @@ -19,7 +19,7 @@ def __init__(self, threads_num: int = 10):
"""
self.threads_num = threads_num
self.threads = []
self.queue: Queue = Queue()
self.queue: Queue[Optional[Dict[str, Any]]] = Queue()
self.job_count = 0
for thread_id in range(threads_num):
t = Thread(target=self.thread_worker, args=[thread_id])
Expand Down

0 comments on commit 5cb1737

Please sign in to comment.