Commit 4a42e5f1 authored by Ramon Nou's avatar Ramon Nou
Browse files

Metrics should be nicely cleanup, add destroy_metrics function

parent 8090c1b8
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -515,7 +515,6 @@ at_child_syscall() {

void
init_libc() {
    // printf("%d -> %p At init GEKKOFS\n", gettid(), (void*) CTX); // fork does

    CTX->init_logging();
    // from here ownwards it is safe to print messages
@@ -534,7 +533,6 @@ init_libc() {

void
destroy_libc() {
    // printf("%d At close library GEKKOFS\n", gettid());
    CTX->disable_interception();
    #ifdef GKFS_ENABLE_CLIENT_METRICS
    LOG(INFO, "Flushing final metrics...");
@@ -542,6 +540,7 @@ destroy_libc() {
    CTX->read_metrics()->flush_msgpack();
    LOG(INFO, "Metrics flushed. Total flush operations: {}",
        CTX->write_metrics()->flush_count());
    CTX->destroy_metrics();
#endif
    CTX->clear_hosts();
    LOG(DEBUG, "Peer information deleted");