Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sergi
Tor
Commits
84829e33
Commit
84829e33
authored
8 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Module documentation for circuitmux_ewma.c
parent
56933787
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/or/circuitmux_ewma.c
+25
-2
25 additions, 2 deletions
src/or/circuitmux_ewma.c
with
25 additions
and
2 deletions
src/or/circuitmux_ewma.c
+
25
−
2
View file @
84829e33
...
...
@@ -4,6 +4,28 @@
/**
* \file circuitmux_ewma.c
* \brief EWMA circuit selection as a circuitmux_t policy
*
* The "EWMA" in this module stands for the "exponentially weighted moving
* average" of the number of cells sent on each circuit. The goal is to
* prioritize cells on circuits that have been quiet recently, by looking at
* those that have sent few cells over time, prioritizing recent times
* more than older ones.
*
* Specifically, a cell sent at time "now" has weight 1, but a time X ticks
* before now has weight ewma_scale_factor ^ X , where ewma_scale_factor is
* between 0.0 and 1.0.
*
* For efficiency, we do not re-scale these averages every time we send a
* cell: that would be horribly inefficient. Instead, we we keep the cell
* count on all circuits on the same circuitmux scaled relative to a single
* tick. When we add a new cell, we scale its weight depending on the time
* that has elapsed since the tick. We do re-scale the circuits on the
* circuitmux periodically, so that we don't overflow double.
*
*
* This module should be used through the interfaces in circuitmux.c, which it
* implements.
*
**/
#define TOR_CIRCUITMUX_EWMA_C_
...
...
@@ -28,9 +50,10 @@
/*** Some useful constant #defines ***/
/*DOCDOC*/
/** Any halflife smaller than this number of seconds is considered to be
* "disabled". */
#define EPSILON 0.00001
/*
DOCDOC
*/
/*
* The natural logarithm of 0.5.
*/
#define LOG_ONEHALF -0.69314718055994529
/*** EWMA structures ***/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment