|
|
|
|
|
by gobwas
2215 days ago
|
|
I think all mentioned issues are related to the implementation of the user probes, not the pattern. You mentioned an observation methods, but essentially they are absolutely the same as hooks, just inverted (with a bit less overhead on branching and hook call). E.g. your example with bytesReceived counter can be implemented with atomic operation and further export on demand by some other goroutine. |
|
I usually refuse to use atomic increments for services because it scales very poorly. Even a mutex-protected increment scales much better than atomic increment.