faucet.gauge_pollers module

Library for polling dataplanes for statistics.

class faucet.gauge_pollers.GaugeFlowTablePoller(conf, logname, prom_client)[source]

Bases: faucet.gauge_pollers.GaugeThreadPoller

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.

no_response()[source]

Called when a polling cycle passes without receiving a response.

send_req()[source]

Send a stats request to a datapath.

class faucet.gauge_pollers.GaugePoller(conf, logname, prom_client)[source]

Bases: object

Abstraction for a poller for statistics.

static is_active()[source]

Return True if the poller is controlling the request loop for its stat

no_response()[source]

Called when a polling cycle passes without receiving a response.

report_dp_status(dp_status)[source]

Report DP status.

running()[source]

Return True if the poller is running.

send_req()[source]

Send a stats request to a datapath.

start(ryudp, active)[source]

Start the poller.

stop()[source]

Stop the poller.

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.gauge_pollers.GaugePortStatePoller(conf, logname, prom_client)[source]

Bases: faucet.gauge_pollers.GaugePoller

Abstraction for port state poller.

no_response()[source]

Called when a polling cycle passes without receiving a response.

send_req()[source]

Send a stats request to a datapath.

class faucet.gauge_pollers.GaugePortStatsPoller(conf, logname, prom_client)[source]

Bases: faucet.gauge_pollers.GaugeThreadPoller

Periodically sends a port stats request to the datapath and parses and outputs the response.

no_response()[source]

Called when a polling cycle passes without receiving a response.

send_req()[source]

Send a stats request to a datapath.

class faucet.gauge_pollers.GaugeThreadPoller(conf, logname, prom_client)[source]

Bases: faucet.gauge_pollers.GaugePoller

A ryu thread object for sending and receiving OpenFlow stats requests.

The thread runs in a loop sending a request, sleeping then checking a response was received before sending another request.

The methods send_req, update and no_response should be implemented by subclasses.

is_active()[source]

Return True if the poller is controlling the request loop for its stat

no_response()[source]

Called when a polling cycle passes without receiving a response.

send_req()[source]

Send a stats request to a datapath.

start(ryudp, active)[source]

Start the poller.

stop()[source]

Stop the poller.