Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(stats): improve chart creation process description #1020

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions stats/stats-server/src/runtime_setup.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
//! Setting up the runtime according to provided configs.
//!
//! ## Adding new charts
//!
//! 1. Create charts & update group(-s) (if necessary) according to
//! documentation in [`stats::update_group`] (steps 1-2).
//! 2. If new groups were added:
//!
//! 2.1. Add new update groups to [`RuntimeSetup::all_update_groups`] (if any)
//!
//! 2.2. Configure the group update schedule in `update_groups.json` config
//! 3. Add the new charts to `charts.json` and `layout.json` (if needed)
//!

use crate::config::{
self,
types::{AllChartSettings, EnabledChartSettings, LineChartCategory},
Expand Down
2 changes: 1 addition & 1 deletion stats/stats/src/data_source/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
//! [`UpdateContext`]. This way, SQL queries can use this time to get data relevant at this particular
//! timestamp.
//!
//! See (module & struct) documentation for details.
//! See ([module](crate::update_group) & [struct](crate::update_group::SyncUpdateGroup)) documentation for details.

pub mod kinds;
pub mod source;
Expand Down
7 changes: 4 additions & 3 deletions stats/stats/src/update_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
//!
//! ## Usage
//!
//! (you can also check [`data_source` documentation](crate::data_source) or tests there)
//! (you can also check [`data_source` documentation](crate::data_source), tests there, or
//! the actual usage in `stats-server` crate (`runtime_setup.rs`))
//!
//! 1. Create multiple connected charts
//! (e.g.
//! [`DirectVecLocalDbChartSource`](crate::data_source::kinds::local_db::DirectVecLocalDbChartSource)
//! or
//! [`DailyCumulativeLocalDbChartSource`](crate::data_source::kinds::local_db::DailyCumulativeLocalDbChartSource)
//! ).
//! 2. Construct simple (non-sync) update groups via `construct_update_group!`
//! 2. Construct simple (non-sync) update groups via `construct_update_group` macro (usually done in `../update_groups.rs`)
//! 3. Create mutexes (1-1 for each chart)
//! 4. Create synchronous versions of groups with [`SyncUpdateGroup::new`]
//!
Expand Down Expand Up @@ -99,7 +100,7 @@ pub trait UpdateGroup: core::fmt::Debug {
///
/// The behaviour is the following:
/// 1. when `create` or `update` is triggered, each member's correspinding method is triggered
/// 2. the method recursively updates/creates its dependencies
/// 2. the method recursively updates/creates all of the member's dependencies
///
/// In addition, to update synchronization, the resulting group provides object-safe interface
/// for interacting with its members (charts). In particular, the charts themselves
Expand Down
Loading