Activity Třída
Definice
Představuje operaci s kontextem, který se má použít k protokolování.Represents an operation with context to be used for logging.
public ref class Activity : IDisposable
public ref class Activity
public class Activity : IDisposable
public class Activity
type Activity = class
interface IDisposable
type Activity = class
Public Class Activity
Implements IDisposable
Public Class Activity
- Dědičnost
-
Activity
- Implementuje
Poznámky
Activity
Má název operace, ID, čas zahájení a dobu trvání, značky a zavazadlo.An Activity
has an operation name, an ID, a start time and duration, tags, and baggage.
K aktuální aktivitě lze přidružit pomocí statické Activity.Current Vlastnosti.The current activity can be accessed with the static Activity.Current property.
Aktivity by měly být vytvořeny voláním konstruktoru, nakonfigurován podle potřeby a následně spuštěny Start metodou, která udržuje vztahy nadřazenosti a podřízenosti pro aktivity a sady Activity.Current .Activities should be created by calling the constructor, configured as necessary, and then started with the Start method, which maintains parent-child relationships for the activities and sets Activity.Current.
Po dokončení aktivity by se měla zastavit s Activity.Stop() metodou.When an activity is finished, it should be stopped with the Activity.Stop() method.
Žádné Activity
metody neumožňují úniku výjimek jako reakci na špatné vstupy.No Activity
methods allow exceptions to escape as a response to bad inputs. Jsou vyvolány a zachyceny (což umožňuje ladicím programům a monitorům zobrazit chybu), ale výjimka je potlačena a operace má něco odůvodněno (obvykle neprovádí žádnou akci).They are thrown and caught (which allows debuggers and monitors to see the error), but the exception is suppressed, and the operation does something reasonable (typically it does nothing).
Konstruktory
Activity(String) |
Inicializuje novou instanci Activity třídy.Initializes a new instance of the Activity class. |
Vlastnosti
ActivityTraceFlags |
Získá nebo nastaví příznaky (definované specifikací W3C ID) přidružených k aktivitě.Gets or sets the flags (defined by the W3C ID specification) associated with the activity. |
Baggage |
Získá kolekci párů klíč/hodnota, které představují informace, které jsou předány podřízeným objektům Activity .Gets a collection of key/value pairs that represents information that is passed to children of this Activity. |
Context |
Získá kontext aktivity.Gets the context of the activity. Kontext bude platný pouze v případě, že byla aktivita spuštěna.Context becomes valid only if the activity has been started. |
Current |
Získá nebo nastaví aktuální operaci ( Activity ) pro aktuální vlákno.Gets or sets the current operation (Activity) for the current thread. Tento tok v rámci asynchronních volání.This flows across async calls. |
DefaultIdFormat |
Získá nebo nastaví výchozí formát ID pro Activity .Gets or sets the default ID format for the Activity. |
DisplayName |
Získá nebo nastaví zobrazovaný název aktivity.Gets or sets the display name of the activity. |
Duration |
Získá dobu trvání operace.Gets the duration of the operation. |
Events |
Načte seznam všech událostí aktivity připojených k této aktivitě.Gets the list of all the activity events attached to this activity. |
ForceDefaultIdFormat |
Získá nebo nastaví hodnotu, která detrmines, pokud DefaultIdFormat se vždy používá k definování výchozího formátu ID.Gets or sets a value that detrmines if the DefaultIdFormat is always used to define the default ID format. |
Id |
Získá identifikátor, který je specifický pro konkrétní požadavek.Gets an identifier that is specific to a particular request. |
IdFormat | |
IsAllDataRequested |
Získává nebo nastavuje hodnotu, která indikuje, jestli se má tato aktivita naplnit všemi informacemi o šíření, a všemi ostatními vlastnostmi, jako jsou odkazy, značky a události.Gets or sets a value that indicates whether this activity should be populated with all the propagation information, as well as all the other properties, such as links, tags, and events. |
Kind |
Získá vztah mezi aktivitou, jejími nadřazenými a podřízenými položkami v trasování.Gets the relationship between the activity, its parents, and its children in a trace. |
Links |
Načte seznam všech odkazů na aktivity připojených k této aktivitě.Gets the list of all the activity links attached to this activity. |
OperationName |
Získá název operace.Gets the operation name. |
Parent |
Získá nadřazenou položku Activity , která vytvořila tuto aktivitu.Gets the parent Activity that created this activity. |
ParentId |
Získá ID nadřazeného objektu této aktivity.Gets the ID of this activity's parent. |
ParentSpanId | |
Recorded |
Získá hodnotu, která označuje, zda je nastaven příznak W3CIdFlags. Recorded.Gets a value that indicates whether the W3CIdFlags.Recorded flag is set. |
RootId |
Získá ID kořenového adresáře Activity .Gets the root ID of this Activity. |
Source |
Získá zdroj aktivity přidružený k této aktivitě.Gets the activity source associated with this activity. |
SpanId | |
StartTimeUtc |
Získá čas spuštění operace.Gets the time when the operation started. |
TagObjects |
Získá seznam značek, které reprezentují informace, které se mají protokolovat spolu s aktivitou.Gets the list of tags that represent information to log along with the activity. Tyto informace nejsou předávány podřízeným položkám této aktivity.This information is not passed on to the children of this activity. |
Tags |
Získá kolekci párů klíč/hodnota, které reprezentují informace, které budou protokolovány spolu s Activity protokolovacím systémem.Gets a collection of key/value pairs that represent information that will be logged along with the Activity to the logging system. |
TraceId | |
TraceStateString |
Získá nebo nastaví hlavičku W3C |
Metody
AddBaggage(String, String) |
Aktualizuje Activity tak, aby měl novou položku pro zavazadlo se zadaným klíčem a hodnotou.Updates the Activity to have a new baggage item with the specified key and value. |
AddEvent(ActivityEvent) |
Přidá zadanou událost aktivity do seznamu události.Adds the specified activity event to the events list. |
AddTag(String, Object) |
Aktualizuje aktivitu tak, aby měla značku s dalšími |
AddTag(String, String) |
Aktualizuje a má Activity novou značku s dodanými |
Dispose() |
Zastaví aktivitu, pokud je již spuštěna, a upozorní všechny naslouchací procesy událostí.Stops the activity if it is already started and notifies any event listeners. Nic se nestane jinak.Nothing will happen otherwise. |
Dispose(Boolean) |
Při přepsal odvozeným typem Tato metoda uvolní všechny přidělené prostředky.When overriden by a derived type, this method releases any allocated resources. |
Equals(Object) |
Určí, zda se zadaný objekt rovná aktuálnímu objektu.Determines whether the specified object is equal to the current object. (Zděděno od Object) |
GetBaggageItem(String) |
Vrátí hodnotu páru klíč-hodnota přidaný do aktivity pomocí AddBaggage(String, String) .Returns the value of a key-value pair added to the activity with AddBaggage(String, String). |
GetCustomProperty(String) |
Vrátí objekt namapovaný na zadaný název vlastnosti.Returns the object mapped to the specified property name. |
GetHashCode() |
Slouží jako výchozí funkce hash.Serves as the default hash function. (Zděděno od Object) |
GetType() |
Získá Type aktuální instanci.Gets the Type of the current instance. (Zděděno od Object) |
MemberwiseClone() |
Vytvoří kopii aktuálního seznamu Object .Creates a shallow copy of the current Object. (Zděděno od Object) |
SetCustomProperty(String, Object) |
Připojí libovolný vlastní objekt k této aktivitě.Attaches any custom object to this activity. Pokud byl zadaný |
SetEndTime(DateTime) |
Aktualizuje a Activity nastaví Duration jako rozdíl mezi StartTimeUtc a zadanou dobu zastavení.Updates the Activity to set its Duration as the difference between StartTimeUtc and the specified stop time. |
SetIdFormat(ActivityIdFormat) |
Před spuštěním nastaví formát ID Activity .Sets the ID format on this Activity before it is started. |
SetParentId(ActivityTraceId, ActivitySpanId, ActivityTraceFlags) |
Nastaví nadřazené ID pomocí konvence W3C TraceId a SpanId.Sets the parent ID using the W3C convention of a TraceId and a SpanId. |
SetParentId(String) |
Aktualizuje tuto skutečnost Activity , aby označovala, že Activity s ID |
SetStartTime(DateTime) |
Nastaví počáteční čas tohoto Activity .Sets the start time of this Activity. |
SetTag(String, Object) |
Přidá nebo aktualizuje značku aktivity vstupním klíčem a hodnotou.Adds or update the activity tag with the input key and value. |
Start() |
Spustí aktivitu.Starts the activity. |
Stop() |
Zastaví aktivitu.Stops the activity. |
ToString() |
Vrátí řetězec, který představuje aktuální objekt.Returns a string that represents the current object. (Zděděno od Object) |