Tor 0.4.9.0-alpha-dev
Data Fields
bw_array_t Struct Reference

#include <bw_array_st.h>

Data Fields

uint64_t obs [NUM_SECS_ROLLING_MEASURE]
 
int cur_obs_idx
 
time_t cur_obs_time
 
uint64_t total_obs
 
uint64_t max_total
 
uint64_t total_in_period
 
time_t next_period
 
int next_max_idx
 
int num_maxes_set
 
uint64_t maxima [NUM_TOTALS]
 
uint64_t totals [NUM_TOTALS]
 

Detailed Description

Structure to track bandwidth use, and remember the maxima for a given time period.

Definition at line 28 of file bw_array_st.h.

Field Documentation

◆ cur_obs_idx

int cur_obs_idx

Current position in obs.

Definition at line 32 of file bw_array_st.h.

Referenced by add_obs(), and advance_obs().

◆ cur_obs_time

time_t cur_obs_time

Time represented in obs[cur_obs_idx]

Definition at line 33 of file bw_array_st.h.

Referenced by add_obs(), advance_obs(), and find_largest_max().

◆ max_total

uint64_t max_total

Largest value that total_obs has taken on in the current period.

Definition at line 36 of file bw_array_st.h.

Referenced by advance_obs(), commit_max(), and find_largest_max().

◆ maxima

uint64_t maxima[NUM_TOTALS]

Circular array of the maximum bandwidth-per-NUM_SECS_ROLLING_MEASURE usage for the last NUM_TOTALS periods

Definition at line 51 of file bw_array_st.h.

Referenced by commit_max(), and find_largest_max().

◆ next_max_idx

int next_max_idx

Where in 'maxima' should the maximum bandwidth usage for the current period be stored?

Definition at line 45 of file bw_array_st.h.

Referenced by bwhist_fill_bandwidth_history(), and commit_max().

◆ next_period

time_t next_period

When does the next period begin?

Definition at line 42 of file bw_array_st.h.

Referenced by advance_obs(), commit_max(), and find_largest_max().

◆ num_maxes_set

int num_maxes_set

How many values in maxima/totals have been set ever?

Definition at line 47 of file bw_array_st.h.

Referenced by bwhist_fill_bandwidth_history(), and commit_max().

◆ obs

uint64_t obs[NUM_SECS_ROLLING_MEASURE]

Observation array: Total number of bytes transferred in each of the last NUM_SECS_ROLLING_MEASURE seconds. This is used as a circular array.

Definition at line 31 of file bw_array_st.h.

Referenced by add_obs(), and advance_obs().

◆ total_in_period

uint64_t total_in_period

Total bytes transferred in the current period.

Definition at line 38 of file bw_array_st.h.

Referenced by add_obs(), and commit_max().

◆ total_obs

uint64_t total_obs

Total for all members of obs except obs[cur_obs_idx]

Definition at line 34 of file bw_array_st.h.

Referenced by advance_obs().

◆ totals

uint64_t totals[NUM_TOTALS]

Circular array of the total bandwidth usage for the last NUM_TOTALS periods

Definition at line 54 of file bw_array_st.h.

Referenced by bwhist_fill_bandwidth_history(), and commit_max().


The documentation for this struct was generated from the following file: