Commit 90e8ccd
committed
MINOR: sample: add new sample fetch functions reporting current CPU usage
Some features can automatically turn on or off depending on CPU usage,
but it's not easy to measure it. Let's provide 3 new sample fetch functions
reporting the CPU usage as measured inside haproxy during the previous
polling loop, and reported in "idle" stats header / "show info", or used
by tune.glitches.kill.cpu-usage, or maxcompcpuusage:
- cpu_usage_thr: CPU usage between 0 and 100 of the current thread, used
by functions above
- cpu_usage_grp: CPU usage between 0 and 100, averaged over all threads of
the same group as the current one.
- cpu_usage_proc: CPU usage between 0 and 100, averaged over all threads
of the current process
Note that the value will fluctuate since it only covers a few tens to
hundreds of requests of the last polling loop, but it reports what is
being used to take decisions.
It could also be used to disable some non-essential debugging/processing
under too high loads for example.1 parent 630ef96 commit 90e8ccd
2 files changed
Lines changed: 64 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23672 | 23672 | | |
23673 | 23673 | | |
23674 | 23674 | | |
| 23675 | + | |
| 23676 | + | |
| 23677 | + | |
| 23678 | + | |
| 23679 | + | |
| 23680 | + | |
| 23681 | + | |
| 23682 | + | |
| 23683 | + | |
| 23684 | + | |
| 23685 | + | |
| 23686 | + | |
| 23687 | + | |
| 23688 | + | |
| 23689 | + | |
| 23690 | + | |
| 23691 | + | |
| 23692 | + | |
| 23693 | + | |
| 23694 | + | |
| 23695 | + | |
| 23696 | + | |
| 23697 | + | |
| 23698 | + | |
23675 | 23699 | | |
23676 | 23700 | | |
23677 | 23701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5089 | 5089 | | |
5090 | 5090 | | |
5091 | 5091 | | |
| 5092 | + | |
| 5093 | + | |
| 5094 | + | |
| 5095 | + | |
| 5096 | + | |
| 5097 | + | |
| 5098 | + | |
| 5099 | + | |
| 5100 | + | |
| 5101 | + | |
| 5102 | + | |
| 5103 | + | |
| 5104 | + | |
| 5105 | + | |
| 5106 | + | |
| 5107 | + | |
| 5108 | + | |
| 5109 | + | |
| 5110 | + | |
| 5111 | + | |
| 5112 | + | |
| 5113 | + | |
| 5114 | + | |
| 5115 | + | |
| 5116 | + | |
| 5117 | + | |
| 5118 | + | |
| 5119 | + | |
| 5120 | + | |
| 5121 | + | |
| 5122 | + | |
| 5123 | + | |
| 5124 | + | |
| 5125 | + | |
| 5126 | + | |
| 5127 | + | |
| 5128 | + | |
5092 | 5129 | | |
5093 | 5130 | | |
5094 | 5131 | | |
| |||
5677 | 5714 | | |
5678 | 5715 | | |
5679 | 5716 | | |
| 5717 | + | |
| 5718 | + | |
| 5719 | + | |
5680 | 5720 | | |
5681 | 5721 | | |
5682 | 5722 | | |
| |||
0 commit comments