Skip to content

Commit 81f783f

Browse files
committed
refactor: remove process_count from SampleGenerator
1 parent 2daa0e1 commit 81f783f

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

pytest_splunk_addon/standard_lib/sample_generation/sample_generator.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
import time
17-
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
16+
from concurrent.futures import ThreadPoolExecutor
1817

1918
from . import EventgenParser
2019
from . import SampleStanza
@@ -30,16 +29,14 @@ class SampleGenerator(object):
3029
sample_stanzas = []
3130
conf_name = " "
3231

33-
def __init__(self, addon_path, config_path=None, process_count=4):
32+
def __init__(self, addon_path, config_path=None):
3433
"""
3534
init method for the class
3635
3736
Args:
3837
addon_path(str): path to the addon
39-
process_count(no): generate {no} process for execution
4038
"""
4139
self.addon_path = addon_path
42-
self.process_count = process_count
4340
self.config_path = config_path
4441

4542
def get_samples(self):
@@ -54,7 +51,6 @@ def get_samples(self):
5451
SampleGenerator.conf_name = eventgen_parser.conf_name
5552
with ThreadPoolExecutor(min(20, max(len(sample_stanzas), 1))) as t:
5653
t.map(SampleStanza.get_raw_events, sample_stanzas)
57-
# with ProcessPoolExecutor(self.process_count) as p:
5854
_ = list(
5955
map(
6056
SampleStanza.tokenize,

tests/unit/tests_standard_lib/tests_sample_generation/test_sample_generator.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ def test_init(self):
1414
sg = SampleGenerator(ADDON_PATH, CONFIG_PATH)
1515
assert sg.addon_path == ADDON_PATH
1616
assert sg.config_path == CONFIG_PATH
17-
assert sg.process_count == 4
18-
sg = SampleGenerator(ADDON_PATH, CONFIG_PATH, 2)
19-
assert sg.addon_path == ADDON_PATH
20-
assert sg.config_path == CONFIG_PATH
21-
assert sg.process_count == 2
2217

2318
def test_get_samples(self):
2419
tks_1 = "tokenized_sample_1"

0 commit comments

Comments
 (0)