snews_cs.heartbeat_feedbacks

Attributes

log

contact_list_file

contact_list

detector_file

snews_detectors

snews_detectors

cache_db

cache_engine

cache_df

Classes

FeedBack

Once every minute, check the HB of each detector.

Functions

vprint(inp, _bool)

check_frequencies_and_send_mail(detector[, given_contact])

Create a plot with latency and heartbeat frequencies

plot_beats(df, detector, figname)

Requires QT libraries: sudo apt-get install qt5-default

delete_old_figures()

Remove the old feedback figures from the server

Module Contents

snews_cs.heartbeat_feedbacks.log[source]
snews_cs.heartbeat_feedbacks.contact_list_file = b'.'[source]
snews_cs.heartbeat_feedbacks.contact_list[source]
snews_cs.heartbeat_feedbacks.detector_file = b'.'[source]
snews_cs.heartbeat_feedbacks.snews_detectors[source]
snews_cs.heartbeat_feedbacks.snews_detectors[source]
snews_cs.heartbeat_feedbacks.vprint(inp, _bool)[source]
snews_cs.heartbeat_feedbacks.cache_db[source]
snews_cs.heartbeat_feedbacks.cache_engine[source]
snews_cs.heartbeat_feedbacks.cache_df = None[source]
class snews_cs.heartbeat_feedbacks.FeedBack(verbose=False)[source]

Once every minute, check the HB of each detector. If the last heartbeat is from longer than usual, send an email Once every user-defined time interval, send a plot with latency and frequency statistics

detectors[source]
last_feedback_time[source]
day_in_min = 1440[source]
running_min = 0[source]
db_found = False[source]
verbose = False[source]
__call__()[source]

Continuously run and check expected heartbeats every minute Also, check if the detectors requested feedbacks create and send feedbacks with the desired time intervals

dataframe_from_db_table()[source]

Try to read the database, if it is empty (or does not exist) wait

control(df)[source]

Check the current cache, check if any detector missed a beat

check_missed_beats(df, detector)[source]

Check if a heartbeat is skipped

check_enough_detectors()[source]

Constantly check to make sure there is at least two detector taking data. If not, send a warning to everyone.

snews_cs.heartbeat_feedbacks.check_frequencies_and_send_mail(detector, given_contact=None)[source]

Create a plot with latency and heartbeat frequencies and send it via emails

snews_cs.heartbeat_feedbacks.plot_beats(df, detector, figname)[source]

Requires QT libraries: sudo apt-get install qt5-default

snews_cs.heartbeat_feedbacks.delete_old_figures()[source]

Remove the old feedback figures from the server the duration set in the configuration file