Commit Graph

18 Commits

Author SHA1 Message Date
Antonin Bas
5b31113588 Use generics for workqueue metrics
The workqueue implementation was recently updated to be strongly typed,
using Go generics. However the metrics implementation was not updated,
and continued using interface{}. This translated to unnecessary memory
allocations when invoking the queueMetrics interface methods to track
queue operation. We can avoid these extra heap allocations by using
generics for the metrics implementation as well.

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>

Kubernetes-commit: 1aec7568e111f5855121e3afacacf431e5f95948
2024-09-25 14:35:03 -07:00
Alvaro Aleman
d67dddfe90 Workqueue: Add generic versions that are properly typed
This change adds a generic version of the various workqueue types while
retaining compatibility for the existing exported symbols and constructors.
The generic variants are prefixed with `Typed` and the existing ones are
marked as deprecated to nudge people to transition without breaking
them.

Kubernetes-commit: 0c7370bb851c15825d30a516722139ccccca0cfc
2024-04-11 18:11:41 -04:00
Haibing Zhou
9c3db8681d workqueue: make queue as configurable
The default queue implementation is mostly FIFO and it is not
exchangeable unless we implement the whole `workqueue.Interface` which
is less desirable as we have to duplicate a lot of code. There was one
attempt done in [kubernetes/kubernetes#109349][1] which tried to
implement a priority queue. That is really useful and [knative/pkg][2]
implemented something called two-lane-queue. While two lane queue is
great, but isn't perfect since a full slow queue can still slow down
items in fast queue.

This change proposes a swappable queue implementation while not adding
extra maintenance effort in kubernetes community. We are happy to
maintain our own queue implementation (similar to two-lane-queue) in
downstream.

[1]: https://github.com/kubernetes/kubernetes/pull/109349
[2]: https://github.com/knative/pkg/blob/main/controller/two_lane_queue.go

Kubernetes-commit: 87b4279e07349b3c68f16f69a349a02bddd12f25
2024-02-16 12:09:37 -08:00
austin ce
66fa9d308f Unify queue constructors, deprecate current constructors
Kubernetes-commit: fea83b78243c77e81b91f3f0a812979809aeacaf
2023-03-10 17:46:26 -05:00
austin ce
9668243c04 Integrate new metrics provider option in test case
Kubernetes-commit: 9e83e7e975dd5971e60e9768e06520aa5ebf9bf8
2022-12-02 14:08:11 -05:00
austin ce
98d0d1a9ba Allow setting per-queue metrics providers
Kubernetes-commit: da71811514ac6e8fedd265831fed71f897b97781
2022-11-29 20:47:33 -05:00
wojtekt
14a51589c3 Migratet to k8s.io/utils/clock in workqueue
Kubernetes-commit: 392292ba81964e6ee7badec360a800b1f8645f2f
2021-09-09 16:38:59 +02:00
knight42
f2963a02f6 test(workqueue): deflake TestMetrics
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: b70e1d836c2d438af6b01fd297677b900b364a33
2020-09-05 18:50:45 +08:00
danielqsj
51f3d77844 clean SinceInMicroseconds, convert to SinceInSeconds
Kubernetes-commit: ab182552b485ceed96c3b05d284ae9480377daf8
2019-04-15 16:18:01 +08:00
Sergiusz Urbaniak
ee078c72e2 pkg/util/workqueue: delete deprecated metrics
This deletes deprecated metrics and simplifies registration.

Kubernetes-commit: 4532cfd85c00da6f64e03fcf05f5636adc1151c7
2019-05-13 13:22:08 +02:00
danielqsj
6658e1f4a3 Using histogram metrics instead of summary
Kubernetes-commit: 42214c5ac423289a6c87e0f3c1014f652d58bf62
2018-12-12 16:50:32 +08:00
danielqsj
c270b352df Use prometheus conventions for workqueue metrics
Kubernetes-commit: b828bc1a50dfa29ab85248e5af6da5acb27189c1
2018-11-21 11:43:47 +08:00
Daniel Smith
f0e9de6741 fixup! add longest_running_processor_microseconds metric
fix data race

Kubernetes-commit: 680ddd49d8d23a88744f9de720f266022effd409
2018-11-12 12:57:42 -08:00
Daniel Smith
952b05be23 add longest_running_processor_microseconds metric
Kubernetes-commit: fd77aa5a41bbce7490dd4538c0d5743cb59b2be4
2018-11-12 10:52:18 -08:00
Daniel Smith
cc2731ad7e fixup! Test workqueue metrics
change units to seconds

Kubernetes-commit: 578962d934df19cb2cb7ec0536dcb76f53951e68
2018-11-10 18:46:43 -08:00
Daniel Smith
e403f1715c fixup! Test workqueue metrics
Kubernetes-commit: 44a87baf09aec4f2e8e159de4c409d27aebbb1da
2018-11-10 18:24:59 -08:00
Daniel Smith
26f9385b8e Test workqueue metrics
Kubernetes-commit: 5a8444ceec9e28e8a7dbf36bfd7cb55554c5b865
2018-11-09 16:12:11 -08:00
Daniel Smith
75d4dad922 add a metric that can be used to notice stuck worker threads
Kubernetes-commit: 6195d1005d81eaa5dd49da744f5beab178340f5a
2018-11-09 10:43:44 -08:00