Skip to content

Commit 41b690f

Browse files
authored
DEV-7335 Refactor: Use AppConfig class from the moesifapi-python api (#28)
Refactor: Use AppConfig class from the moesifapi-python api Refactor: Remove unused code Bump version to 0.3.5
1 parent 9ee072f commit 41b690f

File tree

6 files changed

+4
-167
lines changed

6 files changed

+4
-167
lines changed

moesifpythonrequest/app_config/__init__.py

Whitespace-only changes.

moesifpythonrequest/app_config/app_config.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

moesifpythonrequest/app_config/regex_config_helper.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

moesifpythonrequest/send_moesif/send_moesif.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import threading
66
import random
77
import math
8+
import json
89
import logging
910

1011
logger = logging.getLogger(__name__)
@@ -51,7 +52,7 @@ def send_moesif_async(self, event_model):
5152
logger.info("Can not execute MASK_EVENT_MODEL function. Please check moesif settings.")
5253

5354
random_percentage = random.random() * 100
54-
gv.sampling_percentage = gv.app_config.get_sampling_percentage(event_model, gv.config, event_model.user_id, event_model.company_id)
55+
gv.sampling_percentage = gv.app_config.get_sampling_percentage(event_model, json.loads(gv.config.raw_body), event_model.user_id, event_model.company_id)
5556

5657
if gv.sampling_percentage >= random_percentage:
5758
event_model.weight = 1 if gv.sampling_percentage == 0 else math.floor(100 / gv.sampling_percentage)

moesifpythonrequest/start_capture/start_capture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from .. import global_variables as gv
33
from ..patch_request.patch_request import PatchRequest
44
from ..send_moesif.send_moesif import SendMoesif
5-
from ..app_config.app_config import AppConfig
5+
from moesifapi.app_config import AppConfig
66
from moesifapi.moesif_api_client import MoesifAPIClient, Configuration
77
import logging
88

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# Versions should comply with PEP440. For a discussion on single-sourcing
2929
# the version across setup.py and the project code, see
3030
# https://packaging.python.org/en/latest/single_source_version.html
31-
version='0.3.4',
31+
version='0.3.5',
3232

3333
description='Moesif Python request',
3434
long_description=long_description,

0 commit comments

Comments
 (0)