Share via


TelemetrySessionExtensions.PostUserTask Method

Definition

Post an event for user task. A user task is an application operation that is INVOKED BY USER directly and comes with result (e.g., Success, Failure). It is used for user behavior/intent analysis. User is aware of the operation and be able to execute. e.g. Open project and Show tool windows are user tasks; instead load VS package and Design time build are operations.

This method is used for atomic user task that runs very fast or has little value to analyze the process duration. Caller calls this method when user task is complete. For long-time running or async user task, in order to understand what else happened during the time or track if it partially completes because of an error, use method StartUserTask(TelemetrySession, String) which tracks both start and end points.

public static Microsoft.VisualStudio.Telemetry.TelemetryEventCorrelation PostUserTask (this Microsoft.VisualStudio.Telemetry.TelemetrySession session, string eventName, Microsoft.VisualStudio.Telemetry.TelemetryResult result, string resultSummary = default, Microsoft.VisualStudio.Telemetry.TelemetryEventCorrelation[] correlatedWith = default);
static member PostUserTask : Microsoft.VisualStudio.Telemetry.TelemetrySession * string * Microsoft.VisualStudio.Telemetry.TelemetryResult * string * Microsoft.VisualStudio.Telemetry.TelemetryEventCorrelation[] -> Microsoft.VisualStudio.Telemetry.TelemetryEventCorrelation
<Extension()>
Public Function PostUserTask (session As TelemetrySession, eventName As String, result As TelemetryResult, Optional resultSummary As String = Nothing, Optional correlatedWith As TelemetryEventCorrelation() = Nothing) As TelemetryEventCorrelation

Parameters

session
TelemetrySession

telemetry session object.

eventName
String

An event name following data model schema. It requires that event name is a unique, not null or empty string. It consists of 3 parts and must follows pattern [product]/[featureName]/[entityName]. FeatureName could be a one-level feature or feature hierarchy delimited by "/". For examples, vs/platform/opensolution; vs/platform/editor/lightbulb/fixerror;

result
TelemetryResult

the result of this user task. If the result is Failure, recommend correlate with FaultEvent.

resultSummary
String

a summary description for the result. it provides a little bit more details about the result without digging into it. when correlated with fault event, use this parameter to summarize the additional information stored in FaultEvent. E.g., "sign in failed because of wrong credential", "user cancelled azure deployment". Default value is null.

correlatedWith
TelemetryEventCorrelation[]

Specify which events to correlate by using property Correlation Good candidates to correlate with UserTaskEvent are, FaultEventAssetEventOperationEvent

Returns

The user task event correlation.

Applies to