tor
master
|
Collect status information and log heartbeat messages. More...
#include "or.h"
#include "circuituse.h"
#include "config.h"
#include "status.h"
#include "nodelist.h"
#include "relay.h"
#include "router.h"
#include "circuitlist.h"
#include "main.h"
#include "rephist.h"
#include "hibernate.h"
#include "statefile.h"
#include "hs_stats.h"
#include "hs_service.h"
#include "dos.h"
#include "geoip.h"
Macros | |
#define | STATUS_PRIVATE |
#define | FULLNESS_PCT_THRESHOLD 80 |
#define | TLS_OVERHEAD_THRESHOLD 15 |
Functions | |
STATIC int | count_circuits (void) |
STATIC char * | secs_to_uptime (long secs) |
STATIC char * | bytes_to_usage (uint64_t bytes) |
int | log_heartbeat (time_t now) |
Collect status information and log heartbeat messages.
This module is responsible for implementing the heartbeat log messages, which periodically inform users and operators about basic facts to do with their Tor instance. The log_heartbeat() function, invoked from main.c, is the principle entry point. It collects data from elsewhere in Tor, and logs it in a human-readable format.
STATIC char* bytes_to_usage | ( | uint64_t | bytes | ) |
Take bytes and returns a newly allocated human-readable usage string.
STATIC int count_circuits | ( | void | ) |
Return the total number of circuits.
int log_heartbeat | ( | time_t | now | ) |
Log a "heartbeat" message describing Tor's status and history so that the user can know that there is indeed a running Tor. Return 0 on success and -1 on failure.
Now, if we are an HS service, log some stats about our usage
STATIC char* secs_to_uptime | ( | long | secs | ) |
Take seconds secs and return a newly allocated human-readable uptime string.