Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging for agent usage by job #8283

Merged
merged 3 commits into from Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion core/src/main/java/hudson/slaves/SlaveComputer.java
Expand Up @@ -329,10 +329,11 @@

@Override
public void taskAccepted(Executor executor, Queue.Task task) {
LOGGER.log(Level.FINER, "Accepted {0} on {1}", new Object[] {task.toString(), executor.getOwner().getDisplayName()});

if (launcher instanceof ExecutorListener) {
((ExecutorListener) launcher).taskAccepted(executor, task);
}

//getNode() can return null at indeterminate times when nodes go offline
Slave node = getNode();
if (node != null && node.getRetentionStrategy() instanceof ExecutorListener) {
Expand All @@ -342,6 +343,7 @@

@Override
public void taskStarted(Executor executor, Queue.Task task) {
LOGGER.log(Level.FINER, "Started {0} on {1}", new Object[] {task.toString(), executor.getOwner().getDisplayName()});

Check warning on line 346 in core/src/main/java/hudson/slaves/SlaveComputer.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 346 is not covered by tests
if (launcher instanceof ExecutorListener) {
((ExecutorListener) launcher).taskStarted(executor, task);
}
Expand All @@ -353,6 +355,7 @@

@Override
public void taskCompleted(Executor executor, Queue.Task task, long durationMS) {
LOGGER.log(Level.FINE, "Completed {0} on {1}", new Object[] {task.toString(), executor.getOwner().getDisplayName()});
if (launcher instanceof ExecutorListener) {
((ExecutorListener) launcher).taskCompleted(executor, task, durationMS);
}
Expand All @@ -364,6 +367,7 @@

@Override
public void taskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems) {
LOGGER.log(Level.FINE, "Completed with problems {0} on {1}", new Object[] {task.toString(), executor.getOwner().getDisplayName()});

Check warning on line 370 in core/src/main/java/hudson/slaves/SlaveComputer.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 370 is not covered by tests
if (launcher instanceof ExecutorListener) {
((ExecutorListener) launcher).taskCompletedWithProblems(executor, task, durationMS, problems);
}
Expand Down