<commit_before># This file is part of the "libfnord" project
#   Copyright (c) 2015 <NAME>
#
# FnordMetric is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License v3.0. You should have received a
# copy of the GNU General Public License along with this program. If not, see
# <http://www.gnu.org/licenses/>.
project(FNORD_TSDB)

include_directories(../)
include_directories(../3rdparty)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../)

file(GLOB PROTO_FILES *.proto)
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})

add_library(fnord-tsdb OBJECT
    CompactionWorker.cc
    ReplicationWorker.cc
    TSDBClient.cc
    TSDBNode.cc
    TSDBServlet.cc
    RecordSet.cc
    StreamChunk.cc
    CSTableIndex.cc
    TimeWindowPartitioner.cc
    ${PROTO_SRCS})

add_executable(tests/test-recordset
    $<TARGET_OBJECTS:fnord-base>
    $<TARGET_OBJECTS:fnord-msg>
    $<TARGET_OBJECTS:fnord-mdb>
    $<TARGET_OBJECTS:fnord-tsdb>
    $<TARGET_OBJECTS:fnord-cstable>
    $<TARGET_OBJECTS:fnord-sstable>
    $<TARGET_OBJECTS:fnord-http>
    $<TARGET_OBJECTS:fnord-json>
    $<TARGET_OBJECTS:fnord-dproc>
    RecordSet_test.cc)

target_link_libraries(tests/test-recordset ${CMAKE_THREAD_LIBS_INIT} ${FNORD_MSG_LIBS})

add_executable(tests/test-tsdbnode
    $<TARGET_OBJECTS:fnord-base>
    $<TARGET_OBJECTS:fnord-msg>
    $<TARGET_OBJECTS:fnord-mdb>
    $<TARGET_OBJECTS:fnord-tsdb>
    $<TARGET_OBJECTS:fnord-cstable>
    $<TARGET_OBJECTS:fnord-sstable>
    $<TARGET_OBJECTS:fnord-http>
    $<TARGET_OBJECTS:fnord-json>
    $<TARGET_OBJECTS:fnord-dproc>
    TSDBNode_test.cc)

target_link_libraries(tests/test-tsdbnode ${CMAKE_THREAD_LIBS_INIT} ${FNORD_MSG_LIBS})

add_executable(tests/test-tsdb-timewindowpartitioner
    $<TARGET_OBJECTS:fnord-base>
    $<TARGET_OBJECTS:fnord-msg>
    $<TARGET_OBJECTS:fnord-mdb><commit_msg>fnord-msg -> fnord-protobuf<commit_after># This file is part of the "libfnord" project
#   Copyright (c) 2015 <NAME>
#
# FnordMetric is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License v3.0. You should have received a
# copy of the GNU General Public License along with this program. If not, see
# <http://www.gnu.org/licenses/>.
project(FNORD_TSDB)

include_directories(../)
include_directories(../3rdparty)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../)

file(GLOB PROTO_FILES *.proto)
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})

add_library(fnord-tsdb OBJECT
    CompactionWorker.cc
    ReplicationWorker.cc
    TSDBClient.cc
    TSDBNode.cc
    TSDBServlet.cc
    RecordSet.cc
    StreamChunk.cc
    CSTableIndex.cc
    TimeWindowPartitioner.cc
    ${PROTO_SRCS})

add_executable(tests/test-recordset
    $<TARGET_OBJECTS:fnord-base>
    $<TARGET_OBJECTS:fnord-protobuf>
    $<TARGET_OBJECTS:fnord-mdb>
    $<TARGET_OBJECTS:fnord-tsdb>
    $<TARGET_OBJECTS:fnord-cstable>
    $<TARGET_OBJECTS:fnord-sstable>
    $<TARGET_OBJECTS:fnord-http>
    $<TARGET_OBJECTS:fnord-json>
    $<TARGET_OBJECTS:fnord-dproc>
    RecordSet_test.cc)

target_link_libraries(tests/test-recordset ${CMAKE_THREAD_LIBS_INIT} ${FNORD_MSG_LIBS})

add_executable(tests/test-tsdbnode
    $<TARGET_OBJECTS:fnord-base>
    $<TARGET_OBJECTS:fnord-protobuf>
    $<TARGET_OBJECTS:fnord-mdb>
    $<TARGET_OBJECTS:fnord-tsdb>
    $<TARGET_OBJECTS:fnord-cstable>
    $<TARGET_OBJECTS:fnord-sstable>
    $<TARGET_OBJECTS:fnord-http>
    $<TARGET_OBJECTS:fnord-json>
    $<TARGET_OBJECTS:fnord-dproc>
    TSDBNode_test.cc)

target_link_libraries(tests/test-tsdbnode ${CMAKE_THREAD_LIBS_INIT} ${FNORD_MSG_LIBS})

add_executable(tests/test-tsdb-timewindowpartitioner
    $<TARGET_OBJECTS:fnord-base>
    $<TARGET_OBJECTS:fnord-protobuf>
    $<TARGET_OBJECTS:fnord-mdb>
{'fraction_non_alphanumeric': 0.11476704395893657, 'fraction_numerical': 0.0036851803106080546, 'mean_word_length': 4.864197530864198, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 50, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1516295', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1445, 'n_words': 216}