AzurePSQoSEvent.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
    public override string ToString()
    {
        return string.Format(
            "AzureQoSEvent: CommandName - {0}; IsSuccess - {1}; Duration - {2}; Exception - {3};",
            CommandName, IsSuccess, Duration, Exception);
    }
}

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Invoke this method when the cmdlet is completed or terminated.
        /// </summary>
        protected void LogQosEvent(bool waitForMetricSending = false)
        {
            if (QosEvent == null)
            {
                return;
            }

            QosEvent.FinishQosEvent();

            if (!IsUsageMetricEnabled && (!IsErrorMetricEnabled || QosEvent.IsSuccess))
            {
                return;
            }

            if (!IsDataCollectionAllowed())
            {
                return;
            }

            WriteDebug(QosEvent.ToString());

            try
            {
                MetricHelper.LogQoSEvent(QosEvent, IsUsageMetricEnabled, IsErrorMetricEnabled);
                MetricHelper.FlushMetric(waitForMetricSending);
                WriteDebug("Finish sending metric.");
            }
            catch (Exception e)
            {
                //Swallow error from Application Insights event collection.
                WriteWarning(e.ToString());
            }
        }
All Usage Examples Of AzurePSQoSEvent::ToString