capture 1.2.0
这是一个基于 PcapPlusPlus、PF_RING 和 ClickHouse 构建的高性能网络流量分析系统,专注于实时流量捕获、解析与存储。
|
网络包处理器 More...
#include <vector>
#include <queue>
#include <unordered_map>
#include <functional>
#include <sstream>
#include "TcpLayer.h"
#include <UdpLayer.h>
#include <IcmpLayer.h>
#include "IPv4Layer.h"
#include "PayloadLayer.h"
#include "PacketUtils.h"
#include "SystemUtils.h"
#include <ctime>
#include <fstream>
#include <curl/curl.h>
#include <string>
#include <clickhouse/client.h>
#include <headers/unifiedPacketAttr.h>
#include <headers/HttpStatsCollector.h>
Go to the source code of this file.
Classes | |
class | packet_handler |
包处理类回调:统计、批量存入 More... |
Macros | |
#define | MAX_QUEUE_LENGTH 20000 |
最大队列长度(调整以获得最佳速度) | |
#define | WRITE_STAT_LINE(description, counter, measurement) |
写入统计行的宏定义 |
Functions | |
void | StatsSummary2File (HttpStatsCollector &collector, std::string filename) |
将HTTP统计摘要写入文件 |
网络包处理器
此文件定义了用于处理网络包的类和函数,包括包统计、批量存储到ClickHouse数据库 以及HTTP统计信息的收集和导出功能。
#define MAX_QUEUE_LENGTH 20000 |
最大队列长度(调整以获得最佳速度)
定义批量处理的包数量阈值,达到此数量时触发数据库写入操作
#define WRITE_STAT_LINE | ( | description, | |
counter, | |||
measurement ) |
写入统计行的宏定义
description | 统计项描述 |
counter | 统计计数器 |
measurement | 测量单位 |
用于格式化输出统计信息到文件的宏
void StatsSummary2File | ( | HttpStatsCollector & | collector, |
std::string | filename ) |
将HTTP统计摘要写入文件
collector | HTTP统计收集器的引用 |
filename | 输出文件名 |
将HTTP统计信息以CSV格式写入指定文件,包括包数量、流数量、 事务数量、数据量等各种统计指标