[ovs-dev] [resubmit 2/4] ofproto: Display idle time in bridge/dump-flows.

Ben Pfaff blp at nicira.com
Mon Feb 14 23:31:13 UTC 2011


On Mon, Feb 14, 2011 at 02:05:59PM -0800, Ethan Jackson wrote:
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index 305af35..3a74f79 100644
> --- a/ofproto/ofproto.c
> +++ b/ofproto/ofproto.c
> @@ -3664,6 +3664,7 @@ flow_stats_ds(struct ofproto *ofproto, struct rule *rule, struct ds *results)
>  
>      ds_put_format(results, "duration=%llds, ",
>                    (time_msec() - rule->created) / 1000);
> +    ds_put_format(results, "idle=%llds, ", (time_msec() - rule->used) / 1000);
>      ds_put_format(results, "priority=%u, ", rule->cr.priority);
>      ds_put_format(results, "n_packets=%"PRIu64", ", packet_count);
>      ds_put_format(results, "n_bytes=%"PRIu64", ", byte_count);

The corresponding code for printing datapath flows shows fractional
seconds, excerpted below.  It would be nice to do this here too.

    ds_put_format(s, "packets:%"PRIu64", bytes:%"PRIu64", used:",
                  stats->n_packets, stats->n_bytes);
    if (stats->used) {
        ds_put_format(s, "%.3fs", (time_msec() - stats->used) / 1000.0);
    } else {
        ds_put_format(s, "never");
    }




More information about the dev mailing list