Пример #1
0
 private void CollectAndSendIdentityEvaluationValuesEvent(TelemetrySession telemetrySession, CancellationToken cancellationToken)
 {
     try
     {
         KeyValuePair <string, object>[] array = GetIdentityProperties(cancellationToken).ToArray();
         if (!SendIdentityValuesEvent)
         {
             return;
         }
         TelemetryEvent telemetryEvent          = new TelemetryEvent("VS/TelemetryApi/Identity/EvaluationValues");
         KeyValuePair <string, object>[] array2 = array;
         for (int i = 0; i < array2.Length; i++)
         {
             KeyValuePair <string, object> keyValuePair = array2[i];
             telemetryEvent.Properties.Add(keyValuePair.Key, keyValuePair.Value);
         }
         cancellationToken.ThrowIfCancellationRequested();
         telemetrySession.PostEvent(telemetryEvent);
     }
     catch (OperationCanceledException)
     {
         throw;
     }
     catch (Exception exceptionObject)
     {
         telemetrySession.PostFault(EvaluationValuesEventFaultName, "SendIdentityEvaluationValuesEvent", exceptionObject);
     }
     foreach (KeyValuePair <string, Exception> exception in exceptions)
     {
         telemetrySession.PostFault(EvaluationValuesEventFaultName, exception.Key, exception.Value);
     }
 }
Пример #2
0
 private void PostAnyFaultsGettingHardwareId(TelemetrySession telemetrySession, CancellationToken cancellationToken)
 {
     foreach (Exception item in ExceptionsEncounteredObtainingHardwareId)
     {
         if (cancellationToken.IsCancellationRequested)
         {
             break;
         }
         telemetrySession.PostFault(HardwareIdEventFaultName, "ExceptionObtainingHardwareId", item);
     }
 }
Пример #3
0
 /// <summary>
 /// Post a fault event with an exception object and a callback. The callback can be used to calculate expensive data to be sent
 /// to the Watson back end, such as JScript callstacks, etc
 /// It becomes more useful when correlated with <see cref="T:Coding4Fun.VisualStudio.Telemetry.UserTaskEvent" /> or <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> which may have led to the fault occurence.
 /// </summary>
 /// <param name="telemetrySession"></param>
 /// <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="description"></param>
 /// <param name="exceptionObject">can be null</param>
 /// <param name="gatherEventDetails">Allows the user to provide code to execute synchronously to gather computationally expensive info about the event</param>
 /// <param name="correlatedWith">
 /// Specify which events to correlate by using property <see cref="P:Coding4Fun.VisualStudio.Telemetry.TelemetryEvent.Correlation" />
 /// Good candidates to correlate with <see cref="T:Coding4Fun.VisualStudio.Telemetry.FaultEvent" /> are,
 /// <see cref="T:Coding4Fun.VisualStudio.Telemetry.UserTaskEvent" />
 /// <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" />
 /// </param>
 /// <returns>The fault correlation.</returns>
 public static TelemetryEventCorrelation PostFault(this TelemetrySession telemetrySession, string eventName, string description, Exception exceptionObject, Func <IFaultUtility, int> gatherEventDetails, TelemetryEventCorrelation[] correlatedWith)
 {
     return(telemetrySession.PostFault(eventName, description, FaultSeverity.Uncategorized, exceptionObject, gatherEventDetails, correlatedWith));
 }
Пример #4
0
 /// <summary>
 /// Post a fault event with an exception object and a callback. The callback can be used to calculate expensive data to be sent
 /// to the Watson back end, such as JScript callstacks, etc
 /// It becomes more useful when correlated with <see cref="T:Coding4Fun.VisualStudio.Telemetry.UserTaskEvent" /> or <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> which may have led to the fault occurence.
 /// </summary>
 /// <param name="telemetrySession"></param>
 /// <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="description"></param>
 /// <param name="faultSeverity">The severity of the fault, used to identify actionable or important faults in divisional tools and reporting.</param>
 /// <param name="exceptionObject">can be null</param>
 /// <param name="gatherEventDetails">Allows the user to provide code to execute synchronously to gather computationally expensive info about the event</param>
 /// <returns>The fault correlation.</returns>
 public static TelemetryEventCorrelation PostFault(this TelemetrySession telemetrySession, string eventName, string description, FaultSeverity faultSeverity, Exception exceptionObject, Func <IFaultUtility, int> gatherEventDetails)
 {
     return(telemetrySession.PostFault(eventName, description, faultSeverity, exceptionObject, gatherEventDetails, null));
 }
Пример #5
0
 /// <summary>
 /// Post a Fault Event with a managed Exception object. The bucket parameters are created from the exception object.
 /// It becomes more useful when correlated with <see cref="T:Coding4Fun.VisualStudio.Telemetry.UserTaskEvent" /> or <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> which may have led to the fault occurence.
 /// </summary>
 /// <param name="telemetrySession"></param>
 /// <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="description"></param>
 /// <param name="faultSeverity">The severity of the fault, used to identify actionable or important faults in divisional tools and reporting.</param>
 /// <param name="exceptionObject"></param>
 /// <returns>The fault event correlation.</returns>
 public static TelemetryEventCorrelation PostFault(this TelemetrySession telemetrySession, string eventName, string description, FaultSeverity faultSeverity, Exception exceptionObject)
 {
     return(telemetrySession.PostFault(eventName, description, faultSeverity, exceptionObject, null));
 }
Пример #6
0
 /// <summary>
 /// Post a Fault Event with a managed Exception object. The bucket parameters are created from the exception object.
 /// It becomes more useful when correlated with <see cref="T:Coding4Fun.VisualStudio.Telemetry.UserTaskEvent" /> or <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> which may have led to the fault occurence.
 /// </summary>
 /// <param name="telemetrySession"></param>
 /// <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="description"></param>
 /// <param name="exceptionObject"></param>
 /// <returns>The fault event correlation.</returns>
 public static TelemetryEventCorrelation PostFault(this TelemetrySession telemetrySession, string eventName, string description, Exception exceptionObject)
 {
     return(telemetrySession.PostFault(eventName, description, FaultSeverity.Uncategorized, exceptionObject));
 }