Commit Graph

3 Commits

Author SHA1 Message Date
Victor Agababov 5f6cb70257
Switch to the atomic bool from uber package (#1595)
- makes code easier to follow
- hides the int32->bool conversions inside the library
2020-08-07 22:31:28 -07:00
Markus Thömmes 8c62412074 Optimize locking behavior of the profiling handler. (#980)
The profiling handler is in the path of our most performance critical components (especially the activator). Taking a write-lock on each request is probably a bad idea.

Replaced the mutex with an atomic flag. Lost reads are not critical in this code path and that should be the quickest solution in terms of avoiding contention.
2020-01-08 12:35:53 -08:00
Martin Gencur 366ab85660 Profiling support (#562)
* Profiling support

* Move ProfilingPort to profiling package

* Fix golint errors

* Refactor watcher to accept variable length observers

* Cleaner happy path

* Remove profiling handlers argument

* use :8008 string as const

* Make the profiling port package private

* Make UpdateFromConfigMap member of profiling handler

* use mutex when accessing the enabled flag
* test the server as well

* Fixes

* Initialize profiling from configMap at startup

* Use httptest.ResponseRecorder to make the test more lightweight

* Fixes

* Do not initialize from configmap at startup
2019-08-22 08:17:33 -07:00