Re: Any where from the Run object to find out how much CPU the job is consuming?
Guess I should have added more context.
I have users adding this type of code to their pipeline scripts.
... some code. that takes about 10ms. or less
Which of course causes a lot of CPU usage on the master due to the frequent lookups to the identical username/password. What I'm looking is there a way from inside Jenkins https://javadoc.jenkins-ci.org/hudson/model/Run.html to get at how much CPU/Memory the Pipeline Job is used during it's run?
I want to write a Jenkins Plugin (Like an Action Badge or something) to report on it to screen and save to an external audit DB. But I first must get the resource usage from inside Jenkins somehow.
On Tue, Mar 30, 2021 at 1:21 PM Michael Carter
<[hidden email]> wrote:
> Which of course causes a lot of CPU usage on the master due to the frequent lookups to the identical username/password.
I suppose you have already concluded that the high CPU usage is caused
by the abovementioned credential lookups. But in case you (or anyone
else) are still investigating other possible causes of high CPU usage,
I have had great success with generating flame graphs from Jenkins
controller Java processes using
https://github.com/jvm-profiling-tools/async-profiler. It's pretty
fascinating to look at the flame graph for a minute or so of execution
of even a healthy Jenkins controller: you get a sense of what your
workload typically looks like and therefore develop a baseline against
which to analyze pathological performance later on. It's even more
fascinating to look at the flame graph for Jenkins initialization,
especially on a busy controller.