def record(self, var_name, var_value):
"""
Call this method each time you want to record a variable with name `var_name` and value `var_value`.
Usually, there is one plot for each `var_name`.
:param var_name: Name of variable to record
:param var_value: Value of variable to record
"""
assert not isinstance(var_value, type(SENTINEL)) or var_value != SENTINEL, \
"You cannot record a value {} since this conflicts with the internal SENTINEL string"
topic = pickle.dumps(var_name, protocol=pickle.HIGHEST_PROTOCOL)
messagedata = pickle.dumps(var_value, protocol=pickle.HIGHEST_PROTOCOL)
self.socket.send_multipart([topic, messagedata])
rlogger.debug("Sent message to topic %s", var_name)
评论列表
文章目录