oxen-storage-server/httpserver
Jason Rhinelander 69d3e8c380 Stats cleanup and refactor
Refactors how stats are collected:

- Keeping a rolling window of recent stats for every 10 minutes over the
past hour so that when we rotate stats, we only chop off the 1h10min-1h
counts, but always have a recent stats counter that reflects the last
~1h of requests.

- Move the stats cleanup timer into the stats class itself

- Make the all_stats class properly thread safe.  Previously *parts* of
it were thread safe but much of it wasn't, so really wasn't safe to be
used without holding the owning service_node's global lock.

- Fix various bugs in the stats values:
    - "reset_time" was never updated, but even if it had been, it was a
    steady_clock and being returned as time_since_epoch() which is a
    useless value.

    - recent_retrieve_requests wasn't being set at all in the returned
    json (instead recent_store_requests was set twice).

    - onion requests weren't being counted at all; instead every onion
    request bumped the proxy request counter

- Got rid of exposing "current period" stats: instead we now just expose
the recent request counters, which are calculated from current period +
stored historic period values, thus giving you a count for requests over
the last 1h5m (±5 minutes).

- Replace time_t with modern time types

- Don't indent/prettify json; in any case where you'd actually want it
this is much better done via tools like `jq`.
2021-06-16 18:59:06 -03:00
..
CMakeLists.txt Convert unit tests to Catch2 2021-06-16 18:59:06 -03:00
command_line.cpp Convert unit tests to Catch2 2021-06-16 18:59:06 -03:00
command_line.h Convert unit tests to Catch2 2021-06-16 18:59:06 -03:00
http.h Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
https_server.cpp Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
https_server.h Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
main.cpp Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
omq_server.cpp Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
omq_server.h Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
onion_processing.cpp Move RequestHandler method implementations to request_handler.cpp 2021-06-16 18:59:06 -03:00
onion_processing.h Move RequestHandler method implementations to request_handler.cpp 2021-06-16 18:59:06 -03:00
oxend_rpc.cpp Rename lmq -> omq internally 2021-06-16 18:59:05 -03:00
oxend_rpc.h Storage server refactoring & ping reporting redesign 2021-04-18 14:50:40 -03:00
rate_limiter.cpp Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
rate_limiter.h Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
reachability_testing.cpp Fix properly tracking failing nodes 2021-06-07 16:01:36 -03:00
reachability_testing.h Slow down testing tick timer 2021-06-16 18:59:06 -03:00
request_handler.cpp Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
request_handler.h Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
serialization.cpp Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
serialization.h Serialization: replace ghetto string_view with actual std::string_view 2021-04-19 16:20:12 -03:00
server_certificates.cpp Improve logging output 2021-06-16 18:59:06 -03:00
server_certificates.h Replace boost::beast with uWebSockets 2021-06-16 18:58:53 -03:00
service_node.cpp Stats cleanup and refactor 2021-06-16 18:59:06 -03:00
service_node.h Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
sn_record.h Rename lmq -> omq internally 2021-06-16 18:59:05 -03:00
stats.cpp Stats cleanup and refactor 2021-06-16 18:59:06 -03:00
stats.h Stats cleanup and refactor 2021-06-16 18:59:06 -03:00
swarm.cpp Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
swarm.h Remove boost beast & many intertwined changes 2021-06-16 18:59:06 -03:00
version.cpp.in Storage server refactoring & ping reporting redesign 2021-04-18 14:50:40 -03:00
version.h Storage server refactoring & ping reporting redesign 2021-04-18 14:50:40 -03:00