ActivitySpanId 结构

定义

表示 SpanId,其格式基于 W3C 标准。Represents a SpanId formatted based on a W3C standard.

public value class ActivitySpanId : IEquatable<System::Diagnostics::ActivitySpanId>
public struct ActivitySpanId : IEquatable<System.Diagnostics.ActivitySpanId>
type ActivitySpanId = struct
Public Structure ActivitySpanId
Implements IEquatable(Of ActivitySpanId)
继承
ActivitySpanId
实现

注解

ActivitySpanId 结构反映了 W3C 标准在跟踪中的单个跨度 ID 上所需的格式。The ActivitySpanId structure reflects the format that the W3C standard requires for the ID of a single span in a trace. 它包含8个字节,通常显示为16个十六进制字符。It consists of 8 bytes, typically displayed as 16 hexadecimal characters. 对于其 Activity.IdFormatW3CActivitySpanId 返回 ActivitySpanIdAn ActivitySpanId is returned by the SpanId for an Activity whose Activity.IdFormat is W3C.

由于 ActivitySpanId 是包含8个字节的结构,因此可以通过引用来传递它。Because an ActivitySpanId is a structure that contains 8 bytes, it can be passed by reference. ActivitySpanId 包含用于在十六进制字符串表示形式之间进行转换的方法,尝试避免在必须更改格式之前更改格式,并在创建后缓存其字符串表示形式。ActivitySpanId contains methods for converting to and from hexadecimal string representation, tries to avoid changing formats until it has to, and caches its string representation after it is created. 它主要用作交换类型。It is mostly useful as an exchange type.

方法

CopyTo(Span<Byte>)

将当前 ActivitySpanId 的 8 个字节复制到指定的范围。Copies the 8 bytes of the current ActivitySpanId to a specified span.

CreateFromBytes(ReadOnlySpan<Byte>)

从一个包含 8 个字节的只读范围创建一个新的 ActivitySpanId 值。Creates a new ActivitySpanId value from a read-only span of eight bytes.

CreateFromString(ReadOnlySpan<Char>)

从一个包含 16 个十六进制字符的只读范围创建一个新的 ActivitySpanId 值。Creates a new ActivitySpanId value from a read-only span of 16 hexadecimal characters.

CreateFromUtf8String(ReadOnlySpan<Byte>)

从一个包含 UTF8 编码字节的只读范围创建一个新的 ActivitySpanId 值。Creates a new ActivitySpanId value from a read-only span of UTF8-encoded bytes.

CreateRandom()

基于一个随机数字(很可能是唯一的数字)创建一个新的 ActivitySpanIdCreates a new ActivitySpanId based on a random number (that is very likely to be unique).

Equals(ActivitySpanId)

确定此实例是否与指定的 ActivitySpanId 实例具有相同的值。Determines whether this instance and the specified ActivitySpanId instance have the same value.

Equals(Object)

当前实例和指定对象(必须也是 ActivitySpanId 实例)具有相同值。the current instance and a specified object, which also must be an ActivitySpanId instance, have the same value.

GetHashCode()

返回 SpanId 的哈希代码。Returns the hash code of the SpanId.

ToHexString()

返回表示此范围 ID 的 16 个字符的十六进制字符串。Returns a 16-character hexadecimal string that represents this span ID.

ToString()

返回表示此范围 ID 的 16 个字符的十六进制字符串。Returns a 16-character hexadecimal string that represents this span ID.

运算符

Equality(ActivitySpanId, ActivitySpanId)

确定两个指定的 ActivitySpanId 实例是否具有相同的值。Determines whether two specified ActivitySpanId instances have the same value.

Inequality(ActivitySpanId, ActivitySpanId)

确定两个指定的 ActivitySpanId 实例是否具有不相等的值。Determine whether two specified ActivitySpanId instances have unequal values.

适用于