Skip to main content

rustlavel_debugbar/
lib.rs

1//! A debug bar: what *this* request did, on the page it produced.
2//!
3//! `rustlavel-telescope` is the other half of this idea and answers a different
4//! question. It is a dashboard at its own URL, and you go to it to ask what
5//! happened across many requests. A debug bar answers "what did the page I am
6//! looking at just do", without leaving the page — which is the question you
7//! have while building a screen, and the one where walking to another tab
8//! breaks your train of thought.
9//!
10//! Both read the same instrumentation bus. Neither collects anything the other
11//! does not; they differ only in where they put it.
12//!
13//! # It does not run in production
14//!
15//! The bar prints SQL, cache keys and timings into the HTML of a page. That is
16//! exactly what you want while developing and exactly what you must never ship,
17//! so it is off unless the environment says otherwise, and turning it on in
18//! production takes a method whose name says what you are doing.
19
20pub mod collector;
21pub mod plugin;
22pub mod render;
23
24pub use collector::{Collected, Collector, Timing};
25pub use plugin::DebugBar;
26
27pub use rustlavel_core::{Error, Result};