Skip to content

Commit

Permalink
mypy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lrdossan committed Feb 12, 2024
1 parent f8d4f72 commit 2451055
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions caimira/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from datetime import datetime
from enum import Enum
from functools import wraps
from pstats import f8, func_std_string
from pstats import f8, func_std_string # type: ignore

from pyinstrument import Profiler as PyInstrumentProfiler

Expand Down Expand Up @@ -134,12 +134,12 @@ def is_running(self):


class CaimiraProfiler:
_cache_dirpath: str
_cache_filepath: str
CACHE_DIR: str = os.environ.get("CAIMIRA_PROFILER_CACHE_DIR", "/tmp")
ROOT_URL: str = "/profiler"
_cache_dirpath: str = None
_cache_filepath: str = None

def __init__(self, cache_dir: typing.Optional[str] = None):
def __init__(self):
_cache_dir = os.path.join(self.CACHE_DIR, "caimira-profiler")
self._cache_dirpath = _cache_dir
self._cache_filepath = os.path.join(_cache_dir, "active")
Expand Down Expand Up @@ -209,7 +209,7 @@ def is_active(self):
def start_session(
self,
name: typing.Optional[str] = None,
profiler_type: typing.Optional[Profilers] = Profilers.PYINSTRUMENT,
profiler_type: Profilers = Profilers.PYINSTRUMENT,
):
"""Start a new session, assigning the given name."""
now = datetime.utcnow().isoformat()
Expand Down

0 comments on commit 2451055

Please sign in to comment.