-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathServerStatus.h
36 lines (27 loc) · 969 Bytes
/
ServerStatus.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
// Based off https://github.com/UCLA-CS130/Team07/blob/master/server_stats.hpp
#ifndef SERVER_STATUS_H
#define SERVER_STATUS_H
#include "RequestHandler.h"
namespace Team15 {
namespace server {
class ServerStatus {
public:
static ServerStatus& getInstance();
void insertHandler(const std::string& prefix,
const std::string& handler_name);
void insertRequest(const std::string& uri,
const std::string& status);
int getNumRequests() { return requests_.size(); }
void resetStatus();
std::vector<std::pair<std::string, std::string>> getHandlers() const
{ return handlers_; }
std::vector<std::pair<std::string, std::string>> getRequests() const
{ return requests_; }
private:
ServerStatus() {}
std::vector<std::pair<std::string, std::string>> handlers_;
std::vector<std::pair<std::string, std::string>> requests_;
};
}
}
#endif // SERVER_STATUS_H