comments
This commit is contained in:
parent
de7381ac31
commit
df98ef761d
4 changed files with 6 additions and 2 deletions
|
|
@ -10,6 +10,7 @@ public class ExceptionLogger {
|
||||||
public static void log(Throwable throwable) {
|
public static void log(Throwable throwable) {
|
||||||
try {
|
try {
|
||||||
// use json for now because of ease of integration
|
// use json for now because of ease of integration
|
||||||
|
// would compression be useful?? use snappy?
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
bufferWriter.put(objectMapper.writeValueAsBytes(throwable));
|
bufferWriter.put(objectMapper.writeValueAsBytes(throwable));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public class MPSCBufferWriter implements AutoCloseable {
|
||||||
|
|
||||||
// setup of native memory ringbuffer
|
// setup of native memory ringbuffer
|
||||||
var arena = Arena.ofConfined();
|
var arena = Arena.ofConfined();
|
||||||
var ringbufferMemory = arena.allocate(0xffff);
|
var ringbufferMemory = arena.allocate(32768);
|
||||||
var buffer = new CircularByteBuffer(ringbufferMemory);
|
var buffer = new CircularByteBuffer(ringbufferMemory);
|
||||||
|
|
||||||
arena = Arena.ofConfined();
|
arena = Arena.ofConfined();
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ class ExceptionLoggerTest {
|
||||||
@Test
|
@Test
|
||||||
void test() throws InterruptedException {
|
void test() throws InterruptedException {
|
||||||
ExceptionLogger.log(new Throwable());
|
ExceptionLogger.log(new Throwable());
|
||||||
TimeUnit.SECONDS.sleep(30);
|
TimeUnit.SECONDS.sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2,6 +2,9 @@ use std::ffi::c_char;
|
||||||
|
|
||||||
mod throwable;
|
mod throwable;
|
||||||
|
|
||||||
|
// same value, but different meanings
|
||||||
|
// TODO find a way to set the buffer size from java.
|
||||||
|
// why not just add it to the function
|
||||||
const CAPACITY: isize = 32760;
|
const CAPACITY: isize = 32760;
|
||||||
const READ: isize = 32760;
|
const READ: isize = 32760;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue