Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions server/monitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-start</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ public MetricResponse getManager() {
return monitor.getInformationFetcher().getAllMetrics().asMap().get(s);
}

@GET
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metrics are already returned as part of the MetricResponse json from the getManager call. Just wondering if we really need this, it seems duplicative.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this so we can easily link to just the "metrics" key of the "rest-v2/manager" json endpoint via an href:
<a href=\"rest-v2/manager/metrics\">Metrics</a>
Not sure of a way to easily do this without more custom javascript/html, and I think the extra Java code is more maintainable than more js/html

@Path("manager/metrics")
@Produces(MediaType.APPLICATION_JSON)
@Description("Returns the metrics for the Manager")
public List<FMetric> getManagerMetrics() {
var managerMetrics = getManager().getMetrics();
if (managerMetrics != null) {
return managerMetrics.stream().map(FMetric::getRootAsFMetric).collect(Collectors.toList());
}
return List.of();
}

@GET
@Path("gc")
@Produces(MediaType.APPLICATION_JSON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@

import jakarta.xml.bind.annotation.XmlRootElement;

import org.apache.accumulo.monitor.rest.logs.DeadLoggerList;
import org.apache.accumulo.monitor.rest.manager.ManagerInformation;
import org.apache.accumulo.monitor.rest.tables.TableInformationList;
import org.apache.accumulo.monitor.rest.tservers.BadTabletServers;
import org.apache.accumulo.monitor.rest.tservers.DeadServerList;
import org.apache.accumulo.monitor.rest.tservers.ServersShuttingDown;
import org.apache.accumulo.monitor.rest.tservers.TabletServer;

/**
Expand All @@ -40,46 +35,23 @@
public class SummaryInformation {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is used for summarizing Monitor info at /xml and /json. Maybe there's info in rest-v2/manager that we would want to include in the summary. For now, I just deleted all the rest/manager related data.


// Variable names become JSON keys
public List<TabletServer> servers = new ArrayList<>();

public String managerGoalState;
public String managerState;

public BadTabletServers badTabletServers;
public ServersShuttingDown tabletServersShuttingDown;
public Integer unassignedTablets;
public DeadServerList deadTabletServers;

public DeadLoggerList deadLoggers;
public List<TabletServer> servers;

public TableInformationList tables;

public Totals totals;

// do not remove
public SummaryInformation() {}

/**
* Stores Monitor information as XML or JSON
*
* @param size Number of tservers
* @param info Manager information
* @param tablesList Table list
*/
public SummaryInformation(int size, ManagerInformation info, TableInformationList tablesList) {
public SummaryInformation(int size, TableInformationList tablesList) {
this.servers = new ArrayList<>(size);

this.managerGoalState = info.managerGoalState;
this.managerState = info.managerState;

this.badTabletServers = info.badTabletServers;
this.tabletServersShuttingDown = info.tabletServersShuttingDown;
this.unassignedTablets = info.unassignedTablets;
this.deadTabletServers = info.deadTabletServers;
this.deadLoggers = info.deadLoggers;

this.tables = tablesList;

this.totals = new Totals(info.ingestrate, info.queryrate, info.numentries);
}

/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.accumulo.core.manager.thrift.ManagerMonitorInfo;
import org.apache.accumulo.core.manager.thrift.TabletServerStatus;
import org.apache.accumulo.monitor.Monitor;
import org.apache.accumulo.monitor.rest.manager.ManagerResource;
import org.apache.accumulo.monitor.rest.tables.TablesResource;
import org.apache.accumulo.monitor.rest.tservers.TabletServer;

Expand Down Expand Up @@ -58,8 +57,8 @@ public SummaryInformation getInformation() {
}

// Add Monitor information
SummaryInformation xml = new SummaryInformation(mmi.tServerInfo.size(),
ManagerResource.getTables(monitor), TablesResource.getTables(monitor));
SummaryInformation xml =
new SummaryInformation(mmi.tServerInfo.size(), TablesResource.getTables(monitor));

// Add tserver information
for (TabletServerStatus status : mmi.tServerInfo) {
Expand Down

This file was deleted.

This file was deleted.

Loading