/// <inheritdoc/>
        public void OnRequestPrediction(RequestPredictionTelemetryData telemetryData)
        {
            PostTelemetryData(telemetryData);

#if TELEMETRY_TRACE && DEBUG
            System.Diagnostics.Trace.WriteLine("Recording RequestPrediction");
#endif
        }
Example #2
0
        /// <inheritdoc/>
        public virtual void OnRequestPrediction(RequestPredictionTelemetryData telemetryData)
        {
            RequestId = Guid.NewGuid().ToString();

            PostTelemetryData(telemetryData);

#if TELEMETRY_TRACE && DEBUG
            System.Diagnostics.Trace.WriteLine("Recording RequestPrediction");
#endif
        }
Example #3
0
        /// <summary>
        /// Sends the telemetry with the commands for prediction.
        /// </summary>
        private void SendTelemetry(RequestPredictionTelemetryData telemetryData)
        {
            _userAcceptedAndSuggestion.Clear();

            var properties = CreateProperties(telemetryData);

            properties.Add("Command", telemetryData.Commands ?? string.Empty);
            properties.Add("HttpRequestSent", telemetryData.HasSentHttpRequest.ToString(CultureInfo.InvariantCulture));
            properties.Add("Exception", telemetryData.Exception?.ToString() ?? string.Empty);

            _telemetryClient.TrackEvent($"{AzPredictorTelemetryClient.TelemetryEventPrefix}/RequestPrediction", properties);
        }
        /// <summary>
        /// Sends the telemetry with the commands for prediction.
        /// </summary>
        private void SendTelemetry(RequestPredictionTelemetryData telemetryData)
        {
            _userAcceptedAndSuggestion.Clear();

            var properties = CreateProperties(telemetryData, telemetryData.Client);

            properties.Add("Command", telemetryData.Commands == null ? string.Empty : string.Join(AzPredictorConstants.CommandConcatenator, telemetryData.Commands));
            properties.Add("HttpRequestSent", telemetryData.HasSentHttpRequest.ToString(CultureInfo.InvariantCulture));
            properties.Add("Exception", AzPredictorTelemetryClient.FormatException(telemetryData.Exception));

            SendTelemetry($"{TelemetryUtilities.TelemetryEventPrefix}/RequestPrediction", properties);
        }
        /// <inheritdoc/>
        public virtual void OnRequestPrediction(RequestPredictionTelemetryData telemetryData)
        {
            // OnRequestPrediction may be running as a task on a different thread, or it's not triggerred at all because the history isn't changed,
            // regardless, we only update the correlation id when that happens.
            // If correlation id isn't updated, that's the same as the prediction used for suggestion isn't updated yet.
            // The correlation id should be to correlate the prediction from the server and the suggestions presented to the user.
            CorrelationId = Guid.NewGuid().ToString();

            PostTelemetryData(telemetryData);

#if TELEMETRY_TRACE && DEBUG
            System.Diagnostics.Trace.WriteLine("Recording RequestPrediction");
#endif
        }
Example #6
0
        /// <inheritdoc/>
        public void OnRequestPrediction(RequestPredictionTelemetryData telemetryData)
        {
            if (!IsDataCollectionAllowed())
            {
                return;
            }

            CorrelationId = Guid.NewGuid().ToString();

            telemetryData.SessionId     = SessionId;
            telemetryData.CorrelationId = CorrelationId;

            _telemetryDispatcher.Post(telemetryData);

#if TELEMETRY_TRACE && DEBUG
            System.Diagnostics.Trace.WriteLine("Recording RequestPrediction");
#endif
        }