forked from stackimpact/stackimpact-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
28 lines (21 loc) · 709 Bytes
/
Copy pathconfig.py
File metadata and controls
28 lines (21 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import threading
class Config(object):
def __init__(self, agent):
self.agent = agent
self.agent_enabled = False
self.profiling_disabled = False
self.config_lock = threading.Lock()
def set_agent_enabled(self, val):
with self.config_lock:
self.agent_enabled = val
def is_agent_enabled(self):
with self.config_lock:
val = self.agent_enabled
return val
def set_profiling_disabled(self, val):
with self.config_lock:
self.profiling_disabled = val
def is_profiling_disabled(self):
with self.config_lock:
val = self.profiling_disabled
return val