mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Call the new config option ConnDirectionStatistics.
This commit is contained in:
+6
-6
@@ -200,7 +200,7 @@ static config_var_t _option_vars[] = {
|
||||
V(ClientOnly, BOOL, "0"),
|
||||
V(ConsensusParams, STRING, NULL),
|
||||
V(ConnLimit, UINT, "1000"),
|
||||
V(ConnStatistics, BOOL, "0"),
|
||||
V(ConnDirectionStatistics, BOOL, "0"),
|
||||
V(ConstrainedSockets, BOOL, "0"),
|
||||
V(ConstrainedSockSize, MEMUNIT, "8192"),
|
||||
V(ContactInfo, STRING, NULL),
|
||||
@@ -1393,7 +1393,7 @@ options_act(or_options_t *old_options)
|
||||
|
||||
if (options->CellStatistics || options->DirReqStatistics ||
|
||||
options->EntryStatistics || options->ExitPortStatistics ||
|
||||
options->ConnStatistics) {
|
||||
options->ConnDirectionStatistics) {
|
||||
time_t now = time(NULL);
|
||||
if ((!old_options || !old_options->CellStatistics) &&
|
||||
options->CellStatistics)
|
||||
@@ -1407,8 +1407,8 @@ options_act(or_options_t *old_options)
|
||||
if ((!old_options || !old_options->ExitPortStatistics) &&
|
||||
options->ExitPortStatistics)
|
||||
rep_hist_exit_stats_init(now);
|
||||
if ((!old_options || !old_options->ConnStatistics) &&
|
||||
options->ConnStatistics)
|
||||
if ((!old_options || !old_options->ConnDirectionStatistics) &&
|
||||
options->ConnDirectionStatistics)
|
||||
rep_hist_conn_stats_init(now);
|
||||
if (!old_options)
|
||||
log_notice(LD_CONFIG, "Configured to measure statistics. Look for "
|
||||
@@ -1428,8 +1428,8 @@ options_act(or_options_t *old_options)
|
||||
if (old_options && old_options->ExitPortStatistics &&
|
||||
!options->ExitPortStatistics)
|
||||
rep_hist_exit_stats_term();
|
||||
if (old_options && old_options->ConnStatistics &&
|
||||
!options->ConnStatistics)
|
||||
if (old_options && old_options->ConnDirectionStatistics &&
|
||||
!options->ConnDirectionStatistics)
|
||||
rep_hist_conn_stats_term();
|
||||
|
||||
/* Check if we need to parse and add the EntryNodes config option. */
|
||||
|
||||
+1
-1
@@ -1204,7 +1204,7 @@ run_scheduled_events(time_t now)
|
||||
if (next_write && next_write < next_time_to_write_stats_files)
|
||||
next_time_to_write_stats_files = next_write;
|
||||
}
|
||||
if (options->ConnStatistics) {
|
||||
if (options->ConnDirectionStatistics) {
|
||||
time_t next_write = rep_hist_conn_stats_write(time_to_write_stats_files);
|
||||
if (next_write && next_write < next_time_to_write_stats_files)
|
||||
next_time_to_write_stats_files = next_write;
|
||||
|
||||
+1
-1
@@ -2895,7 +2895,7 @@ typedef struct {
|
||||
int ExitPortStatistics;
|
||||
|
||||
/** If true, the user wants us to collect connection statistics. */
|
||||
int ConnStatistics;
|
||||
int ConnDirectionStatistics;
|
||||
|
||||
/** If true, the user wants us to collect cell statistics. */
|
||||
int CellStatistics;
|
||||
|
||||
+1
-1
@@ -2051,7 +2051,7 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo,
|
||||
"exit-stats-end", now, &contents) > 0) {
|
||||
smartlist_add(chunks, contents);
|
||||
}
|
||||
if (options->ConnStatistics &&
|
||||
if (options->ConnDirectionStatistics &&
|
||||
load_stats_file("stats"PATH_SEPARATOR"conn-stats",
|
||||
"conn-stats-end", now, &contents) > 0) {
|
||||
size_t pos = strlen(s);
|
||||
|
||||
Reference in New Issue
Block a user