Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pytau timings #63

Merged
merged 1 commit into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions ipsframework/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@
import weakref
from copy import copy

try:
if os.environ['IPS_TIMING'] == '1':
try:
import pytau
except ImportError:
raise
IPS_TIMING = True
except KeyError:
pass


class Component:
"""
Expand All @@ -28,9 +18,6 @@ def __init__(self, services, config):
"""
Set up config values and reference to services.
"""
# pytau.setNode(1)
# timer = pytau.profileTimer("component.__init__", "", str(os.getpid()))
# pytau.start(timer)
self.component_id = None
self.invocation_q = None
self.services = weakref.proxy(services)
Expand All @@ -42,11 +29,8 @@ def __init__(self, services, config):
setattr(self, i, config[i])
except Exception as e:
print('Error setting Component parameter : ', i, ' - ', e)
# pytau.stop(timer)
raise

# pytau.stop(timer)

def __copy__(self):
cls = self.__class__
result = cls.__new__(cls)
Expand All @@ -61,16 +45,11 @@ def __initialize__(self, component_id, invocation_q, start_time=0.0):
"""
Establish connection to *invocation_q*.
"""
# timer = pytau.profileTimer("component.__initialize__", "", str(os.getpid()))
# pytau.start(timer)
self.component_id = component_id
self.invocation_q = invocation_q
self.start_time = start_time
# setattr(sys, 'exit', sys.exit)

# pytau.stop(timer)
return

def __my_exit__(self, arg=0):
"""
Produce message and exception about exit.
Expand All @@ -86,8 +65,6 @@ def __run__(self):
Wait for incoming commands delivered via the *invocation_q*, and
dispatch the incoming methods accordingly.
"""
# timer = pytau.profileTimer(self.component_id.__str__() + ".__run__", "", str(os.getpid()))
# pytau.start(timer)

tmp = sys.exit
sys.exit = self.__my_exit__
Expand Down Expand Up @@ -131,7 +108,6 @@ def __run__(self):
(errno, strerror) = oserr.args
self.services.exception('Error creating directory %s : %s',
workdir, strerror)
# pytau.stop(timer)
raise
os.chdir(workdir)
self.services.debug('Running - CompID = %s',
Expand All @@ -140,9 +116,6 @@ def __run__(self):
if (self.services.profile):
self.services.debug('Instrumenting - CompID = %s',
self.component_id.get_serialization())
pytau.setNode(int(self.component_id.get_seq_num()))
pytau.dbPurge()
self.services._make_timers()
self.services._init_event_service()

while True:
Expand Down Expand Up @@ -175,7 +148,6 @@ def __run__(self):
call_id,
Message.SUCCESS, retval)
self.services.fwk_in_q.put(response_msg)
# pytau.stop(timer)

def init(self, timestamp=0.0, **keywords):
"""
Expand Down Expand Up @@ -241,7 +213,6 @@ def terminate(self, status):
Clean up services and call :py:obj:`sys_exit`.
"""
# print self.services.full_comp_id, ": terminate() method called"
self.services._cleanup()
# self.services.debug('###(1) %s %s', str(self), str(self.__dict__))

if (status == Message.SUCCESS):
Expand Down
Loading