Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.MetricsEventManager.LogEvent C# (CSharp) Method

LogEvent() public method

public LogEvent ( string eventName ) : void
eventName string
return void
        public void LogEvent(string eventName)
        {
            if (string.IsNullOrEmpty(eventName))
            {
                throw new ArgumentNullException(nameof(eventName));
            }

            QueuedEvents.AddOrUpdate(eventName,
                (name) =>
                {
                    // create the default event that will be added
                    // if an event isn't already queued for this event name
                    return new SystemMetricEvent
                    {
                        EventName = eventName.ToLowerInvariant(),
                        Count = 1
                    };
                },
                (name, evtToUpdate) =>
                {
                    // update the existing event
                    evtToUpdate.Count++;

                    return evtToUpdate;
                });
        }

Usage Example

Esempio n. 1
0
 public void LogEvent(string eventName, string functionName = null)
 {
     _metricsEventManager.LogEvent(eventName, functionName);
 }
All Usage Examples Of Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.MetricsEventManager::LogEvent