<commit_before>include_directories(${CMAKE_CURRENT_BINARY_DIR}/)

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

add_library(customerdirectory OBJECT
    CustomerConfig.cc
    ConfigDirectory.cc
    SessionSchema.cc
    TableDefinition.cc
    ${PROTO_SRCS})

add_dependencies(customerdirectory tsdb-server)

add_library(auth OBJECT
    AnalyticsAuth.cc)

add_dependencies(auth customerdirectory)

file(GLOB COREPROTO_FILES core/*.proto)
PROTOBUF_GENERATE_CPP(COREPROTO_SRCS COREPROTO_HDRS ${COREPROTO_FILES})

add_library(tsdb-client OBJECT
    core/TSDBClient.cc
    core/TimeWindowPartitioner.cc
    core/FixedShardPartitioner.cc
    ${COREPROTO_SRCS})

add_library(tsdb-server OBJECT
    core/TSDBClient.cc
    core/TimeWindowPartitioner.cc
    core/FixedShardPartitioner.cc
    core/CSTableIndex.cc
    core/SQLEngine.cc
    core/TSDBService.cc
    core/TSDBServlet.cc
    core/TSDBTableProvider.cc
    core/TSDBTableRef.cc
    core/RecordSet.cc
    core/Partition.cc
    core/PartitionMap.cc
    core/PartitionReader.cc
    core/PartitionWriter.cc
    core/PartitionSnapshot.cc
    core/PartitionReplication.cc
    core/LogPartitionWriter.cc
    core/LogPartitionReplication.cc
    core/LazyPartition.cc
    core/Table.cc
    core/ReplicationWorker.cc
    core/ReplicationScheme.cc
    core/ReplicationState.cc
    core/StaticPartitionWriter.cc
    core/StaticPartitionReplication.cc
    ${COREPROTO_SRCS})

add_executable(test-recordset
    $<TARGET_OBJECTS:stx-mdb>
    $<TARGET_OBJECTS:tsdb-server>
    $<TARGET_OBJECTS:dproc>
    core/RecordSet_test.cc)

target_link_libraries(test-recordset chartsql cplot sstable cstable stx-http stx-protobuf stx-json stx-base)

add_executable(test-tsdb-timewindowpartitioner
    $<TARGET_OBJECTS:stx-mdb>
    $<TARGET_OBJECTS:tsdb-server>
    $<TARGET_OBJECTS:dproc>
    core/TimeWindowPartitioner_test.cc)

target_link_libraries(test-tsdb-timewindowpartitioner chartsql cplot sstable cstable stx-http stx-protobuf stx-json stx-base)

add_executable(analyticsd
    $<TARGET_OBJECTS:stx-mdb>
    $<TARGET_OBJECTS:stx-rpc>
    $<TARGET_OBJECTS:brokerd-client>
    $<TARGET_OBJECTS:logjoin-common>
    $<TARGET_OBJECTS:dxa-docdb>
    $<TARGET_OBJECTS:tsdb-server>
    $<TARGET_OBJECTS:customerdirectory>
    #$<TARGET_OBJECTS:fnord-afx>
    $<TARGET_OBJECTS:dproc>
    $<TARGET_OBJECTS:auth>
    #sstable/SSTableServlet.cc
    api/LogfileService.cc
    api/LogfileAPIServlet.cc
    LogfileScanResult.cc
    Report.cc
    AnalyticsTableScan.cc
    AnalyticsTableScanPlanner.cc
    TrafficSegment.cc
    CTRStatsServlet.cc
    AnalyticsServlet.cc
    JSONSink.cc
    AnalyticsApp.cc
    AnalyticsQuery.cc
    AnalyticsQueryResult.cc
    AnalyticsQueryFactory.cc
    AnalyticsQueryMapper.cc
    AnalyticsQueryReducer.cc
    AnalyticsTableScanSource.cc
    DrilldownTree.cc
    EventIngress.cc
    ReportFactory.cc<commit_msg>link pcre<commit_after>include_directories(${CMAKE_CURRENT_BINARY_DIR}/)

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

add_library(customerdirectory OBJECT
    CustomerConfig.cc
    ConfigDirectory.cc
    SessionSchema.cc
    TableDefinition.cc
    ${PROTO_SRCS})

add_dependencies(customerdirectory tsdb-server)

add_library(auth OBJECT
    AnalyticsAuth.cc)

add_dependencies(auth customerdirectory)

file(GLOB COREPROTO_FILES core/*.proto)
PROTOBUF_GENERATE_CPP(COREPROTO_SRCS COREPROTO_HDRS ${COREPROTO_FILES})

add_library(tsdb-client OBJECT
    core/TSDBClient.cc
    core/TimeWindowPartitioner.cc
    core/FixedShardPartitioner.cc
    ${COREPROTO_SRCS})

add_library(tsdb-server OBJECT
    core/TSDBClient.cc
    core/TimeWindowPartitioner.cc
    core/FixedShardPartitioner.cc
    core/CSTableIndex.cc
    core/SQLEngine.cc
    core/TSDBService.cc
    core/TSDBServlet.cc
    core/TSDBTableProvider.cc
    core/TSDBTableRef.cc
    core/RecordSet.cc
    core/Partition.cc
    core/PartitionMap.cc
    core/PartitionReader.cc
    core/PartitionWriter.cc
    core/PartitionSnapshot.cc
    core/PartitionReplication.cc
    core/LogPartitionWriter.cc
    core/LogPartitionReplication.cc
    core/LazyPartition.cc
    core/Table.cc
    core/ReplicationWorker.cc
    core/ReplicationScheme.cc
    core/ReplicationState.cc
    core/StaticPartitionWriter.cc
    core/StaticPartitionReplication.cc
    ${COREPROTO_SRCS})

add_executable(test-recordset
    $<TARGET_OBJECTS:stx-mdb>
    $<TARGET_OBJECTS:tsdb-server>
    $<TARGET_OBJECTS:dproc>
    core/RecordSet_test.cc)

target_link_libraries(test-recordset chartsql cplot sstable cstable stx-http stx-protobuf stx-json stx-base)

add_executable(test-tsdb-timewindowpartitioner
    $<TARGET_OBJECTS:stx-mdb>
    $<TARGET_OBJECTS:tsdb-server>
    $<TARGET_OBJECTS:dproc>
    core/TimeWindowPartitioner_test.cc)

target_link_libraries(test-tsdb-timewindowpartitioner chartsql cplot sstable cstable stx-http stx-protobuf stx-json stx-base)

add_executable(analyticsd
    $<TARGET_OBJECTS:stx-mdb>
    $<TARGET_OBJECTS:stx-rpc>
    $<TARGET_OBJECTS:brokerd-client>
    $<TARGET_OBJECTS:logjoin-common>
    $<TARGET_OBJECTS:dxa-docdb>
    $<TARGET_OBJECTS:tsdb-server>
    $<TARGET_OBJECTS:customerdirectory>
    #$<TARGET_OBJECTS:fnord-afx>
    $<TARGET_OBJECTS:dproc>
    $<TARGET_OBJECTS:auth>
    $<TARGET_OBJECTS:pcre>
    #sstable/SSTableServlet.cc
    api/LogfileService.cc
    api/LogfileAPIServlet.cc
    LogfileScanResult.cc
    Report.cc
    AnalyticsTableScan.cc
    AnalyticsTableScanPlanner.cc
    TrafficSegment.cc
    CTRStatsServlet.cc
    AnalyticsServlet.cc
    JSONSink.cc
    AnalyticsApp.cc
    AnalyticsQuery.cc
    AnalyticsQueryResult.cc
    AnalyticsQueryFactory.cc
    AnalyticsQueryMapper.cc
    AnalyticsQueryReducer.cc
    AnalyticsTableScanSource.cc
    DrilldownTree.cc
    EventIngress.cc
    ReportFactory.cc
{'fraction_non_alphanumeric': 0.08317645045353414, 'fraction_numerical': 0.0, 'mean_word_length': 4.241255605381166, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6056579', 'n_tokens_mistral': 2083, 'n_tokens_neox': 2062, 'n_words': 243}