-
Notifications
You must be signed in to change notification settings - Fork 0
/
server_stat.h
76 lines (55 loc) · 1.52 KB
/
server_stat.h
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Cette classe possede des methodes et des attributs statiques pour enregistrer les donnees d'utilisation du serveur
*
*/
#ifndef SERVER_STAT_H
#define SERVER_STAT_H
#include <QtWidgets/QDialog>
#include <QString>
#include <string>
QT_BEGIN_NAMESPACE
class QLabel;
class QPushButton;
QT_END_NAMESPACE
#define TAILLE_MAX_TABLEAU 512
typedef enum typestat{
NEWCLIENT,
NEWREQUEST,
NEWREQUEST_TYPE,
NEWREQUESTDONE,
NEWERROR,
NEWOCTETSRECEIVED,
NEWOCTETSSEND
} typeStat;
struct file_type{
std::string chemin = "";
int nombre = 0;
};
struct all_file_type{
std::string chemin = "";
QString date = "";
};
class Server_stat : public QDialog
{
Q_OBJECT
public:
Server_stat(QWidget *parent = 0);
static void updateStat(typeStat type, int data);
static void addTypeOfRequest(std::string chemin);
private:
QLabel *statusLabel;
QPushButton *quitButton;
static int count_client; //nb clients tot
static int count_request_received; //nom tendancieux
static int count_request_done; //nb requetes traitees
static int count_error; //nb erreur de chaque type
static int count_octets_received; //transmis/recus
static int count_octets_send; //transmis/recus
static int request_received; //quel tyoe de donnee pr une requete ?
static file_type files_requested[TAILLE_MAX_TABLEAU]; //noms+nb de tel des fichiers
static all_file_type all_files_requested[TAILLE_MAX_TABLEAU];
public slots:
void statHTML();
void repaintstat();
};
#endif