-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename the new pub type (requires moving the internal DTrace type wit…
…h the same name) add demo test fix up docs a bit
- Loading branch information
1 parent
99c6e33
commit 951fb6c
Showing
13 changed files
with
139 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2023 Oxide Computer Company | ||
//! DTrace probes and support | ||
|
||
#[derive(Debug, Clone, serde::Serialize)] | ||
pub(crate) struct RequestInfo { | ||
id: String, | ||
local_addr: std::net::SocketAddr, | ||
remote_addr: std::net::SocketAddr, | ||
method: String, | ||
path: String, | ||
query: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Serialize)] | ||
pub(crate) struct ResponseInfo { | ||
id: String, | ||
local_addr: std::net::SocketAddr, | ||
remote_addr: std::net::SocketAddr, | ||
status_code: u16, | ||
message: String, | ||
} | ||
|
||
#[cfg(feature = "usdt-probes")] | ||
#[usdt::provider(provider = "dropshot")] | ||
mod probes { | ||
use super::{RequestInfo, ResponseInfo}; | ||
fn request__start(_: &RequestInfo) {} | ||
fn request__done(_: &ResponseInfo) {} | ||
} | ||
|
||
/// The result of registering a server's DTrace USDT probes. | ||
#[derive(Debug, Clone, PartialEq)] | ||
pub enum ProbeRegistration { | ||
/// The probes are explicitly disabled at compile time. | ||
Disabled, | ||
|
||
/// Probes were successfully registered. | ||
Succeeded, | ||
|
||
/// Registration failed, with an error message explaining the cause. | ||
Failed(String), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.