-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add types to compat module * Refine types
- Loading branch information
1 parent
0c14210
commit 15334a6
Showing
2 changed files
with
18 additions
and
4 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 |
---|---|---|
@@ -1,21 +1,29 @@ | ||
# (C) Datadog, Inc. 2020-present | ||
# All rights reserved | ||
# Licensed under Simplified BSD License (see LICENSE) | ||
from typing import Any, Optional | ||
|
||
try: | ||
from datadog_checks.base.utils.common import total_time_to_temporal_percent | ||
except ImportError: | ||
|
||
# Provide fallback for agent < 6.16 | ||
def total_time_to_temporal_percent(total_time, scale=1000): | ||
def total_time_to_temporal_percent(total_time, scale=1000): # type: ignore | ||
return total_time / scale * 100 | ||
|
||
|
||
try: | ||
from datadog_agent import get_config, read_persistent_cache, write_persistent_cache | ||
except ImportError: | ||
|
||
def get_config(value): | ||
def get_config(key): | ||
# type: (str) -> Optional[str] | ||
return '' | ||
|
||
def write_persistent_cache(value, key): | ||
def write_persistent_cache(key, value): | ||
# type: (str, str) -> None | ||
pass | ||
|
||
def read_persistent_cache(value): | ||
def read_persistent_cache(key): | ||
# type: (str) -> Optional[str] | ||
return '' |
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