Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Arti
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Jill
Arti
Commits
72f00daf
Commit
72f00daf
authored
2 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
circmgr: re-export clock skew estimates.
parent
5f5cbdc0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
crates/tor-circmgr/src/lib.rs
+12
-0
12 additions, 0 deletions
crates/tor-circmgr/src/lib.rs
crates/tor-guardmgr/src/events.rs
+2
-0
2 additions, 0 deletions
crates/tor-guardmgr/src/events.rs
crates/tor-guardmgr/src/skew.rs
+2
-0
2 additions, 0 deletions
crates/tor-guardmgr/src/skew.rs
with
16 additions
and
0 deletions
crates/tor-circmgr/src/lib.rs
+
12
−
0
View file @
72f00daf
...
...
@@ -77,6 +77,7 @@ mod usage;
pub
use
err
::
Error
;
pub
use
isolation
::
IsolationToken
;
use
tor_guardmgr
::
fallback
::
FallbackList
;
pub
use
tor_guardmgr
::{
ClockSkewEvents
,
SkewEstimate
};
pub
use
usage
::{
TargetPort
,
TargetPorts
};
pub
use
config
::{
...
...
@@ -722,6 +723,17 @@ impl<R: Runtime> CircMgr<R> {
external_activity
,
);
}
/// Return a stream of events about our estimated clock skew; these events
/// are `None` when we don't have enough information to make an estimate,
/// and `Some(`[`SkewEstiamte`]`)` otherwise.
///
/// Note that this stream can be lossy: if the estimate changes more than
/// one before you read from the stream, you might only get the most recent
/// update.
pub
fn
skew_events
(
&
self
)
->
ClockSkewEvents
{
self
.mgr
.peek_builder
()
.guardmgr
()
.skew_events
()
}
}
impl
<
R
:
Runtime
>
Drop
for
CircMgr
<
R
>
{
...
...
This diff is collapsed.
Click to expand it.
crates/tor-guardmgr/src/events.rs
+
2
−
0
View file @
72f00daf
...
...
@@ -12,6 +12,8 @@ use tor_basic_utils::skip_fmt;
///
/// Note that this stream can be lossy: if multiple events trigger before you
/// read from it, you will only get the most recent estimate.
//
// SEMVER NOTE: this type is re-exported from tor-circmgr.
#[derive(Clone,
Educe)]
#[educe(Debug)]
pub
struct
ClockSkewEvents
{
...
...
This diff is collapsed.
Click to expand it.
crates/tor-guardmgr/src/skew.rs
+
2
−
0
View file @
72f00daf
...
...
@@ -29,6 +29,8 @@ impl SkewObservation {
}
/// An estimate of how skewed our clock is, plus a summary of why we think so.
//
// SEMVER NOTE: this type is re-exported from tor-circmgr.
#[derive(Clone,
Debug)]
pub
struct
SkewEstimate
{
/// Our best guess for the magnitude of the skew.
...
...
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