Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
Signed-off-by: andylokandy <[email protected]>
  • Loading branch information
andylokandy committed Jun 22, 2024
1 parent 2e7f3f7 commit d5a5c17
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions minitrace/src/collector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,15 @@ pub struct Config {
}

impl Config {
/// A soft limit for the total number of spans and events for a trace, usually used
/// to avoid out-of-memory.
/// Sets a soft limit for the total number of spans and events in a trace, typically
/// used to prevent out-of-memory issues.
///
/// The default value is `None`.
///
/// # Note
///
/// Root span will always be collected. The eventually collected spans may exceed the limit.
/// The root span will always be collected, so the actual number of collected spans
/// may exceed the specified limit.
///
/// # Examples
///
Expand All @@ -295,7 +296,7 @@ impl Config {
}
}

/// The time duration between two batch reports.
/// Sets the time duration between two batch reports.
#[deprecated(
since = "0.6.7",
note = "Please use `report_interval` instead. This method is now a no-op."
Expand All @@ -304,7 +305,7 @@ impl Config {
self
}

/// The soft limit for the maximum number of spans in a batch report.
/// Sets the soft limit for the maximum number of spans in a batch report.
#[deprecated(
since = "0.6.7",
note = "Please use `report_interval` instead. This method is now a no-op."
Expand All @@ -313,13 +314,13 @@ impl Config {
self
}

/// The time duration between two reports. The reporter will be called when the time duration is
/// met even the collected spans are empty. So you may implement batching in the reporter.
/// Sets the time duration between two reports. The reporter will be invoked when the specified
/// duration elapses, even if no spans have been collected. This allows for batching in the
/// reporter.
///
/// In some cases, especially when you are under very high pressure, and have
/// vitnessed spans being lost, it's most likely that the channel is full during
/// the report interval. You may want to decrease the report interval even down to
/// zero to avoid losing spans.
/// In some scenarios, particularly under high load, you may notice spans being lost. This is
/// likely due to the channel being full during the reporting interval. To mitigate this issue,
/// consider reducing the report interval, potentially down to zero, to prevent losing spans.
///
/// The default value is 10 milliseconds.
pub fn report_interval(self, report_interval: Duration) -> Self {
Expand All @@ -329,10 +330,10 @@ impl Config {
}
}

/// Whether to report the spans before the root span finishes.
/// Configures whether to report spans before the root span finishes.
///
/// If this is set to `true`, you may not be able to cancel all spans in a trace because some of
/// the spans may be reported before they are canceled.
/// If set to `true`, some spans may be reported before they are canceled, making it
/// difficult to cancel all spans in a trace.
///
/// The default value is `false`.
///
Expand Down

0 comments on commit d5a5c17

Please sign in to comment.