Esempio n. 1
0
        public void AddKnownProvider(KnownProviderName name,
                                     EventLevel eventLevel = EventLevel.Informational,
                                     long keywords         = 0, IDictionary <string, string> parameters = null)
        {
            if (!KnownProviders.TryGetName(name, out string knownName))
            {
                throw new Exception($"Unknown provider {knownName}");
            }

            AddProvider(knownName, eventLevel, keywords, parameters);
        }
        public TriggerOnHttpRequests(int processId, int threshold) : base(processId)
        {
            this.Threshold = threshold;

            KnownProviders.TryGetName(
                KnownProviderName.Microsoft_AspNetCore_Hosting, out string aspnetHostingProvider);
            this.AddProvider(aspnetHostingProvider, EventLevel.Informational, 0,
                             new Dictionary <string, string>()
            {
                { "EventCounterIntervalSec", "1" }
            });
        }
Esempio n. 3
0
        public TriggerAll(int processId, string eventSourceName, string eventCounterName)
        {
            _client           = new DiagnosticsClient(processId);
            _eventCounterName = eventCounterName;

            this.AddProvider("System.Runtime",
                             EventLevel.Informational,
                             (long)ClrTraceEventParser.Keywords.None,
                             new Dictionary <string, string>()
            {
                { "EventCounterIntervalSec", "1" }
            });

            if (eventSourceName != null)
            {
                this.AddProvider(eventSourceName, EventLevel.Verbose, -1,
                                 new Dictionary <string, string>()
                {
                    { "EventCounterIntervalSec", "1" }
                });
            }

            this.AddProvider("Microsoft-Windows-DotNETRuntime",
                             EventLevel.Verbose, -1);

            this.AddProvider("Microsoft-DotNETCore-SampleProfiler",
                             EventLevel.Verbose, (long)ClrTraceEventParser.Keywords.All);


            KnownProviders.TryGetName(
                KnownProviderName.Microsoft_AspNetCore_Hosting, out string aspnetHostingProvider);
            this.AddProvider(aspnetHostingProvider, EventLevel.Informational, 0,
                             new Dictionary <string, string>()
            {
                { "EventCounterIntervalSec", "1" }
            });
        }