Loading changes/enhancement1790 0 → 100644 +5 −0 Original line number Diff line number Diff line o Minor features: - Relays report the number of bytes spent on answering directory requests in extra-info descriptors similar to {read,write}-history. Implements enhancement 1790. doc/spec/dir-spec.txt +11 −0 Original line number Diff line number Diff line Loading @@ -779,6 +779,17 @@ had a smaller bandwidth than md, the other half had a larger bandwidth than md. "dirreq-read-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM... NL [At most once] "dirreq-write-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM... NL [At most once] Declare how much bandwidth the OR has spent on answering directory requests. Usage is divided into intervals of NSEC seconds. The YYYY-MM-DD HH:MM:SS field defines the end of the most recent interval. The numbers are the number of bytes used in the most recent intervals, ordered from oldest to newest. "entry-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL [At most once.] Loading src/or/config.c +6 −0 Original line number Diff line number Diff line Loading @@ -440,6 +440,12 @@ static config_var_t _state_vars[] = { V(BWHistoryWriteEnds, ISOTIME, NULL), V(BWHistoryWriteInterval, UINT, "900"), V(BWHistoryWriteValues, CSV, ""), V(BWHistoryDirReadEnds, ISOTIME, NULL), V(BWHistoryDirReadInterval, UINT, "900"), V(BWHistoryDirReadValues, CSV, ""), V(BWHistoryDirWriteEnds, ISOTIME, NULL), V(BWHistoryDirWriteInterval, UINT, "900"), V(BWHistoryDirWriteValues, CSV, ""), V(TorVersion, STRING, NULL), Loading src/or/connection.c +10 −2 Original line number Diff line number Diff line Loading @@ -2082,8 +2082,6 @@ static void connection_buckets_decrement(connection_t *conn, time_t now, size_t num_read, size_t num_written) { if (!connection_is_rate_limited(conn)) return; /* local IPs are free */ if (num_written >= INT_MAX || num_read >= INT_MAX) { log_err(LD_BUG, "Value out of range. num_read=%lu, num_written=%lu, " "connection type=%s, state=%s", Loading @@ -2095,6 +2093,16 @@ connection_buckets_decrement(connection_t *conn, time_t now, tor_fragile_assert(); } /* Count bytes of answering direct and tunneled directory requests */ if (conn->type == CONN_TYPE_DIR && conn->purpose == DIR_PURPOSE_SERVER) { if (num_read > 0) rep_hist_note_dir_bytes_read(num_read, now); if (num_written > 0) rep_hist_note_dir_bytes_written(num_written, now); } if (!connection_is_rate_limited(conn)) return; /* local IPs are free */ if (num_read > 0) { if (conn->type == CONN_TYPE_EXIT) rep_hist_note_exit_bytes_read(conn->port, num_read); Loading src/or/or.h +6 −0 Original line number Diff line number Diff line Loading @@ -2842,6 +2842,12 @@ typedef struct { time_t BWHistoryWriteEnds; int BWHistoryWriteInterval; smartlist_t *BWHistoryWriteValues; time_t BWHistoryDirReadEnds; int BWHistoryDirReadInterval; smartlist_t *BWHistoryDirReadValues; time_t BWHistoryDirWriteEnds; int BWHistoryDirWriteInterval; smartlist_t *BWHistoryDirWriteValues; /** Build time histogram */ config_line_t * BuildtimeHistogram; Loading Loading
changes/enhancement1790 0 → 100644 +5 −0 Original line number Diff line number Diff line o Minor features: - Relays report the number of bytes spent on answering directory requests in extra-info descriptors similar to {read,write}-history. Implements enhancement 1790.
doc/spec/dir-spec.txt +11 −0 Original line number Diff line number Diff line Loading @@ -779,6 +779,17 @@ had a smaller bandwidth than md, the other half had a larger bandwidth than md. "dirreq-read-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM... NL [At most once] "dirreq-write-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM... NL [At most once] Declare how much bandwidth the OR has spent on answering directory requests. Usage is divided into intervals of NSEC seconds. The YYYY-MM-DD HH:MM:SS field defines the end of the most recent interval. The numbers are the number of bytes used in the most recent intervals, ordered from oldest to newest. "entry-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL [At most once.] Loading
src/or/config.c +6 −0 Original line number Diff line number Diff line Loading @@ -440,6 +440,12 @@ static config_var_t _state_vars[] = { V(BWHistoryWriteEnds, ISOTIME, NULL), V(BWHistoryWriteInterval, UINT, "900"), V(BWHistoryWriteValues, CSV, ""), V(BWHistoryDirReadEnds, ISOTIME, NULL), V(BWHistoryDirReadInterval, UINT, "900"), V(BWHistoryDirReadValues, CSV, ""), V(BWHistoryDirWriteEnds, ISOTIME, NULL), V(BWHistoryDirWriteInterval, UINT, "900"), V(BWHistoryDirWriteValues, CSV, ""), V(TorVersion, STRING, NULL), Loading
src/or/connection.c +10 −2 Original line number Diff line number Diff line Loading @@ -2082,8 +2082,6 @@ static void connection_buckets_decrement(connection_t *conn, time_t now, size_t num_read, size_t num_written) { if (!connection_is_rate_limited(conn)) return; /* local IPs are free */ if (num_written >= INT_MAX || num_read >= INT_MAX) { log_err(LD_BUG, "Value out of range. num_read=%lu, num_written=%lu, " "connection type=%s, state=%s", Loading @@ -2095,6 +2093,16 @@ connection_buckets_decrement(connection_t *conn, time_t now, tor_fragile_assert(); } /* Count bytes of answering direct and tunneled directory requests */ if (conn->type == CONN_TYPE_DIR && conn->purpose == DIR_PURPOSE_SERVER) { if (num_read > 0) rep_hist_note_dir_bytes_read(num_read, now); if (num_written > 0) rep_hist_note_dir_bytes_written(num_written, now); } if (!connection_is_rate_limited(conn)) return; /* local IPs are free */ if (num_read > 0) { if (conn->type == CONN_TYPE_EXIT) rep_hist_note_exit_bytes_read(conn->port, num_read); Loading
src/or/or.h +6 −0 Original line number Diff line number Diff line Loading @@ -2842,6 +2842,12 @@ typedef struct { time_t BWHistoryWriteEnds; int BWHistoryWriteInterval; smartlist_t *BWHistoryWriteValues; time_t BWHistoryDirReadEnds; int BWHistoryDirReadInterval; smartlist_t *BWHistoryDirReadValues; time_t BWHistoryDirWriteEnds; int BWHistoryDirWriteInterval; smartlist_t *BWHistoryDirWriteValues; /** Build time histogram */ config_line_t * BuildtimeHistogram; Loading