self.json_logger.info("The minimum available time for radio front end processing (ms)",
extra={'data':min_txrx_delay_list})
ifnotmin_txrx_delay_listornotavg_txrx_delay:
self.logger.error("No TX/RX diff data available")
elifmin_unavailable:
self.logger.error("The minimum available time %s (ms) for radio front end processing is higher than a threshold %s (ms) depending on the radio front end."%(min_delay,min_txrx_delay))
elifavg_unavailable:
self.logger.error("The average available time %s (ms) for radio front end processing is higher than a threshold %s (ms) depending on the radio front end."%(avg_delay,avg_txrx_delay))
else:
self.logger.info("The minimum %s (ms) and average %s (ms) available time for radio front end processing OK"%(min_delay,avg_delay))
deftest(self):
"""
Called after sense() if the instance is still converging.
Returns success or failure based on sense results.
In this case, fail if the previous sensor result is negative.
"""
returnself._test(result_count=1,failure_amount=1)
defanomaly(self):
"""
Called after sense() if the instance has finished converging.
Returns success or failure based on sense results.
Failure signals the instance has diverged.
In this case, fail if two out of the last three results are negative.
self.logger.error("Average temperature over the last %s seconds reached threshold: %s degrees celsius (threshold is %s degrees celsius)"%(max_avg_temp_duration,avg_temp,max_avg_temp))
promise_success=False
ifpromise_success:
self.logger.info("Temperature OK")
deftest(self):
"""
Called after sense() if the instance is still converging.
Returns success or failure based on sense results.
In this case, fail if the previous sensor result is negative.
"""
returnself._test(result_count=1,failure_amount=1)
defanomaly(self):
"""
Called after sense() if the instance has finished converging.
Returns success or failure based on sense results.
Failure signals the instance has diverged.
In this case, fail if two out of the last three results are negative.