Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/** Implementation of a single GCCollectionEvent formed from data from an MxBean. */
class GcCollectionSample implements GcCollectionEvent {
private static final Logger LOGGER = LoggerFactory.getLogger(GcCollectionSample.class);
private static final Logger logger = LoggerFactory.getLogger(GcCollectionSample.class);

private static final String ID = "id";

Expand Down Expand Up @@ -77,7 +77,7 @@ private static Map<MemoryPool, MemoryUsage> groupMemoryUsageByPoolName(
}
}
} catch (RuntimeException e) {
LOGGER.error("Failed to group pool data", e);
logger.error("Failed to group pool data", e);
}
return Collections.unmodifiableMap(byIdentifier);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* thread.
*/
public class NotificationObserver implements NotificationListener {
private static final Logger LOGGER = LoggerFactory.getLogger(NotificationObserver.class);
private static final Logger logger = LoggerFactory.getLogger(NotificationObserver.class);
private static final int MAX_QUEUE_SIZE = 1000;
private final LinkedBlockingQueue<NotificationJob> workQueue =
new LinkedBlockingQueue<>(MAX_QUEUE_SIZE);
Expand Down Expand Up @@ -46,7 +46,7 @@ public void handleNotification(@Nullable Notification notification, Object handb
workQueue.offer(new NotificationJob((JmxGarbageCollectorStats) handback, notification));
}
} catch (RuntimeException e) {
LOGGER.error("Failed to process gc notification", e);
logger.error("Failed to process gc notification", e);
}
}

Expand All @@ -63,7 +63,7 @@ public void watchGcNotificationEvents() {
sample.collector.update(sample.notification);
}
} catch (RuntimeException e) {
LOGGER.error("Error while reading GC notification data", e);
logger.error("Error while reading GC notification data", e);
}
}
} catch (InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
public class AlertingSubsystem {

private static final Logger LOGGER = LoggerFactory.getLogger(AlertingSubsystem.class);
private static final Logger logger = LoggerFactory.getLogger(AlertingSubsystem.class);

// Downstream observer of alerts produced by the alerting system
private final Consumer<AlertBreach> alertHandler;
Expand Down Expand Up @@ -100,7 +100,7 @@ public void trackTelemetryDataPoint(@Nullable TelemetryDataPoint telemetryDataPo
if (telemetryDataPoint == null) {
return;
}
LOGGER.trace(
logger.trace(
"Tracking " + telemetryDataPoint.getType().name() + " " + telemetryDataPoint.getValue());
alertPipelines.process(telemetryDataPoint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/** Contains analysis pipelines for all metric types. */
public class AlertPipelines {
private static final Logger LOGGER = LoggerFactory.getLogger(AlertPipelines.class);
private static final Logger logger = LoggerFactory.getLogger(AlertPipelines.class);

// List of alert analysis pipelines for each metric type, entrypoint
// for the pipeline is a rolling average
Expand Down Expand Up @@ -59,7 +59,7 @@ public void updateAlertConfig(AlertConfiguration newAlertConfig, TimeSource time
pipeline.updateConfig(newAlertConfig);
}

LOGGER.debug(
logger.debug(
"Set alert configuration for {}: {}", newAlertConfig.getType(), newAlertConfig.toString());
}

Expand All @@ -86,7 +86,7 @@ public void updateRequestAlertConfig(

alertPipelines.put(AlertMetricType.REQUEST, new AlertPipelineMultiplexer(requestPipelines));

LOGGER.debug(
logger.debug(
"Set alert configuration for {}: {} pipelines updated",
AlertMetricType.REQUEST,
newAlertConfig.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/** Contains a pipeline that receives telemetry, feeds it into the analysis pipeline. */
public class SingleAlertPipeline implements AlertPipeline, AlertPipelineMXBean {

private static final Logger LOGGER = LoggerFactory.getLogger(SingleAlertPipeline.class);
private static final Logger logger = LoggerFactory.getLogger(SingleAlertPipeline.class);
private static final String JMX_KEY = "com.microsoft:type=AI-alert,name=";

private final Aggregation aggregation;
Expand Down Expand Up @@ -71,7 +71,7 @@ private void registerMbean() {
ManagementFactory.getPlatformMBeanServer().registerMBean(this, objectName);

} catch (Exception e) {
LOGGER.error("Failed to register MBEAN", e);
logger.error("Failed to register MBEAN", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* coordinate emitting diagnostics on a breach.
*/
public class CodeOptimizerDiagnosticEngineJfr implements DiagnosticEngine {
private static final Logger LOGGER =
private static final Logger logger =
LoggerFactory.getLogger(CodeOptimizerDiagnosticEngineJfr.class);
public static final int SEMAPHORE_TIMEOUT_IN_SEC = 10;
public static final long TIME_BEFORE_END_OF_PROFILE_TO_EMIT_EVENT = 10L;
Expand All @@ -42,25 +42,25 @@ public CodeOptimizerDiagnosticEngineJfr(ScheduledExecutorService executorService
@Override
public void init(int thisPid) {
if (!CodeOptimizerDiagnosticsJfrInit.isOsSupported()) {
LOGGER.warn("Code Optimizer diagnostics is not supported on this operating system");
logger.warn("Code Optimizer diagnostics is not supported on this operating system");
return;
}

this.thisPid = thisPid;

LOGGER.debug("Initialising Code Optimizer Diagnostic Engine");
logger.debug("Initialising Code Optimizer Diagnostic Engine");
CodeOptimizerDiagnosticsJfrInit.initFeature(thisPid);
LOGGER.debug("Code Optimizer Diagnostic Engine Initialised");
logger.debug("Code Optimizer Diagnostic Engine Initialised");
}

private static void startDiagnosticCycle(int thisPid) {
LOGGER.debug("Starting Code Optimizer Diagnostic Cycle");
logger.debug("Starting Code Optimizer Diagnostic Cycle");
CodeOptimizerDiagnosticsJfrInit.initFeature(thisPid);
CodeOptimizerDiagnosticsJfrInit.start(thisPid);
}

private static void endDiagnosticCycle() {
LOGGER.debug("Ending Code Optimizer Diagnostic Cycle");
logger.debug("Ending Code Optimizer Diagnostic Cycle");
CodeOptimizerDiagnosticsJfrInit.stop();
}

Expand Down Expand Up @@ -106,10 +106,10 @@ private void scheduleShutdown(
// We do not return a result atm
diagnosisResultCompletableFuture.complete(null);

LOGGER.debug("Shutting down diagnostic cycle");
logger.debug("Shutting down diagnostic cycle");
endDiagnosticCycle();
} catch (RuntimeException e) {
LOGGER.error("Failed to shutdown cleanly", e);
logger.error("Failed to shutdown cleanly", e);
} finally {
semaphore.release();
}
Expand All @@ -125,15 +125,15 @@ private void scheduleEmittingAlertBreachEvent(AlertBreach alert, long end) {
try {
emitInfo(alert);
} catch (RuntimeException e) {
LOGGER.error("Failed to emit breach", e);
logger.error("Failed to emit breach", e);
}
},
end / 2,
TimeUnit.SECONDS);
}

private static void emitInfo(AlertBreach alert) {
LOGGER.debug("Emitting Code Optimizer Diagnostic Event");
logger.debug("Emitting Code Optimizer Diagnostic Event");
emitAlertBreachJfrEvent(alert);
CodeOptimizerDiagnosticsJfrInit.emitCGroupData();
emitMachineStats();
Expand All @@ -150,9 +150,9 @@ private static void emitAlertBreachJfrEvent(AlertBreach alert) {
alert.toJson(writer).flush();
AlertBreachJfrEvent event = new AlertBreachJfrEvent().setAlertBreach(stringWriter.toString());
event.commit();
LOGGER.debug("Emitted Code Optimizer Diagnostic Event");
logger.debug("Emitted Code Optimizer Diagnostic Event");
} catch (IOException e) {
LOGGER.error("Failed to create breach JFR event", e);
logger.error("Failed to create breach JFR event", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class CalibratorDefault implements Calibrator {

private static final Logger LOGGER = LoggerFactory.getLogger(ContextSwitchingRunner.class);
private static final Logger logger = LoggerFactory.getLogger(ContextSwitchingRunner.class);

private final ContextSwitchingRunner contextSwitching;
private final KernelMonitorDeviceDriver kernel;
Expand Down Expand Up @@ -69,7 +69,7 @@ public Calibration calibrate() {
double contextSwitchingRate = safeDiv(maxContextSwitches, timeDiagnosticsHadAvailable);
return new Calibration(contextSwitchingRate);
} catch (Throwable e) {
LOGGER.debug("Completing exceptionally", e);
logger.debug("Completing exceptionally", e);
}
return new Calibration(Calibration.UNKNOWN);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/** Util to identify the host operating system */
public class OperatingSystemDetector {

private static final Logger LOGGER = LoggerFactory.getLogger(OperatingSystemDetector.class);
private static final Logger logger = LoggerFactory.getLogger(OperatingSystemDetector.class);

private static final String OS_NAME_PROPERTY = "os.name";
private static final String MAC = "mac";
Expand All @@ -25,7 +25,7 @@ public class OperatingSystemDetector {
OperatingSystem detectedOs = OperatingSystem.UNKNOWN;
try {
String operatingSystemString = System.getProperty(OS_NAME_PROPERTY).toLowerCase(Locale.ROOT);
LOGGER.debug("Detected OS " + operatingSystemString);
logger.debug("Detected OS " + operatingSystemString);
if (operatingSystemString.contains(MAC)) {
detectedOs = OperatingSystem.MAC_OS;
} else if (operatingSystemString.contains(LINUX)) {
Expand All @@ -38,7 +38,7 @@ public class OperatingSystemDetector {
detectedOs = OperatingSystem.UNKNOWN;
}
} catch (RuntimeException e) {
LOGGER.warn("Failed to detect operating system", e);
logger.warn("Failed to detect operating system", e);
}
operatingSystem = detectedOs;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class LinuxProcessCpuStats extends TwoStepProcReader implements ProcessCp
private static final int VM_SIZE_OFFSET_FROM_NAME = 21;
private static final int RSS_OFFSET_FROM_NAME = 22;
private static final int N_SWAPPED_OFFSET_FROM_NAME = 34;
private static final Logger LOGGER = LoggerFactory.getLogger(LinuxProcessCpuStats.class);
private static final Logger logger = LoggerFactory.getLogger(LinuxProcessCpuStats.class);

private final BigIncrementalCounter userTime;
private final BigIncrementalCounter systemTime;
Expand Down Expand Up @@ -72,7 +72,7 @@ private static void setValue(BigIncrementalCounter userTime, String userTime1) {
try {
userTime.newValue(new BigInteger(userTime1));
} catch (NumberFormatException e) {
LOGGER.trace("Failed to parse {}", userTime1);
logger.trace("Failed to parse {}", userTime1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/** Detects running processes on the host. */
public class LinuxProcessDumper implements ProcessDumper, Closeable {
private static final Logger LOGGER = LoggerFactory.getLogger(LinuxProcessDumper.class);
private static final Logger logger = LoggerFactory.getLogger(LinuxProcessDumper.class);

private final boolean isDaemon;
private Map<Integer, LinuxProcess> usage = new HashMap<>();
Expand Down Expand Up @@ -76,7 +76,7 @@ public void closeProcesses(List<Integer> exclusions) {
try {
removed.close();
} catch (IOException e) {
LOGGER.error("Failed to close process", e);
logger.error("Failed to close process", e);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/** Obtains per-process IO statistics. */
public class LinuxProcessIoStats extends TwoStepProcReader implements ProcessIoStats {
private static final Logger LOGGER = LoggerFactory.getLogger(LinuxProcessIoStats.class);
private static final Logger logger = LoggerFactory.getLogger(LinuxProcessIoStats.class);

private static final Pattern IO_READ_PATTERN =
Pattern.compile("^rchar: (\\d+)$", Pattern.MULTILINE);
Expand Down Expand Up @@ -54,7 +54,7 @@ private static boolean findBigIntegerValue(
try {
counter.newValue(new BigInteger(matcher.group(1)));
} catch (NumberFormatException e) {
LOGGER.trace("Failed to parse {}", matcher.group(1));
logger.trace("Failed to parse {}", matcher.group(1));
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public abstract class TwoStepProcReader implements TwoStepUpdatable, Closeable {

private static final Logger LOGGER = LoggerFactory.getLogger(TwoStepProcReader.class);
private static final Logger logger = LoggerFactory.getLogger(TwoStepProcReader.class);

protected RandomAccessFile file;
protected String contents;
Expand All @@ -33,7 +33,7 @@ public TwoStepProcReader(File candidate, boolean supressError) {
file = new RandomAccessFile(candidate, "r");
} catch (FileNotFoundException e) {
if (!supressError) {
LOGGER.error("Failed to open proc net file", e);
logger.error("Failed to open proc net file", e);
}
}
}
Expand All @@ -54,7 +54,7 @@ public void poll() {
contents = Proc.read(file);
}
} catch (IOException e) {
LOGGER.error("Failed to read stats for file", e);
logger.error("Failed to read stats for file", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@SuppressWarnings("Java8ApiChecker")
public class CodeOptimizerDiagnosticsJfrInit {

private static final Logger LOGGER =
private static final Logger logger =
LoggerFactory.getLogger(CodeOptimizerDiagnosticsJfrInit.class);
private static final AtomicBoolean running = new AtomicBoolean(false);
private static final AtomicInteger exceptionLogCount = new AtomicInteger(0);
Expand Down Expand Up @@ -56,9 +56,9 @@ private static Runnable emitTelemetry(SystemStatsReader statsReader) {
private static void logFailure(String logLine, @Nullable Exception e, AtomicInteger count) {
if ((count.get() % 100) == 0) {
if (e != null) {
LOGGER.warn(logLine, e);
logger.warn(logLine, e);
} else {
LOGGER.warn(logLine);
logger.warn(logLine);
}

count.set(0);
Expand All @@ -76,7 +76,7 @@ public static void emitCGroupData() {
cgroupData.commit();
}
} catch (RuntimeException e) {
LOGGER.warn("Reading Cgroup Data Failed", e);
logger.warn("Reading Cgroup Data Failed", e);
}
}

Expand Down Expand Up @@ -107,7 +107,7 @@ public static void start(int thisPidSupplier) {
try {
statsReader.close();
} catch (IOException e) {
LOGGER.error("Failed to init stats reader", e);
logger.error("Failed to init stats reader", e);
}
}
FlightRecorder.addPeriodicEvent(CGroupData.class, readCGroupData);
Expand Down
Loading
Loading