Commit Graph

12 Commits

Author SHA1 Message Date
Kenjiro Nakayama c11003ae6d
Use go sync/atomic instead of go.uber.org/atomic (#2777)
* wip

* tiny fix

* Fix controller/controller_test.go

* fix metrics.go

* Fix profiling/server.go

* Fix reconciler/testing

* update ./test/spoof/spoof_test.go

* Fix ./test/zipkin/util.go

* update go.uber.org/atomic
2023-08-02 16:26:48 +00:00
kmahapatra 2f55fe00c5
Fix potential slowloris attack (#2682) 2023-02-15 23:47:51 +00:00
Dave Protasowski 44d1d7d978
Go1.19 changes (#2631)
* run goimports

* ignore linter errors for now

* fix boilerplate
2022-11-03 22:34:05 +00:00
Matt Moore 120f38c15b
Make the profiling port configurable via envvar. (#1950)
* Make the profiling port configurable via envvar.

With this folks can override the default 8008 with PROFILING_PORT.

Fixes: https://github.com/knative/pkg/issues/1948

* Revert breaking int -> str change
2020-12-08 09:45:41 -08:00
Victor Agababov 247841408e
Apply the cleanup to the pkg (#1776)
* Apply the cleanup to the pkg

This is probably the final iteration of my cleanup application.

* codegen

* one more try
2020-10-05 21:41:20 -07:00
Victor Agababov 1e373a9e5d
take 2 (#1755) 2020-09-29 14:10:29 -07:00
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
Markus Thömmes e08acb9512 Remove all occurrences of github.com/pkg/errors. (#888) 2019-12-17 10:41:03 -08:00
Francesco Guardiani f0da42d387 Made ReadProfilingKey method public and more generic (#852)
* Made ReadProfilingKey method public and more generic

* Removed old readProfilingFlag
2019-11-07 06:31:55 -08:00
Martin Gencur c1d6e0d598 Define ProfilingPort and make profiling server use it (#599)
* Define ProfilingPort and make profiling server use it

* Fix typ

* Move ProfilingPort to server.go
2019-08-28 19:18:43 -07: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