maybe
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m54s
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m54s
This commit is contained in:
@ -2,6 +2,7 @@ package xyz.mcutils.backend.repository.mongo;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import xyz.mcutils.backend.service.metric.Metric;
|
||||
|
||||
@ -10,6 +11,4 @@ import xyz.mcutils.backend.service.metric.Metric;
|
||||
*
|
||||
* @author Braydon
|
||||
*/
|
||||
@EnableMongoRepositories
|
||||
@Repository
|
||||
public interface MetricsRepository extends MongoRepository<Metric<?>, String> { }
|
||||
public interface MetricsRepository extends CrudRepository<Metric<?>, String> { }
|
@ -10,6 +10,4 @@ import xyz.mcutils.backend.model.cache.CachedEndpointStatus;
|
||||
*
|
||||
* @author Braydon
|
||||
*/
|
||||
@EnableRedisRepositories
|
||||
@Repository
|
||||
public interface EndpointStatusRepository extends CrudRepository<CachedEndpointStatus, String> { }
|
@ -10,6 +10,4 @@ import xyz.mcutils.backend.model.cache.CachedMinecraftServer;
|
||||
*
|
||||
* @author Braydon
|
||||
*/
|
||||
@EnableRedisRepositories
|
||||
@Repository
|
||||
public interface MinecraftServerCacheRepository extends CrudRepository<CachedMinecraftServer, String> { }
|
@ -12,6 +12,4 @@ import java.util.UUID;
|
||||
*
|
||||
* @author Braydon
|
||||
*/
|
||||
@EnableRedisRepositories
|
||||
@Repository
|
||||
public interface PlayerCacheRepository extends CrudRepository<CachedPlayer, UUID> { }
|
@ -14,6 +14,4 @@ import xyz.mcutils.backend.model.cache.CachedPlayerName;
|
||||
*
|
||||
* @author Braydon
|
||||
*/
|
||||
@EnableRedisRepositories
|
||||
@Repository
|
||||
public interface PlayerNameCacheRepository extends CrudRepository<CachedPlayerName, String> { }
|
@ -12,6 +12,4 @@ import xyz.mcutils.backend.model.cache.CachedPlayerSkinPart;
|
||||
* player skin part by it's id.
|
||||
* </p>
|
||||
*/
|
||||
@EnableRedisRepositories
|
||||
@Repository
|
||||
public interface PlayerSkinPartCacheRepository extends CrudRepository<CachedPlayerSkinPart, String> { }
|
@ -131,7 +131,7 @@ public class MetricService {
|
||||
List<Point> points = new ArrayList<>();
|
||||
for (Metric<?> metric : metrics.values()) {
|
||||
if (metric.isCollector()) {
|
||||
metric.collect(this);
|
||||
metric.collect();
|
||||
}
|
||||
Point point = metric.toPoint();
|
||||
if (point != null) {
|
||||
|
@ -35,7 +35,7 @@ public abstract class Metric<T> {
|
||||
/**
|
||||
* Collects the metric.
|
||||
*/
|
||||
public void collect(MetricService metricService) {}
|
||||
public void collect() {}
|
||||
|
||||
/**
|
||||
* Gets this point as a {@link Point}.
|
||||
|
@ -16,7 +16,7 @@ public class ConnectedSocketsMetric extends IntegerMetric {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collect(MetricService metricService) {
|
||||
public void collect() {
|
||||
setValue(MetricsWebSocketHandler.SESSIONS.size());
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class UniquePlayerLookupsMetric extends IntegerMetric {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collect(MetricService metricService) {
|
||||
public void collect() {
|
||||
setValue(uniqueLookups.size());
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class UniqueServerLookupsMetric extends IntegerMetric {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collect(MetricService metricService) {
|
||||
public void collect() {
|
||||
setValue(uniqueLookups.size());
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public class CpuUsageMetric extends DoubleMetric {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collect(MetricService metricService) {
|
||||
public void collect() {
|
||||
this.setValue(OS_BEAN.getProcessCpuLoad() * 100);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ public class MemoryMetric extends MapMetric<String, Long> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collect(MetricService metricService) {
|
||||
public void collect() {
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
|
||||
this.getValue().put("total", runtime.maxMemory());
|
||||
|
@ -20,7 +20,8 @@ spring:
|
||||
# MongoDB - This is used for general data storage
|
||||
mongodb:
|
||||
uri: mongodb://localhost:27017
|
||||
database: database
|
||||
database: test
|
||||
port: 27017
|
||||
|
||||
# Disable default metrics
|
||||
management:
|
||||
@ -41,4 +42,10 @@ influx:
|
||||
org: org
|
||||
bucket: bucket
|
||||
|
||||
de:
|
||||
flapdoodle:
|
||||
mongodb:
|
||||
embedded:
|
||||
version: 7.0.8
|
||||
|
||||
public-url: http://localhost
|
Reference in New Issue
Block a user