Esempio n. 1
0
        /// <summary>
        /// Start tracking operation by posting a <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> with specified properties at the begining of operation work,
        /// and return a <see cref="T:Coding4Fun.VisualStudio.Telemetry.TelemetryScope`1" /> object.
        /// When the user task finishes, call method <see cref="M:Coding4Fun.VisualStudio.Telemetry.TelemetryScope`1.End(Coding4Fun.VisualStudio.Telemetry.TelemetryResult,System.String)" /> to post another <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> for end point.
        /// Because the same event name is used by both start and end events, please don't use Start or End in event name.
        /// </summary>
        /// <param name="session">Telemetry Session</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="severity">
        /// A severity level of the event.
        /// The level is used for event consumer (e.g., ETW provider, backend reporting) to organize data easier.
        /// </param>
        /// <param name="startEventProperties">
        /// Event properties for the start event of this scope. They are also copied to end event.
        /// </param>
        /// <param name="correlations">Events with which this scope can correlate.</param>
        /// <returns><see cref="T:Coding4Fun.VisualStudio.Telemetry.TelemetryScope`1" /> instance.</returns>
        public static TelemetryScope <OperationEvent> StartOperation(this TelemetrySession session, string eventName, TelemetrySeverity severity, IDictionary <string, object> startEventProperties, TelemetryEventCorrelation[] correlations)
        {
            TelemetryScopeSettings settings = new TelemetryScopeSettings
            {
                Severity             = severity,
                StartEventProperties = startEventProperties,
                Correlations         = correlations
            };

            return(session.StartOperation(eventName, settings));
        }
Esempio n. 2
0
 /// <summary>
 /// Start tracking operation by posting a <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> with specified properties at the begining of operation work,
 /// and return a <see cref="T:Coding4Fun.VisualStudio.Telemetry.TelemetryScope`1" /> object.
 /// When the user task finishes, call method <see cref="M:Coding4Fun.VisualStudio.Telemetry.TelemetryScope`1.End(Coding4Fun.VisualStudio.Telemetry.TelemetryResult,System.String)" /> to post another <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> for end point.
 /// Because the same event name is used by both start and end events, please don't use Start or End in event name.
 /// </summary>
 /// <param name="session">Telemetry Session</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="severity">
 /// A severity level of the event.
 /// The level is used for event consumer (e.g., ETW provider, backend reporting) to organize data easier.
 /// </param>
 /// <param name="startEventProperties">
 /// Event properties for the start event of this scope. They are also copied to end event.
 /// </param>
 /// <returns><see cref="T:Coding4Fun.VisualStudio.Telemetry.TelemetryScope`1" /> instance.</returns>
 public static TelemetryScope <OperationEvent> StartOperation(this TelemetrySession session, string eventName, TelemetrySeverity severity, IDictionary <string, object> startEventProperties)
 {
     return(session.StartOperation(eventName, severity, startEventProperties, null));
 }
Esempio n. 3
0
 /// <summary>
 /// Start tracking operation by posting a <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> at the begining of operation work, and return a <see cref="T:Coding4Fun.VisualStudio.Telemetry.TelemetryScope`1" /> object.
 /// When the user task finishes, call method <see cref="M:Coding4Fun.VisualStudio.Telemetry.TelemetryScope`1.End(Coding4Fun.VisualStudio.Telemetry.TelemetryResult,System.String)" /> to post another <see cref="T:Coding4Fun.VisualStudio.Telemetry.OperationEvent" /> for end point.
 /// Because the same event name is used by both start and end events, please don't use Start or End in event name.
 /// </summary>
 /// <param name="session">Telemetry Session</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="severity">
 /// A severity level of the event.
 /// The level is used for event consumer (e.g., ETW provider, backend reporting) to organize data easier.
 /// </param>
 /// <returns><see cref="T:Coding4Fun.VisualStudio.Telemetry.TelemetryScope`1" /> instance.</returns>
 public static TelemetryScope <OperationEvent> StartOperation(this TelemetrySession session, string eventName, TelemetrySeverity severity)
 {
     return(session.StartOperation(eventName, severity, null, null));
 }