Sync Gateway and Signal R

.net

#1

Hi,

Is there a way to get realtime info change of the basicstats of a sync gateway db? Maybe via SignalR?

thanks


#2

changes feed is exactly you need, basically it monitor SGW for any changes, basically it is observer which keep tap on SGW changes, as soon as any changes received,it send changes to Changes feed.

changes feed is nothing but an URL, you just need write an application which could monitor this URL

https://docs.couchbase.com/sync-gateway/2.1/admin-rest-api.html#/database/get__db___changes

for the starter you can refer to this URL

https://blog.couchbase.com/node-js-swagger-monitor-document-changes-couchbase-mobile/

in my opinion Signal R is overkill.


#3

What kind of stats are you specifically looking for ?


#4

Hi @priya.rajagopal
Mainly any kind of error in sgw. I have succeeded in hooking onto _changes-feed, no problems on that part. But changes are something else than errors.

I need to know when and what document is erroring. I want to be informed without looking at the SGW error logs. It’s a nice to have, not that it is blocking me.


#5

Good news is that Sync Gateway stats is something that we are evaluating as a future roadmap item (for next year).

In the meantime , you may want to checkout our GET _expvars API .API is pretty low level. But a combination of these stats along with system information (like cpu utilization , memory utilization ) can give useful insights into the performance of your system. Here is a simple tool that Fujio put together that you can use as a starting point

You won’t get details on documents that have error-ed etc but a large number of channel misses could be an indication that your system is not resourced / configured properly.


#6

thanks @priya.rajagopal for the info!