summaryrefslogtreecommitdiff
path: root/src/http_header_v1.hpp
blob: 6b4f5af32fa7ba2b06c2e9b8bd18b5d32124d0e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __HTTP_HEADER_V1__
#define __HTTP_HEADER_V1__

#include <sys/types.h>
#include <MESA/field_stat2.h>
#include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <iostream>

using namespace std;

typedef struct _http_header_info
{
    int header_id;
    long long header_num;
}http_header_t;

class BaseFS
{
public:
    screen_stat_handle_t fsstat_handle;
public:
    BaseFS(const char * header_name, const char *logdir);
    ~BaseFS();

    void start(void);
    void passive_output(void);
};

class ContentTable : public BaseFS
{
private:
    map<string, http_header_t> dynamic_line_id;
    int total_status_id;
    int no_header_id;
    int num_column_id;
    int ratio_column_id;
    long long header_total;
    long long no_header_num;
    pthread_mutex_t mutex_lock;
public:
    ContentTable(const char * header_name, const char *logdir);
    ~ContentTable();
    int operate(enum field_op op, string line_name, long long value);
    void operate_ratio();
    long long set_nocontent_num();
    long long get_head_total();
};

class ContentHistogram : public BaseFS
{
private:
    int histogram_id;
    pthread_mutex_t mutex_lock;
public:
    ContentHistogram(const char * header_name, const char *logdir);
    ~ContentHistogram();
    int content_lenght_operate(long long value);
};
#endif