sync gateway - process & server stats via REST call

50 views
Skip to first unread message

househippo

unread,
Nov 24, 2015, 7:46:48 PM11/24/15
to Couchbase Mobile
It be great to have REST call  to get sync gateway stats for a specific db and channels. Something similar to Couchbase servers /pools/default/bucktes/{bucket}/nodes/{cb-node}/stats

househippo

unread,
Nov 25, 2015, 2:22:16 AM11/25/15
to Couchbase Mobile

In https://github.com/couchbase/sync_gateway/blob/master/src/github.com/couchbase/sync_gateway/rest/routing.go

there are some stats here at line:

     Handle
("/_stats", makeHandler(sc, adminPrivs, (*handler).handleStats)).Methods("GET")

via http://<sync_gateway_host>:4985/_stats/

househippo

unread,
Nov 26, 2015, 2:07:36 AM11/26/15
to Couchbase Mobile
Did a little more digging on the below GET handle. It goes to: https://github.com/couchbase/sync_gateway/blob/master/src/github.com/couchbase/sync_gateway/rest/api.go

and the built-in function below.

runtime.ReadMemStats(&st.MemStats)

so its just pulling memory profile from golang. There are some other methods that runtime also has. LINK here: https://golang.org/pkg/runtime/

I'll see if I can append some more KPIs to the _stats call.

zgra...@gmail.com

unread,
Dec 2, 2015, 11:50:19 AM12/2/15
to mobile-c...@googlegroups.com
Fujio,

Check out `/_expvar`. There are gobs of stats there, albeit at the server level. 


This console app will display perf counters as curses sparklines. You can grab binaries on the releases tab.
--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/729de4cc-5573-4dbd-85dd-ef5d5cd53725%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jens Alfke

unread,
Dec 2, 2015, 12:08:48 PM12/2/15
to Couchbase Mobile
Some of the _expvar output is documented at https://github.com/couchbase/sync_gateway/wiki/expvars

--Jens
Message has been deleted

househippo

unread,
Dec 3, 2015, 12:55:46 AM12/3/15
to Couchbase Mobile
Thanks Zack,
That puts more structure to the stats to sync_gateway.

I was looking at this. https://github.com/shirou/gopsutil to get some other stats too. It does do to much more

I'll looking into per sync_gateway {db} & channel(s) status later.
something like http://<hostname>:4985/{db}/_
stats
Reply all
Reply to author
Forward
0 new messages