Changeset - 436a1fdbfe4a
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-05-23 22:52:26
drewp@bigasterisk.com
comment
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
lib/background_loop.py
Show inline comments
 
@@ -102,24 +102,25 @@ class Loop:
 
                self.newlyFailing = False
 
            else:
 
                log.error(ex)
 
            self.up_metric.set(0)
 
            result = None
 
            self.succeeding = False
 

	
 
            await asyncio.sleep(self.extra_sleep_on_error)
 
            # todo: something that reveals error ratio
 
        return result
 

	
 
    def _updateFps(self, now: float):
 
        # not sure i even want this- it's redundant with some metrics code
 
        if self.fps is None:
 
            return
 
        if now < self.lastFpsLog + 5:
 
            return
 
        d = self.fps()
 
        y_hi = 1 / self.sleep_period
 
        if not d:
 
            return
 
        pts = [int(min(4, y / y_hi * 4)) for y in d['recents']]
 
        log.info(f'{self.metric_prefix} fps={d["average"]:3.1f} (req={y_hi:3.1f}) {horizontal_graph(pts)}')
 
        self.lastFpsLog = now
 

	
0 comments (0 inline, 0 general)