summaryrefslogtreecommitdiff
path: root/crates/arti-bench/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bunch of needless-conversion warnings.Nick Mathewson2023-03-101-1/+0
| | | | | Apparently 1.68 now warns when you call into_iter() on something that's already an iterator. Fair enough. Let's stop doing that.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+9
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* Upgrade to clap 3: replace deprecated functionsGabriel de Perthuis2022-11-041-29/+33
| | | | | | | | | | | Also replace Arg::takes_value with Arg::action to configure flags that don't take parameters vs options that do. This makes it easy to upgrade to clap 4. Tested deprecations with: cargo check --workspace --all-features --features clap/deprecated
* Upgrade to clap 3 with minimal changesGabriel de Perthuis2022-11-041-12/+7
| | | | | | | | This removes the last cargo audit override (for the unmaintained ansi_term). Don't mark options as required when they have default values: see <https://github.com/clap-rs/clap/pull/3793>.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* tor-config: Replace dir detection with ConfigurationSource enumIan Jackson2022-08-251-2/+7
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/682#note_2830860 And subsequent IRC discussion. Having done the work as per review comments, I don't much like the result. It's quite un-ergonomiuc. If we can't have fs autodetection, I think syntactic autodetection within sources.rs would be nearly as nice. However, I seem to be outvoted. At least the externally visible functionality (of an arti binary, say) is reasonably ergonomic.
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* lints: Make lint blocks consistentIan Jackson2022-05-311-0/+1
| | | | The remaining consequences of running add_warning
* lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | From running add_warning, with manual picking of the right hunks/lines.
* lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
| | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* Split TorClientConfig out of ArtiConfig, and Resolvable traitIan Jackson2022-05-241-3/+2
| | | | | | | | | | | | This gets rid of `#[serde(flatten)]` which prevents serde_ignored (and other kinds of introspection) from working properly. The price is now that the toplevel has to deal with two configuration objects. The Resolvable trait is overkill right now, but is going to do More Things in a moment. In particular, we need the impl on tuples, so that the whole config can be processed in one go.
* fs-mistrust: make Mistrust have a corresponding Builder type.Nick Mathewson2022-05-241-2/+1
| | | | | This is an approximately minimal revision to get Builder in place; subsequent commits will clean up the API.
* arti-config abolition: Change references to use tor_configIan Jackson2022-05-131-1/+2
| | | | | | | | Generally, change the paths that mention the crate name to go via a module-level "use". This involves adding tor-config as a direct dependency for a few crates.
* arti-bench: Disable all fs permissions (fs-mistrust) checksIan Jackson2022-05-131-0/+7
| | | | | | | | | This is a benchmarking tool, and fs-mistrust doesn't like the permissions in our CI. The env var ARTI_FS_DISABLE_PERMISSION_CHECKS is (of course) specific to arti. Maybe it should be honoured here, or this should be done via the config files. But disabling this is fine for now.
* ConfigurationSource: Rename new to new_emptyIan Jackson2022-05-111-1/+1
| | | | | This emphasises its nature. We're going to provide a more cooked constructor in a moment.
* serde attributes: A tiny bit of reorderingIan Jackson2022-05-051-2/+2
| | | | Having a consistent order will make the nest commit easier to read.
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-1/+0
|
* Merge branch 'no-system-time' into 'main'eta2022-03-301-0/+1
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * remove most usage of SystemTime::nowtrinity-1686a2022-02-251-0/+1
| |
* | rename *_isolation_group to *_isolationtrinity-1686a2022-03-241-1/+1
| |
* | Move ArtiConfig to new arti::cfg moduleIan Jackson2022-03-211-1/+1
| | | | | | | | Code motion and import fixups.
* | Actually throw an anyhowIan Jackson2022-03-181-1/+1
| | | | | | | | Prompted by a compiler warning which I weirdly can't seem to reproduce?
* | Alternative API for set_isolation_group().Nick Mathewson2022-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Instead of requiring a `Box<dyn Isolation>`, it now takes either a `Box<dyn Isolation>`, or an arbitrary `T` that implements `Isolation`. This API still allows the user to pass in a `Box<dyn Isolation>` if that's what they have, but it doesn't require them to Box the isolation on their own. Part of #414.
* | accept boxed isolation in StreamPref::set_isolation_grouptrinity-1686a2022-03-161-1/+1
| |
* | arti-bench: don't allocate a separate receive-buffer for each jobNick Mathewson2022-03-081-9/+26
| | | | | | | | | | | | This makes heap profiling more viable. Closes #391.
* | arti-bench: documentation fixesNick Mathewson2022-03-071-5/+6
| |
* | arti-bench: record streams_per_circ and circs_per_sample.Nick Mathewson2022-03-071-5/+14
| |
* | Fix an unwrap() error.Nick Mathewson2022-03-041-1/+1
| |
* | arti-bench: use isolation to support multiple circuits per run.Nick Mathewson2022-03-041-14/+104
| |
* | arti-bench: simplify future-creation code slightlyNick Mathewson2022-03-041-8/+3
| |
* | arti-bench: refactor stream construction to connect in parallelNick Mathewson2022-03-041-33/+15
| | | | | | | | | | | | | | | | | | | | | | | | Previously we tried to do each connection in a run, and only then did we start transferring data over them. Now we collect a bunch of the futures that return an open stream, and run them all in parallel with using them. This change includes connect-time in our benchmarks, and allows us to test contention in our connect code. Instead of using a Stream, I've changed the connection-generation code to call a future-returning function directly, so we have a way to explicitly pass which run we're in.
* | Merge branch 'clippy-allow-arc-clone' into 'main'Nick Mathewson2022-03-011-1/+0
|\ \ | | | | | | | | | | | | Disable clippy::clone_on_ref_ptr See merge request tpo/core/arti!352
| * | Disable clippy::clone_on_ref_ptrIan Jackson2022-02-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lint is IMO inherently ill-conceived. I have looked for the reasons why this might be thought to be a good idea and there were basically two (and they are sort of contradictory): I. "Calling ‘.clone()` on an Rc, Arc, or Weak can obscure the fact that only the pointer is being cloned, not the underlying data." This is the wording from https://rust-lang.github.io/rust-clippy/v0.0.212/#clone_on_ref_ptr It is a bit terse; we are left to infer why it is a bad idea to obscure this fact. It seems to me that if it is bad to obscure some fact, that must be because the fact is a hazard. But why would it be a hazard to not copy the underlying data ? In other languages, faliing to copy the underlying data is a serious correctness hazard. There is a whose class of bugs where things were not copied, and then mutated and/or reused in multiple places in ways that were not what the programmer intended. In my experience, this is a very common bug when writing Python and Javascript. I'm told it's common in golang too. But in Rust this bug is much much harder to write. The data inside an Arc is immutable. To have this bug you'd have use interior mutability - ie mess around with Mutex or RefCell. That provides a good barrier to these kind of accidents. II. "The reason for writing Rc::clone and Arc::clone [is] to make it clear that only the pointer is being cloned, as opposed to the underlying data. The former is always fast, while the latter can be very expensive depending on what is being cloned." This is the reasoning found here https://github.com/rust-lang/rust-clippy/issues/2048 This is saying that *not* using Arc::clone is hazardous. Specifically, that a deep clone is a performance hazard. But for this argument, the lint is precisely backwards. It's linting the "good" case and asking for it to be written in a more explicit way; while the supposedly bad case can be written conveniently. Also, many objects (in our codebase, and in all the libraries we use) that are Clone are in fact simply handles. They contain Arc(s) (or similar) and are cheap to clone. Indeed, that is the usual case. It does not make sense to distinguish in the syntax we use to clone such a handle, whether the handle is a transparent Arc, or an opaque struct containing one or more other handles. Forcing Arc::clone to be written as such makes for code churn when a type is changed from Arc<Something> to Something: Clone, or vice versa.
* | | arti-client: use PreferredRuntime by default, doc cleanupseta2022-02-281-3/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes using the `PreferredRuntime` the first-class option inside `arti-client`, freeing users who don't want to think about runtimes from having to do so. `TorClient::create_unbootstrapped` and `builder` now automatically use this runtime, leaving only `builder_custom` for users who wish to manually specify a runtime. This lets us clean up the docs a lot: mentions of using custom runtimes are now relegated to nearer the end of the crate-level documentation, and we mostly just link to `tor_rtcompat`'s docs to explain more there. Instead, we take some more time to explain how you use the builder API to create clients synchronously. Other doc cleanups included getting rid of the explanation of `TorAddr` in the main crate-level doc; this is already well-documented elsewhere, and is something users should discover organically later. fixes arti#326
* | Upgrade to newer version of config crate.Nick Mathewson2022-02-251-0/+1
|/
* Change deny(clippy::all) to warn(clippy::all).Nick Mathewson2022-02-141-1/+1
| | | | Closes #338.
* Allow creating unbootstrapped `TorClient`s (and `DirMgr`s)eta2022-02-111-1/+1
| | | | | | | | | | | | | | | This commit changes how the `TorClient` type works, enabling it to be constructed synchronously without initiating the bootstrapping process. Daemon tasks are still started on construction (although some of them won't do anything if the client isn't bootstrapped). The old bootstrap() methods are now reimplemented in terms of the new create_unbootstrapped() and bootstrap_existing() methods. This required refactoring how the `DirMgr` works to enable the same sort of thing there. closes #293
* Fix typosDimitris Apostolou2022-02-021-1/+1
|
* Merge branch 'reload-config-prep' into 'main'Ian Jackson2022-02-021-7/+5
|\ | | | | | | | | Preparatory work for auto config reload See merge request tpo/core/arti!284
| * arti_config: Refactor configuration sources into a structNick Mathewson2022-02-011-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is by no means our final API, but should represent an improvement. Here instead of having to specify a list of files and their is-this-optional status, along with a list of command-line options, we have a single structure that encapsulates all of that information. Two advantages here: - Callers no longer have to remember what the boolean means. - We can "reload" more easily, by keeping the source object around. This change also implements the correct behavior for our default configuration file in `arti::main`: if the file is absent and the user doesn't list a config file, that's no problem. But if the user lists _that very same config file, we should insist that it be present.
* | arti-bench: summarize statistics with a new `Statistic` type (#298)eta2022-02-011-49/+86
|/ | | | | | | | This implements the proposal from arti#298, making the `BenchmarkResults` type be made out of a bunch of new `Statistic` types (which summarize the mean, median, range, and standard deviation of an arbitrary value) instead of overloading `TimingSummary` for this purpose.
* Make current/create functions into runtime member functions.Nick Mathewson2022-01-261-1/+1
| | | | | This should help avoid some amount of temptation towards API proliferation.
* arti-bench: add concurrency, write benchmark results out to JSONeta2022-01-181-20/+95
| | | | | | | | | | | | | | | | | | | | We now conduct benchmark tests with multiple concurrent streams (by default; this is configurable by passing `-p` to `arti-bench`). Currently, these results just get "flattened" for the purposes of statistical analysis (as in, results_raw contains the results of each connection's timing summary, across all benchmark runs). This might be something we wish to change in future. The stats summary now also records "best" and "worst" values for each metric, to give a rough idea of the range of values encountered. Additionally, we now support writing the benchmark results out to a JSON file. A future commit may integrate this with CI, so that we have benchmark results for every commit as a build artefact. (some documentation was also fixed) part of arti#292
* arti-bench: add support for multiple samples & averagingeta2022-01-141-30/+170
| | | | | | | | | | | | | | | | | | We now do multiple samples (configurable; default 3) per type of `arti-bench` benchmark run, and take a mean and median average of all data collected, in order to hopefully be a bit more resilient to random outliers / variation. This uses some `futures::stream::Stream` hacks, which might result in more connections being made than required (and might impact the TTFB metrics somewhat, at least for downloading). Results now get collected into a `BenchmarkResults` struct per type of benchmark, which will be in turn placed into a `BenchmarkSummary` in a later commit; this will also add the ability to serialize the latter struct out to disk, for future reference. part of arti#292
* refactor `arti-bench`daniel.eades2022-01-131-117/+159
|
* Use *_with_prefs() for Option<ConnectPrefs> callers in TorClient::connectNeel Chauhan2022-01-081-1/+1
|
* Merge remote-tracking branch 'origin/mr/214'Nick Mathewson2022-01-061-0/+1
|\