tjiuming opened a new pull request #14453:
URL: https://github.com/apache/pulsar/pull/14453
### Motivation
1. Avoid more than once `PrometheusMetricsGenerator#generate` invoke in a
period(1 minute), for the purpose of saving memory and reducing CPU usage.
2. Persist metrics data into file and send to client by jetty's `send_file`.
Avoid huge heap memory allocations, too much `mem_copy` operations, too much
memory resizes, high GC pressure and high CPU usage.
### Modifications
1. Using sliding window in `PrometheusMetricsGenerator#generate`, invoke
`PrometheusMetricsGenerator#generate` once in a period, cache the result and
return to client directly.
2. Persist metrics data into temp file, send it to client by `send_file`.
3. Delete temp files when JVM exits.
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- Dependencies (does it add or upgrade a dependency): (no)
- The public API: (no)
- The schema: (no)
- The default values of configurations: (no)
- The wire protocol: (no)
- The rest endpoints: (no)
- The admin cli options: (no)
- Anything that affects deployment: (no)
### Documentation
Check the box below or label this PR directly (if you have committer
privilege).
Need to update docs?
- [ ] `doc-required`
(If you need help on updating docs, create a doc issue)
- [x] `no-need-doc`
(Please explain why)
- [ ] `doc`
(If this PR contains doc changes)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]