1 #ifndef IPFS_GATEWAY_STATE_H_
2 #define IPFS_GATEWAY_STATE_H_
4 #include <ipfs_client/gw/gateway_request_type.h>
11 #include <unordered_map>
27 std::shared_ptr<Client> api_;
28 std::unordered_map<std::string, long> affinity_success;
29 static constexpr
short MinutesTracked = 4;
30 std::array<unsigned, MinutesTracked * 60UL> sent_counts;
31 std::size_t total_sent = 0UL;
32 std::time_t last_hist_update;
33 unsigned& current_bucket();
35 bool over_rate(
unsigned req_per_min);
45 GatewayState(std::string_view prefix, std::shared_ptr<Client> api);
54 long extra_ms() {
return slowness; }
Definition: gateway_config.h:13
Definition: gateway_request.h:39
Definition: gateway_state.h:25
GatewayState(std::string_view prefix, std::shared_ptr< Client > api)