faucet.watcher module

Gauge watcher implementations.

class faucet.watcher.GaugeFlowTableLogger(conf, logname, prom_client)[source]

Bases: faucet.gauge_pollers.GaugeFlowTablePoller

Periodically dumps the current datapath flow table as a yaml object.

Includes a timestamp and a reference ($DATAPATHNAME-flowtables). The flow table is dumped as an OFFlowStatsReply message (in yaml format) that matches all flows.

optionally the output can be compressed by setting compressed: true in the config for this watcher

update(rcv_time, dp_id, msg)[source]

Handle the responses to requests.

Called when a reply to a stats request sent by this object is received by the controller.

It should acknowledge the receipt by setting self.reply_pending to false.

Parameters
  • rcv_time – the time the response was received

  • dp_id – DP ID

  • msg – the stats reply message

class faucet.watcher.GaugePortStateLogger(conf, logname, prom_client)[source]

Bases: faucet.gauge_pollers.GaugePortStatePoller

Abstraction for port state logger.

static no_response()[source]

Called when a polling cycle passes without receiving a response.

static send_req()[source]

Send a stats request to a datapath.

update(rcv_time, dp_id, msg)[source]

Handle the responses to requests.

Called when a reply to a stats request sent by this object is received by the controller.

It should acknowledge the receipt by setting self.reply_pending to false.

Parameters
  • rcv_time – the time the response was received

  • dp_id – DP ID

  • msg – the stats reply message

class faucet.watcher.GaugePortStatsLogger(conf, logname, prom_client)[source]

Bases: faucet.gauge_pollers.GaugePortStatsPoller

Abstraction for port statistics logger.

update(rcv_time, dp_id, msg)[source]

Handle the responses to requests.

Called when a reply to a stats request sent by this object is received by the controller.

It should acknowledge the receipt by setting self.reply_pending to false.

Parameters
  • rcv_time – the time the response was received

  • dp_id – DP ID

  • msg – the stats reply message

faucet.watcher.watcher_factory(conf)[source]

Return a Gauge object based on type.

Parameters

conf (GaugeConf) – object with the configuration for this valve.