Skip to content
Merged
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
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.ebean.insight</groupId>
<artifactId>ebean-insight-parent</artifactId>
<version>2.0-RC14</version>
<version>2.0-RC15</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.ebean.insight</groupId>
<artifactId>ebean-insight-parent</artifactId>
<version>2.0-RC14</version>
<version>2.0-RC15</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.ebean.insight</groupId>
<artifactId>ebean-insight-parent</artifactId>
<version>2.0-RC14</version>
<version>2.0-RC15</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion forwarder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.ebean.insight</groupId>
<artifactId>ebean-insight-parent</artifactId>
<version>2.0-RC14</version>
<version>2.0-RC15</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion mcp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.ebean.insight</groupId>
<artifactId>ebean-insight-parent</artifactId>
<version>2.0-RC14</version>
<version>2.0-RC15</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.ebean.insight</groupId>
<artifactId>ebean-insight-parent</artifactId>
<version>2.0-RC14</version>
<version>2.0-RC15</version>
<packaging>pom</packaging>

<name>ebean-insight (parent)</name>
Expand Down
2 changes: 1 addition & 1 deletion server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.ebean.insight</groupId>
<artifactId>ebean-insight-parent</artifactId>
<version>2.0-RC14</version>
<version>2.0-RC15</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
14 changes: 0 additions & 14 deletions server/src/main/java/org/ebean/monitor/domain/DAppMetric.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ public class DAppMetric extends BaseDomain {
@Index
private final boolean planCapable;

/**
* The derived "rollup group" this metric will aggregate into.
*/
@Length(300)
private String rollupGroup;

/**
* The code location if supplied. Expected to be class and line of code.
*/
Expand Down Expand Up @@ -113,14 +107,6 @@ public boolean isPlanCapable() {
return planCapable;
}

public String getRollupGroup() {
return rollupGroup;
}

public void setRollupGroup(String rollupGroup) {
this.rollupGroup = rollupGroup;
}

public String getLoc() {
return loc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,4 @@ public DAppMetric globalByName(String name) {
.findOne();
}

/**
* Return all the metrics with rollupGroup for use in rollup processing.
*/
public List<DAppMetric> forRollup() {
final QDAppMetric m = QDAppMetric.alias();
return new QDAppMetric()
.select(m.name, m.rollupGroup, m.app)
.findList();
}
}
71 changes: 0 additions & 71 deletions server/src/main/java/org/ebean/monitor/ingest/DeriveGroup.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ private DAppMetric createMetric(IngestEntry entry) {

final MetricData data = entry.getData();
DAppMetric metric = new DAppMetric(metricApp, entry.getKey(), data.name);
metric.setRollupGroup(DeriveGroup.of(data.name));
metric.setSql(data.sql);
metric.setLoc(data.loc);
return metric;
Expand Down
54 changes: 1 addition & 53 deletions server/src/main/java/org/ebean/monitor/rollup/Rollup.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import io.ebean.Database;
import io.ebean.annotation.Transactional;
import org.ebean.monitor.domain.DApp;
import org.ebean.monitor.domain.DAppMetric;
import org.ebean.monitor.domain.DGaugeRollupM1;
import org.ebean.monitor.domain.DRollupJob;
import org.ebean.monitor.domain.DTimedRollupM1;
Expand All @@ -15,33 +13,25 @@
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class Rollup {

private static final Logger log = LoggerFactory.getLogger(Rollup.class);

private final RollupGroups rollupGroups = new RollupGroups();

private final Instant eventTime;
private final ZonedDateTime atZone;

private long executionMillis;
private long count;

private final Map<String, DAppMetric> globalMetrics = new LinkedHashMap<>();

public Rollup(Database database, Instant eventTime) {
this.eventTime = eventTime;
this.atZone = eventTime.atZone(ZoneOffset.UTC);
}

public void rollup() {
performRollup();
int rollupCount = rollupGroups.getCount();
log.debug("rollup time:{} millis:{} count:{} rollupGroups:{}", eventTime, executionMillis, count, rollupCount);
log.debug("rollup time:{} millis:{} count:{}", eventTime, executionMillis, count);
extraRollups();
}

Expand Down Expand Up @@ -76,32 +66,12 @@ boolean mod60(long minuteOfHour) {
@Transactional(batchSize = 500)
private void performRollup() {
final long start = System.currentTimeMillis();
findAppMetrics();
rollupEvents();
rollupGroups.saveGauges();
rollupTimed();
rollupGroups.saveTimed();
executionMillis = System.currentTimeMillis() - start;
new DRollupJob(eventTime, executionMillis, count).save();
}

/**
* Load partial for all app metrics (as we check their rollup group).
*/
private void findAppMetrics() {
final List<DAppMetric> appMetrics = DAppMetric.find.forRollup();
for (DAppMetric appMetric : appMetrics) {
final DApp app = appMetric.getApp();
if (app == null) {
final String name = appMetric.getName();
if (name != null) {
// register AppMetric for use as rollup group metric
globalMetrics.put(name, appMetric);
}
}
}
}

void rollupTimed() {

QDTimedAgg a = QDTimedAgg.alias();
Expand Down Expand Up @@ -129,31 +99,9 @@ void rollupEvents() {

private void add(DTimedRollupM1 timed) {
timed.save();
final DAppMetric metric = timed.getMetric();
final String group = metric.getRollupGroup();
if (group != null) {
// rollup group in memory aggregation
final DAppMetric globalMetric = globalMetrics.get(group);
if (globalMetric == null) {
log.warn("skip unknown group metric [{}]", group);
} else {
rollupGroups.addTimed(globalMetric, timed);
}
}
}

private void add(DGaugeRollupM1 gauge) {
gauge.save();
final DAppMetric metric = gauge.getMetric();
final String group = metric.getRollupGroup();
if (group != null) {
// rollup group in memory aggregation
final DAppMetric globalMetric = globalMetrics.get(group);
if (globalMetric == null) {
log.warn("skip unknown group metric [{}]", group);
} else {
rollupGroups.addGauge(globalMetric, gauge);
}
}
}
}
75 changes: 0 additions & 75 deletions server/src/main/java/org/ebean/monitor/rollup/RollupGroups.java

This file was deleted.

2 changes: 0 additions & 2 deletions server/src/main/resources/ui/partial/app-metrics.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<th>Name</th>
<th>Key</th>
<th>Loc</th>
<th>Group</th>
</tr>
</thead>
<tbody>
Expand All @@ -17,7 +16,6 @@
<td> <a href="/metrics/{{ id }}">{{ name }}</a></td>
<td>{{ key }}</td>
<td>{{ loc }}</td>
<td>{{ rollupGroup }}</td>
</tr>
{{/metrics}}
</tbody>
Expand Down
Loading
Loading