Skip to content

Commit

Permalink
docs: [torrust#168] statistics importer console command
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Jun 5, 2023
1 parent 29d87de commit 93d1b64
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
22 changes: 20 additions & 2 deletions src/console/commands/import_tracker_statistics.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
//! It imports statistics for all torrents from the linked tracker.
//!
//! It imports the number of seeders and leechers for all torrent from the linked tracker.
//! It imports the number of seeders and leechers for all torrents from the
//! associated tracker.
//!
//! You can execute it with: `cargo run --bin import_tracker_statistics`
//! You can execute it with: `cargo run --bin import_tracker_statistics`.
//!
//! After running it you will see the following output:
//!
//! ```text
//! Importing statistics from linked tracker ...
//! Loading configuration from config file `./config.toml`
//! Tracker url: udp://localhost:6969
//! ```
//!
//! Statistics are also imported:
//!
//! - Periodically by the importer job. The importer job is executed every hour
//! by default. See [`TrackerStatisticsImporter`](crate::config::TrackerStatisticsImporter)
//! for more details.
//! - When a new torrent is added.
//! - When the API returns data about a torrent statistics are collected from
//! the tracker in real time.
use std::env;
use std::sync::Arc;

Expand Down
21 changes: 18 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
//! - [Development](#development)
//! - [Configuration](#configuration)
//! - [Usage](#usage)
//! - [API](#api)
//! - [Tracker Statistics Importer](#tracker-statistics-importer)
//! - [Upgrader](#upgrader)
//! - [Contributing](#contributing)
//! - [Documentation](#documentation)
//!
Expand Down Expand Up @@ -218,12 +221,24 @@
//!
//! # Usage
//!
//! ## API
//!
//! Running the tracker with the default configuration will expose the REST API on port 3000: <http://localhost:3000>
//!
//! You can also run console commands:
//! ## Tracker Statistics Importer
//!
//! This console command allows you to manually import the tracker statistics.
//!
//! For more information about this command you can visit the documentation for
//! the [`Import tracker statistics`](crate::console::commands::import_tracker_statistics) module.
//!
//! ## Upgrader
//!
//! This console command allows you to manually upgrade the application from one
//! version to another.
//!
//! - [`Import tracker statistics`](crate::console::commands::import_tracker_statistics).
//! - [`Upgrade app from version 1.0.0 to 2.0.0`](crate::upgrades::from_v1_0_0_to_v2_0_0::upgrader).
//! For more information about this command you can visit the documentation for
//! the [`Upgrade app from version 1.0.0 to 2.0.0`](crate::upgrades::from_v1_0_0_to_v2_0_0::upgrader) module.
//!
//! Refer to the documentation of each command for more information.
//!
Expand Down

0 comments on commit 93d1b64

Please sign in to comment.