Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5e58011
wip
dlmarion Mar 30, 2026
18288fd
Reworked ScanServer view using generic ServersView object
dlmarion Mar 30, 2026
8e022a3
Fix build
dlmarion Mar 31, 2026
b87a2b2
Attempting to get the table to render
dlmarion Mar 31, 2026
cce9b3e
Changes to get the table to render
dlmarion Apr 1, 2026
bfa9fcf
Merge branch 'main' into monitor-columns-compute-serverside
dlmarion Apr 6, 2026
317f10e
latest changes, not working
dlmarion Apr 7, 2026
320dc95
Back to working
dlmarion Apr 8, 2026
48ff468
Removed unused code, refactored javascript
dlmarion Apr 8, 2026
e1da14d
Hide server type column based on server-type class
dlmarion Apr 8, 2026
80b3cd1
Fix license
dlmarion Apr 8, 2026
0ee71b8
Fixing build
dlmarion Apr 8, 2026
87b9eac
Server process pages are functional
dlmarion Apr 9, 2026
9beeae4
Aggregate metric values when name is same but tags differ
dlmarion Apr 9, 2026
c812b3b
Modified information on Manager and GC views to use multiple tables
dlmarion Apr 9, 2026
3aee520
Re-enable state saving
dlmarion Apr 9, 2026
94b680c
Show 'N/A' when no data for column
dlmarion Apr 9, 2026
27b0bbc
Cleanup
dlmarion Apr 10, 2026
baad894
Remove generated code from tree, fix typo
dlmarion Apr 10, 2026
9ba3f0b
Merge branch 'main' into monitor-columns-compute-serverside
dlmarion Apr 13, 2026
fd6b329
Added DataTables ColReorder extension
dlmarion Apr 13, 2026
7074c03
Implemented PR suggestions
dlmarion Apr 14, 2026
ca3b985
move ColumnJsGen run into prepare-package build step (#59)
DomGarguilo Apr 14, 2026
29db9ad
Merge branch 'monitor-columns-compute-serverside' of https://github.c…
dlmarion Apr 14, 2026
d358a15
fix refresh and manager banners (#60)
DomGarguilo Apr 15, 2026
213f059
Fix javadoc
dlmarion Apr 15, 2026
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
8 changes: 8 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,12 @@ Files (in server/monitor/src/main/resources/):
Copyright (c) 2008-2024 SpryMedia Ltd
Licensed under the MIT license (see above)

## DataTables ColReorder 1.7.0 (https://datatables.net)

Files (in server/monitor/src/main/resources/):
* org/apache/accumulo/monitor/resources/external/datatables/**/*

Copyright (c) 2010-2015 SpryMedia Limited
Licensed under the MIT license (see above)

**********
367 changes: 253 additions & 114 deletions core/src/main/java/org/apache/accumulo/core/metrics/Metric.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import java.net.UnknownHostException;
import java.util.OptionalInt;
import java.util.Set;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
Expand All @@ -39,6 +40,7 @@
import org.apache.accumulo.core.conf.SiteConfiguration;
import org.apache.accumulo.core.data.ResourceGroupId;
import org.apache.accumulo.core.lock.ServiceLock;
import org.apache.accumulo.core.metrics.Metric;
import org.apache.accumulo.core.metrics.MetricsProducer;
import org.apache.accumulo.core.process.thrift.MetricResponse;
import org.apache.accumulo.core.process.thrift.MetricSource;
Expand Down Expand Up @@ -95,6 +97,7 @@ public static void startServer(AbstractServer server, Logger LOG) throws Excepti
private final AtomicBoolean shutdownRequested = new AtomicBoolean(false);
private final AtomicBoolean shutdownComplete = new AtomicBoolean(false);
private final AtomicBoolean closed = new AtomicBoolean(false);
private final Set<String> monitorMetricExclusions;

protected AbstractServer(ServerId.Type serverType, ServerOpts opts,
BiFunction<SiteConfiguration,ResourceGroupId,ServerContext> serverContextFactory,
Expand Down Expand Up @@ -177,6 +180,7 @@ protected AbstractServer(ServerId.Type serverType, ServerOpts opts,
default:
throw new IllegalArgumentException("Unhandled server type: " + serverType);
}
monitorMetricExclusions = Metric.getMonitorExclusions(serverType);
}

/**
Expand Down Expand Up @@ -403,10 +407,12 @@ public MetricResponse getMetrics(TInfo tinfo, TCredentials credentials) throws T
if (context.getMetricsInfo().isMetricsEnabled()) {
Metrics.globalRegistry.getMeters().forEach(m -> {
if (m.getId().getName().startsWith("accumulo.")) {
m.match(response::writeMeter, response::writeMeter, response::writeTimer,
response::writeDistributionSummary, response::writeLongTaskTimer,
response::writeMeter, response::writeMeter, response::writeFunctionTimer,
response::writeMeter);
if (!this.monitorMetricExclusions.contains(m.getId().getName())) {
m.match(response::writeMeter, response::writeMeter, response::writeTimer,
response::writeDistributionSummary, response::writeLongTaskTimer,
response::writeMeter, response::writeMeter, response::writeFunctionTimer,
response::writeMeter);
}
}
});
}
Expand Down
24 changes: 24 additions & 0 deletions server/monitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down Expand Up @@ -242,6 +246,26 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>metrics-javascript</id>
<goals>
<goal>java</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<mainClass>org.apache.accumulo.monitor.next.views.ColumnJsGen</mainClass>
<classpathScope>compile</classpathScope>
<arguments>
<argument>${project.build.directory}/classes/org/apache/accumulo/monitor/resources/js/columns.js</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import jakarta.inject.Inject;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.MatrixParam;
import jakarta.ws.rs.NotFoundException;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
Expand All @@ -54,20 +55,25 @@
import org.apache.accumulo.monitor.next.deployment.DeploymentOverview;
import org.apache.accumulo.monitor.next.ec.CompactorsSummary;
import org.apache.accumulo.monitor.next.ec.CoordinatorSummary;
import org.apache.accumulo.monitor.next.sservers.ScanServerView;
import org.apache.accumulo.monitor.next.views.ServersView;

import io.micrometer.core.instrument.Meter.Id;
import io.micrometer.core.instrument.cumulative.CumulativeDistributionSummary;

@Path("/")
public class Endpoints {
/**
* A {@code String} constant representing supplied resource group in path parameter.
* A {@code String} constant representing the supplied resource group in path parameter.
*/
private static final String GROUP_PARAM_KEY = "group";

/**
* A {@code String} constant representing supplied tableId in path parameter.
* A {@code String} constant representing the supplied server type in path parameter.
*/
private static final String SERVER_TYPE_KEY = "serverType";

/**
* A {@code String} constant representing the supplied tableId in path parameter.
*/
private static final String TABLEID_PARAM_KEY = "tableId";

Expand Down Expand Up @@ -271,11 +277,17 @@ public Map<Id,CumulativeDistributionSummary> getScanServerAllMetricSummary() {
}

@GET
@Path("sservers/view")
@Path("servers/view")
@Produces(MediaType.APPLICATION_JSON)
@Description("Returns a UI-ready view model for the Scan Server status page")
public ScanServerView getScanServerPageView() {
return monitor.getInformationFetcher().getSummaryForEndpoint().getScanServerView();
@Description("Returns a UI-ready view model for server processes. Add ';serverType=<ServerId.Type>' to URL")
public ServersView getServerProcessView(@MatrixParam(SERVER_TYPE_KEY) ServerId.Type serverType) {
ServersView view =
monitor.getInformationFetcher().getSummaryForEndpoint().getServerProcessView(serverType);
if (view == null) {
throw new NotFoundException(
"ServersView object for server type " + serverType.name() + " not found");
}
return view;
}

@GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void newConnectionEvent() {
}

// Protect against NPE and wait for initial data gathering
public SystemInformation getSummary() throws InterruptedException {
private SystemInformation getSummary() throws InterruptedException {
while (summaryRef.get() == null) {
Thread.sleep(100);
}
Expand Down Expand Up @@ -254,7 +254,7 @@ public void onRemoval(@Nullable ServerId server, @Nullable MetricResponse respon
@Override
public void run() {

long refreshTime = 0;
long lastRunTime = 0;

while (true) {

Expand All @@ -263,7 +263,7 @@ public void run() {
// If a connection has not been made in a while, stale data may be displayed.
// Only refresh every 5s (old monitor logic).
while (!newConnectionEvent.get() && connectionCount.get() == 0
&& NanoTime.millisElapsed(refreshTime, NanoTime.now()) > 5000) {
&& NanoTime.millisElapsed(lastRunTime, NanoTime.now()) > 5000) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Expand All @@ -275,7 +275,7 @@ public void run() {
// reset the connection event flag
newConnectionEvent.compareAndExchange(true, false);

LOG.info("Fetching metrics from servers");
LOG.info("Fetching information from servers");

final List<Future<?>> futures = new ArrayList<>();
final SystemInformation summary = new SystemInformation(allMetrics, this.ctx);
Expand Down Expand Up @@ -315,13 +315,18 @@ public void run() {
}
}));

long monitorFetchTimeout =
final long monitorFetchTimeout =
ctx.getConfiguration().getTimeInMillis(Property.MONITOR_FETCH_TIMEOUT);
long allFuturesAdded = NanoTime.now();
final long allFuturesAdded = NanoTime.now();
boolean tookToLong = false;
while (!futures.isEmpty()) {

if (NanoTime.millisElapsed(allFuturesAdded, NanoTime.now()) > monitorFetchTimeout) {
LOG.warn(
"Fetching information for Monitor has taken longer {}. Cancelling all"
+ " remaining tasks and monitor will display old information. Resolve issue"
+ " causing this or increase property {}.",
monitorFetchTimeout, Property.MONITOR_FETCH_TIMEOUT.getKey());
tookToLong = true;
}

Expand All @@ -344,26 +349,31 @@ public void run() {
}
}

summary.finish();

refreshTime = NanoTime.now();
LOG.info("Finished fetching metrics from servers");
LOG.info(
"All: {}, Manager: {}, Garbage Collector: {}, Compactors: {}, Scan Servers: {}, Tablet Servers: {}",
allMetrics.estimatedSize(), summary.getManager() != null,
summary.getGarbageCollector() != null,
summary.getCompactorAllMetricSummary().isEmpty() ? 0
: summary.getCompactorAllMetricSummary().entrySet().iterator().next().getValue()
.count(),
summary.getSServerAllMetricSummary().isEmpty() ? 0
: summary.getSServerAllMetricSummary().entrySet().iterator().next().getValue()
.count(),
summary.getTServerAllMetricSummary().isEmpty() ? 0 : summary.getTServerAllMetricSummary()
.entrySet().iterator().next().getValue().count());

SystemInformation oldSummary = summaryRef.getAndSet(summary);
if (oldSummary != null) {
oldSummary.clear();
lastRunTime = NanoTime.now();

if (tookToLong) {
summary.clear();
} else {
summary.finish();

LOG.info("Finished fetching metrics from servers");
LOG.info(
"All: {}, Manager: {}, Garbage Collector: {}, Compactors: {}, Scan Servers: {}, Tablet Servers: {}",
allMetrics.estimatedSize(), summary.getManager() != null,
summary.getGarbageCollector() != null,
summary.getCompactorAllMetricSummary().isEmpty() ? 0
: summary.getCompactorAllMetricSummary().entrySet().iterator().next().getValue()
.count(),
summary.getSServerAllMetricSummary().isEmpty() ? 0
: summary.getSServerAllMetricSummary().entrySet().iterator().next().getValue()
.count(),
summary.getTServerAllMetricSummary().isEmpty() ? 0 : summary
.getTServerAllMetricSummary().entrySet().iterator().next().getValue().count());

SystemInformation oldSummary = summaryRef.getAndSet(summary);
if (oldSummary != null) {
oldSummary.clear();
}
}
}

Expand Down
Loading