use special logger for insertion metrics
This allows us to enable/disable metric logging without having to log other stuff.
This commit is contained in:
@@ -102,7 +102,7 @@ public class TcpIngestor implements Ingestor, AutoCloseable, DisposableBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (entry.isPresent()) {
|
if (entry.isPresent()) {
|
||||||
LOGGER.trace("adding entry to queue: {}", entry);
|
LOGGER.debug("adding entry to queue: {}", entry);
|
||||||
queue.put(entry.get());
|
queue.put(entry.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
|
|
||||||
public class PerformanceDb implements AutoCloseable, CollectionUtils {
|
public class PerformanceDb implements AutoCloseable, CollectionUtils {
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(PerformanceDb.class);
|
private final static Logger LOGGER = LoggerFactory.getLogger(PerformanceDb.class);
|
||||||
|
private final static Logger METRICS_LOGGER = LoggerFactory.getLogger("org.lucares.metrics.ingestion.block");
|
||||||
|
|
||||||
private final TagsToFile tagsToFile;
|
private final TagsToFile tagsToFile;
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ public class PerformanceDb implements AutoCloseable, CollectionUtils {
|
|||||||
|
|
||||||
public void put(final BlockingIterator<Entry> entries) throws WriteException {
|
public void put(final BlockingIterator<Entry> entries) throws WriteException {
|
||||||
|
|
||||||
final int blocksize = 10000;
|
final int blocksize = 100000;
|
||||||
long count = 0;
|
long count = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -90,8 +91,8 @@ public class PerformanceDb implements AutoCloseable, CollectionUtils {
|
|||||||
if (count % blocksize == 0) {
|
if (count % blocksize == 0) {
|
||||||
final long end = System.currentTimeMillis();
|
final long end = System.currentTimeMillis();
|
||||||
final long duration = end - start;
|
final long duration = end - start;
|
||||||
LOGGER.debug("inserting the last " + blocksize + " took " + duration + " ms; total entries: "
|
METRICS_LOGGER.debug("inserting the last " + blocksize + " took " + duration
|
||||||
+ count / 1_000_000.0 + " million");
|
+ " ms; total entries: " + count / 1_000_000.0 + " million");
|
||||||
|
|
||||||
start = System.currentTimeMillis();
|
start = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user