Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
slacrherbst committed Sep 26, 2024
1 parent 9588b43 commit e53a6cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 deletions.
17 changes: 1 addition & 16 deletions python/pyrogue/_Root.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,22 +1059,7 @@ def _updateWorker(self):
elif len(uvars) > 0:
self._log.debug(F'Process update group. Length={len(uvars)}. Entry={list(uvars.keys())[0]}')
for p,v in uvars.items():
val = v._doUpdate()

# Call listener functions,
with self._varListenLock:
for func,doneFunc,incGroups,excGroups in self._varListeners:
if v.filterByGroup(incGroups, excGroups):
try:
func(p,val)

except Exception as e:
if v == self.SystemLog or v == self.SystemLogLast:
print("------- Error Executing Syslog Listeners -------")
print("Error: {}".format(e))
print("------------------------------------------------")
else:
pr.logException(self._log,e)
self._updateVarWithRecurse(v)

# Finalize listeners
with self._varListenLock:
Expand Down
20 changes: 10 additions & 10 deletions tests/test_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import time
import hwcounter

import cProfile, pstats, io
from pstats import SortKey
#import cProfile, pstats, io
#from pstats import SortKey

#rogue.Logging.setLevel(rogue.Logging.Debug)
#import logging
Expand Down Expand Up @@ -108,8 +108,8 @@ def __init__(self):

def test_rate():

pr = cProfile.Profile()
pr.enable()
#pr = cProfile.Profile()
#pr.enable()

with DummyTree() as root:
count = 100000
Expand Down Expand Up @@ -185,13 +185,13 @@ def test_rate():
raise AssertionError('Rate check failed')


pr.disable()
#pr.disable()

s = io.StringIO()
sortby = SortKey.CUMULATIVE
ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
ps.print_stats()
print(s.getvalue())
#s = io.StringIO()
#sortby = SortKey.CUMULATIVE
#ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
#ps.print_stats()
#print(s.getvalue())

if __name__ == "__main__":
test_rate()

0 comments on commit e53a6cd

Please sign in to comment.