[ovs-dev,2/3] rconn: Remove write-only struct members.

Message ID 20190301235448.3168-2-blp@ovn.org
State New
Headers show
Series
  • [ovs-dev,1/3] sat-math: Add functions for saturating arithmetic on "long long int".
Related show

Commit Message

Ben Pfaff March 1, 2019, 11:54 p.m.
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 lib/rconn.c | 16 ----------------
 1 file changed, 16 deletions(-)

Patch

diff --git a/lib/rconn.c b/lib/rconn.c
index a5b31d099efd..ba95bb3a1a61 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -118,12 +118,6 @@  struct rconn {
     bool probably_admitted;
     time_t last_admitted;
 
-    /* These values are simply for statistics reporting, not used directly by
-     * anything internal to the rconn (or ofproto for that matter). */
-    unsigned int n_attempted_connections, n_successful_connections;
-    time_t creation_time;
-    unsigned long int total_time_connected;
-
     /* Throughout this file, "probe" is shorthand for "inactivity probe".  When
      * no activity has been observed from the peer for a while, we send out an
      * echo request as an inactivity probe packet.  We should receive back a
@@ -272,11 +266,6 @@  rconn_create(int probe_interval, int max_backoff, uint8_t dscp,
     rc->probably_admitted = false;
     rc->last_admitted = time_now();
 
-    rc->n_attempted_connections = 0;
-    rc->n_successful_connections = 0;
-    rc->creation_time = time_now();
-    rc->total_time_connected = 0;
-
     rc->last_activity = time_now();
 
     rconn_set_probe_interval(rc, probe_interval);
@@ -468,7 +457,6 @@  reconnect(struct rconn *rc)
     if (rconn_logging_connection_attempts__(rc)) {
         VLOG_INFO("%s: connecting...", rc->name);
     }
-    rc->n_attempted_connections++;
     retval = vconn_open(rc->target, rc->allowed_versions, rc->dscp,
                         &rc->vconn);
     if (!retval) {
@@ -512,7 +500,6 @@  run_CONNECTING(struct rconn *rc)
     int retval = vconn_connect(rc->vconn);
     if (!retval) {
         VLOG(rc->reliable ? VLL_INFO : VLL_DBG, "%s: connected", rc->name);
-        rc->n_successful_connections++;
         state_transition(rc, S_ACTIVE);
         rc->version = vconn_get_version(rc->vconn);
         rc->last_connected = rc->state_entered;
@@ -1286,9 +1273,6 @@  state_transition(struct rconn *rc, enum state state)
     if (is_connected_state(state) && !is_connected_state(rc->state)) {
         rc->probably_admitted = false;
     }
-    if (rconn_is_connected(rc)) {
-        rc->total_time_connected += elapsed_in_this_state(rc);
-    }
     VLOG_DBG("%s: entering %s", rc->name, state_name(state));
     rc->state = state;
     rc->state_entered = time_now();