Adjust benchmark directory,enable HTTP test,rename variables,format codes
This commit is contained in:
@@ -1,30 +1,29 @@
|
||||
#ifndef _HTTP_DECODER_STAT_H_
|
||||
#define _HTTP_DECODER_STAT_H_ 1
|
||||
#pragma once
|
||||
|
||||
#include <fieldstat/fieldstat_easy.h>
|
||||
enum http_decoder_stat_type
|
||||
{
|
||||
HTTPD_STAT_BYTES_C2S = 0,
|
||||
HTTPD_STAT_BYTES_S2C,
|
||||
HTTPD_STAT_TCP_SEG_C2S,
|
||||
HTTPD_STAT_TCP_SEG_S2C,
|
||||
HTTPD_STAT_HEADERS_C2S,
|
||||
HTTPD_STAT_HEADERS_S2C,
|
||||
HTTPD_STAT_ZIP_BYTES, //only if Content-Encoding is gzip, deflate, br
|
||||
HTTPD_STAT_UNZIP_BYTES, //only if Content-Encoding is gzip, deflate, br
|
||||
HTTPD_STAT_URL_BYTES,
|
||||
HTTPD_STAT_SESSION_NEW,
|
||||
HTTPD_STAT_SESSION_FREE,
|
||||
HTTPD_STAT_SESSION_EXCEPTION, // rst, kickout, lost packet, etc.
|
||||
HTTPD_STAT_TUNNEL,
|
||||
HTTPD_STAT_TRANSACTION_NEW,
|
||||
HTTPD_STAT_TRANSACTION_FREE,
|
||||
HTTPD_STAT_ASYMMETRY_SESSION_C2S,
|
||||
HTTPD_STAT_ASYMMETRY_SESSION_S2C,
|
||||
HTTPD_STAT_ASYMMETRY_TRANSACTION_C2S,
|
||||
HTTPD_STAT_ASYMMETRY_TRANSACTION_S2C,
|
||||
HTTPD_STAT_PARSE_ERR,
|
||||
HTTPD_STAT_MAX,
|
||||
HTTP_C2S_BYTES = 0,
|
||||
HTTP_S2C_BYTES,
|
||||
HTTP_C2S_TCP_SEG,
|
||||
HTTP_S2C_TCP_SEG,
|
||||
HTTP_C2S_HEADERS,
|
||||
HTTP_S2C_HEADERS,
|
||||
HTTP_C2S_ZIP_BYTES, // only if Content-Encoding is gzip, deflate, br
|
||||
HTTP_S2C_ZIP_BYTES, // only if Content-Encoding is gzip, deflate, br
|
||||
HTTP_C2S_UNZIP_BYTES, // only if Content-Encoding is gzip, deflate, br
|
||||
HTTP_S2C_UNZIP_BYTES, // only if Content-Encoding is gzip, deflate, br
|
||||
HTTP_URL_BYTES,
|
||||
HTTP_SESSION_NEW,
|
||||
HTTP_SESSION_FREE,
|
||||
HTTP_TRANSACTION_NEW,
|
||||
HTTP_TRANSACTION_FREE,
|
||||
HTTP_C2S_ASYMMETRY_SESSION,
|
||||
HTTP_S2C_ASYMMETRY_SESSION,
|
||||
HTTP_C2S_ASYMMETRY_TRANSACTION,
|
||||
HTTP_S2C_ASYMMETRY_TRANSACTION,
|
||||
HTTP_STAT_PARSE_ERR,
|
||||
HTTP_STAT_MAX,
|
||||
};
|
||||
|
||||
struct hd_stat_config_tuple
|
||||
@@ -35,10 +34,10 @@ struct hd_stat_config_tuple
|
||||
|
||||
struct hd_statistics
|
||||
{
|
||||
long long time_ms[HTTPD_STAT_MAX];
|
||||
long long counter[HTTPD_STAT_MAX];
|
||||
int batch[HTTPD_STAT_MAX]; //call fieldstat_easy_counter_incrby() per batch
|
||||
}__attribute__ ((aligned (64)));
|
||||
long long time_ms[HTTP_STAT_MAX];
|
||||
long long counter[HTTP_STAT_MAX];
|
||||
int batch[HTTP_STAT_MAX]; // call fieldstat_easy_counter_incrby() per batch
|
||||
} __attribute__((aligned(64)));
|
||||
|
||||
struct http_decoder_stat
|
||||
{
|
||||
@@ -46,12 +45,11 @@ struct http_decoder_stat
|
||||
long long current_time_ms;
|
||||
struct fieldstat_easy *fse;
|
||||
int stat_interval_pkts; // call fieldstat_incrby every stat_interval_pkts
|
||||
int stat_interval_time; //second
|
||||
int field_stat_id[HTTPD_STAT_MAX];
|
||||
struct hd_statistics *stats; //size is thread number
|
||||
int stat_interval_time; // second
|
||||
int field_stat_id[HTTP_STAT_MAX];
|
||||
struct hd_statistics *stats; // size is thread number
|
||||
};
|
||||
|
||||
int http_decoder_stat_init(struct http_decoder_stat *hd_stat, int thread_max, int stat_interval_pkts, int stat_interval_time);
|
||||
void http_decoder_stat_free(struct http_decoder_stat *hd_stat);
|
||||
void http_decoder_stat_update(struct http_decoder_stat *hd_stat, int thread_id, enum http_decoder_stat_type type, long long value);
|
||||
#endif
|
||||
Reference in New Issue
Block a user