Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultServerAddress(pid int) string
- type Client
- type CollectTracingConfig
- type CollectTracingPayload
- type CollectTracingResponse
- type Dialer
- type ErrorResponse
- type Format
- type Header
- type Option
- type ProviderConfig
- type Session
- type StopTracingPayload
- type StopTracingResponse
Constants ¶
const ( CommandSetDump CommandSetEventPipe CommandSetProfiler CommandSetProcess CommandSetServer = 0xFF )
const ( EventPipeStopTracing EventPipeCollectTracing EventPipeCollectTracing2 )
Variables ¶
Functions ¶
func DefaultServerAddress ¶
DefaultServerAddress returns Diagnostic Server unix domain socket path for the process given. https://github.com/dotnet/diagnostics/blob/main/documentation/design-docs/ipc-protocol.md#transport
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implement Diagnostic IPC Protocol client. https://github.com/dotnet/diagnostics/blob/main/documentation/design-docs/ipc-protocol.md
func NewClient ¶
NewClient creates a new Diagnostic IPC Protocol client for the transport specified - on Unix/Linux based platforms, a Unix Domain Socket will be used, and on Windows, a Named Pipe will be used:
- /tmp/dotnet-diagnostic-{%d:PID}-{%llu:disambiguation key}-socket (Linux/MacOS)
- \\.\pipe\dotnet-diagnostic-{%d:PID} (Windows)
Refer to documentation for details: https://github.com/dotnet/diagnostics/blob/main/documentation/design-docs/ipc-protocol.md#transport
func (*Client) CollectTracing ¶
func (c *Client) CollectTracing(config CollectTracingConfig) (s *Session, err error)
CollectTracing creates a new EventPipe session stream of NetTrace data.
func (*Client) StopTracing ¶
StopTracing stops the given streaming session started with CollectTracing.
type CollectTracingConfig ¶
type CollectTracingConfig struct { // CircularBufferSizeMB specifies the size of the circular buffer used for // buffering event data while streaming CircularBufferSizeMB uint32 // Providers member lists providers to turn on for a streaming session. // See ETW documentation for a more detailed explanation of Keywords, Filters, and Log Level: // https://docs.microsoft.com/en-us/message-analyzer/system-etw-provider-event-keyword-level-settings Providers []ProviderConfig }
CollectTracingConfig contains supported parameters for CollectTracing command.
type CollectTracingPayload ¶
type CollectTracingPayload struct { CircularBufferSizeMB uint32 Format Format Providers []ProviderConfig }
func (CollectTracingPayload) Bytes ¶
func (p CollectTracingPayload) Bytes() []byte
type CollectTracingResponse ¶
type CollectTracingResponse struct {
SessionID uint64
}
type Dialer ¶ added in v1.2.0
Dialer establishes connection to the given address. Due to the potential for an optional continuation in the Diagnostics IPC Protocol, each successful connection between the runtime and a Diagnostic Port is only usable once.
Note that the dialer is OS-specific, refer to documentation for details: https://github.com/dotnet/diagnostics/blob/main/documentation/design-docs/ipc-protocol.md#transport
func DefaultDialer ¶ added in v1.2.0
func DefaultDialer() Dialer
type ErrorResponse ¶
type ErrorResponse struct {
Code uint32
}
type Option ¶ added in v1.2.0
type Option func(*Client)
Option overrides default Client parameters.
func WithDialer ¶ added in v1.2.0
WithDialer overrides default dialer function with d.
type ProviderConfig ¶
type Session ¶
type Session struct { ID uint64 // contains filtered or unexported fields }
Session represents EventPipe stream of NetTrace data created with `CollectTracing` command.
A session is expected to be closed with `StopTracing` call (or `Close`), as there is a "run down" at the end of a stream session that transmits additional metadata. If the stream is stopped prematurely due to a client or server error, the NetTrace stream will be incomplete and should be considered corrupted.
type StopTracingPayload ¶
type StopTracingPayload struct {
SessionID uint64
}
func (StopTracingPayload) Bytes ¶
func (p StopTracingPayload) Bytes() []byte
type StopTracingResponse ¶
type StopTracingResponse struct {
SessionID uint64
}