示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> class.
 /// </summary>
 /// <param name="eventName">
 /// 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;
 /// </param>
 /// <param name="eventType">The type of event.</param>
 /// <param name="stageType">The type of operation.</param>
 /// <param name="result">the result of this user task. If the result is Failure, recommend correlate with <see cref="T:Coding4Fun.VisualStudio.Telemetry.FaultEvent" />.</param>
 /// <param name="resultSummary">
 /// 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 <see cref="T:Coding4Fun.VisualStudio.Telemetry.FaultEvent" />.
 /// E.g., "sign in failed because of wrong credential", "user cancelled azure deployment".
 /// Default value is null.
 /// </param>
 internal OperationEvent(string eventName, DataModelEventType eventType, OperationStageType stageType, TelemetryResult result, string resultSummary = null)
     : base(eventName, TelemetrySeverity.Normal, eventType)
 {
     if (eventType != 0 && eventType != DataModelEventType.Operation)
     {
         throw new ArgumentException("Expect DataModelEventType UserTask or Operation only.", "eventType");
     }
     DataModelEventNameHelper.SetProductFeatureEntityName(this);
     StageType = stageType;
     SetResultProperties(result, resultSummary);
 }
示例#2
0
 /// <summary>
 /// Creates the new telemetry event instance with specific information.
 /// </summary>
 /// <param name="eventName">Event name that is unique, not null and not empty.</param>
 /// <param name="severity">Severity level of the event.</param>
 /// <param name="eventType">Data Model type of this event. check <see cref="T:Coding4Fun.VisualStudio.Telemetry.DataModelEventType" /> for full type list. </param>
 internal TelemetryEvent(string eventName, TelemetrySeverity severity, DataModelEventType eventType)
     : this(eventName, severity, new TelemetryEventCorrelation(Guid.NewGuid(), eventType))
 {
 }
 void ILoggingServiceInternal.PostEvent(DataModelEventType eventType, string eventName, TelemetryResult result, params (string name, object property)[] namesAndProperties)
示例#4
0
 internal TelemetryEventCorrelation(Guid id, DataModelEventType eventType)
 {
     Id        = id;
     EventType = eventType;
 }
示例#5
0
 public void PostEvent(DataModelEventType eventType, string eventName, TelemetryResult result, IReadOnlyList <(string name, object property)> namesAndProperties)
示例#6
0
 public void PostEvent(DataModelEventType eventType, string eventName, TelemetryResult result = TelemetryResult.Success, params (string name, object property)[] namesAndProperties)
示例#7
0
 /// <summary>
 /// Get event type name from event type enum.
 /// PLEASE DO NOT change the code logic. Enum name is part of contract between client and backend server.
 /// </summary>
 /// <param name="eventType"></param>
 /// <returns></returns>
 internal static string GetName(DataModelEventType eventType)
 {
     return(eventType.ToString());
 }