-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
538e99b
commit 2d526b3
Showing
16 changed files
with
326 additions
and
102 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
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
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 { | ||
pub id: String, | ||
pub local_addr: std::net::SocketAddr, | ||
pub remote_addr: std::net::SocketAddr, | ||
pub method: String, | ||
pub path: String, | ||
pub query: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Serialize)] | ||
pub(crate) struct ResponseInfo { | ||
pub id: String, | ||
pub local_addr: std::net::SocketAddr, | ||
pub remote_addr: std::net::SocketAddr, | ||
pub status_code: u16, | ||
pub message: String, | ||
} | ||
|
||
#[cfg(feature = "usdt-probes")] | ||
#[usdt::provider(provider = "dropshot")] | ||
mod probes { | ||
use crate::dtrace::{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
Oops, something went wrong.