I am building lots of apps where the consumer/producer pattern plays a big 
role. Usually, I end up tracking metrics on individual Go channels (e.g. 
enqueue/dequeue rate, periodically calling len(channel)). This works well 
to confirm if channels have the right capacity, consumers are keeping up, 
etc.  

That said, I would love to generalize this and *gather information about 
all Go channels* in my app. For Go Routines, the runtime 
<https://golang.org/pkg/runtime/> and pprof 
<https://golang.org/pkg/runtime/pprof/#Profiles> packages have some cool 
functionality like determining go routine count & listing each go routine's 
stacktrace. However, I can't find anything providing data about active 
channels. reflect <https://golang.org/pkg/reflect/> provides some useful 
functionality, but until I can programmatically discover all active 
channels that functionality is not going to help me.

Is there any way to list all active go channels similar to the go routine 
functionality provided by pprof/runtime? If not, I will likely just create 
all channels in a central location which can keep tabs on their state.

Thanks,
Ingo

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to