Message ID | 1457466885-15123-1-git-send-email-azhou@ovn.org |
---|---|
State | Accepted |
Headers | show |
On Tue, Mar 08, 2016 at 11:54:45AM -0800, Andy Zhou wrote: > Add the size of json cache to the data reported by ovsdb-server appctl > "memory/show" command. > > Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
On Thu, Mar 10, 2016 at 5:50 PM, Ben Pfaff <blp@ovn.org> wrote: > On Tue, Mar 08, 2016 at 11:54:45AM -0800, Andy Zhou wrote: > > Add the size of json cache to the data reported by ovsdb-server appctl > > "memory/show" command. > > > > Signed-off-by: Andy Zhou <azhou@ovn.org> > > Acked-by: Ben Pfaff <blp@ovn.org> > Thanks. Pushed to master.
diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c index 6b0d13d..f9cd965 100644 --- a/ovsdb/monitor.c +++ b/ovsdb/monitor.c @@ -1170,7 +1170,12 @@ ovsdb_monitor_destroy_callback(struct ovsdb_replica *replica) void ovsdb_monitor_get_memory_usage(struct simap *usage) { + struct ovsdb_monitor *dbmon; simap_put(usage, "monitors", hmap_count(&ovsdb_monitors)); + + HMAP_FOR_EACH(dbmon, hmap_node, &ovsdb_monitors) { + simap_increase(usage, "json-caches", hmap_count(&dbmon->json_cache)); + } } static const struct ovsdb_replica_class ovsdb_jsonrpc_replica_class = {
Add the size of json cache to the data reported by ovsdb-server appctl "memory/show" command. Signed-off-by: Andy Zhou <azhou@ovn.org> --- ovsdb/monitor.c | 5 +++++ 1 file changed, 5 insertions(+)