Skip to content

Commit

Permalink
fix: global variable call
Browse files Browse the repository at this point in the history
Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
  • Loading branch information
s0nicboOm committed Jun 13, 2024
1 parent bf77eab commit 39069f1
Show file tree
Hide file tree
Showing 13 changed files with 672 additions and 174 deletions.
2 changes: 1 addition & 1 deletion numalogic/udfs/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
BASE_CONF_FILE_PATH: Final[str] = os.getenv("BASE_CONF_PATH", default=DEFAULT_BASE_CONF_PATH)
APP_CONF_FILE_PATH: Final[str] = os.getenv("APP_CONF_PATH", default=DEFAULT_APP_CONF_PATH)
METRICS_PORT: Final[int] = int(os.getenv("METRICS_PORT", default=DEFAULT_METRICS_PORT))
METRICS_ENABLED: Final[bool] = bool(os.getenv("METRICS_ENABLED", default="True"))
METRICS_ENABLED: Final[bool] = bool(int(os.getenv("METRICS_ENABLED", default="1")))
METRICS_CONF_PATH: Final[str] = os.getenv("METRICS_CONF_PATH", default=DEFAULT_METRICS_CONF_PATH)


Expand Down
2 changes: 1 addition & 1 deletion numalogic/udfs/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
LOCAL_CACHE_TTL = int(os.getenv("LOCAL_CACHE_TTL", "3600"))
LOCAL_CACHE_SIZE = int(os.getenv("LOCAL_CACHE_SIZE", "10000"))
LOAD_LATEST = os.getenv("LOAD_LATEST", "false").lower() == "true"
METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"
METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))


class InferenceUDF(NumalogicUDF):
Expand Down
2 changes: 1 addition & 1 deletion numalogic/udfs/payloadtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from numalogic.udfs._logger import configure_logger, log_data_payload_values
from numalogic.udfs._metrics_utility import _increment_counter

METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"
METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))

_struct_log = configure_logger()

Expand Down
2 changes: 1 addition & 1 deletion numalogic/udfs/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
LOCAL_CACHE_TTL = int(os.getenv("LOCAL_CACHE_TTL", "3600"))
LOCAL_CACHE_SIZE = int(os.getenv("LOCAL_CACHE_SIZE", "10000"))
LOAD_LATEST = os.getenv("LOAD_LATEST", "false").lower() == "true"
METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"
METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))
SCORE_PREFIX = os.getenv("SCORE_PREFIX", "unified")

_struct_log = configure_logger()
Expand Down
3 changes: 1 addition & 2 deletions numalogic/udfs/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
LOCAL_CACHE_TTL = int(os.getenv("LOCAL_CACHE_TTL", "3600"))
LOCAL_CACHE_SIZE = int(os.getenv("LOCAL_CACHE_SIZE", "10000"))
LOAD_LATEST = os.getenv("LOAD_LATEST", "false").lower() == "true"
METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"

METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))
_struct_log = configure_logger()


Expand Down
2 changes: 1 addition & 1 deletion numalogic/udfs/staticthresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from numalogic.udfs._metrics_utility import _increment_counter
from numalogic.udfs.entities import StreamPayload, OutputPayload

METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"
METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))
SCORE_PREFIX = os.getenv("SCORE_PREFIX", "unified")
_struct_log = configure_logger()

Expand Down
2 changes: 1 addition & 1 deletion numalogic/udfs/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from numalogic.udfs._metrics_utility import _set_gauge, _increment_counter, _add_info
from numalogic.udfs.entities import StreamPayload, TrainerPayload

METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"
METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))


_struct_log = configure_logger()
Expand Down
3 changes: 1 addition & 2 deletions numalogic/udfs/trainer/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
from numalogic.udfs.tools import TrainMsgDeduplicator
import torch

METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"

METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))
_struct_log = configure_logger()


Expand Down
3 changes: 1 addition & 2 deletions numalogic/udfs/trainer/_druid.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
from numalogic.udfs.trainer._base import TrainerUDF
from numalogic.udfs._metrics_utility import _increment_counter, _add_summary

METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"

METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))
_struct_log = configure_logger()


Expand Down
3 changes: 1 addition & 2 deletions numalogic/udfs/trainer/_prom.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
from numalogic.udfs._metrics_utility import _increment_counter, _add_summary
from numalogic.udfs.trainer._base import TrainerUDF

METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"

METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))
_struct_log = configure_logger()


Expand Down
3 changes: 1 addition & 2 deletions numalogic/udfs/trainer/_rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
from datetime import datetime, timedelta
import pytz

METRICS_ENABLED = os.getenv("METRICS_ENABLED", "True").lower() == "true"

METRICS_ENABLED = bool(int(os.getenv("METRICS_ENABLED", default="1")))
_LOGGER = logging.getLogger(__name__)


Expand Down
Loading

0 comments on commit 39069f1

Please sign in to comment.