Esempio n. 1
0
        private BMCounterSource() : base(EventSourceSettings.EtwSelfDescribingEventFormat)
        {
            // Counter names should ideally be the same length, so I'm naming them with number-suffix.
            this.m_eventCounter = new EventCounter("BenchmarkCounter1", this)
            {
                // Same thing for these fields
                DisplayName  = "ADisplayName",
                DisplayUnits = "MSec"
            };

            this.m_pollingCounter = new PollingCounter("BenchmarkCounter2", this, () => 1)
            {
                DisplayName  = "ADisplayName",
                DisplayUnits = "MSec"
            };

            this.m_incrementingEventCounter = new IncrementingEventCounter("BenchmarkCounter3", this)
            {
                DisplayName  = "ADisplayName",
                DisplayUnits = "MSec"
            };

            this.m_incrementingPollingCounter = new IncrementingPollingCounter("BenchmarkCounter4", this, () => 1)
            {
                DisplayName  = "ADisplayName",
                DisplayUnits = "MSec"
            };
        }
Esempio n. 2
0
 public SimpleEventSource(string _displayName, string _displayUnits)
 {
     _myCounter = new IncrementingEventCounter("test-counter", this)
     {
         DisplayName = _displayName, DisplayUnits = _displayUnits, DisplayRateTimeScale = new TimeSpan(0, 0, 1)
     };
 }
Esempio n. 3
0
 private FileOperationEventSource() : base(EventSourceSettings.EtwSelfDescribingEventFormat)
 {
     ActiveFolderOperationCounter = new IncrementingEventCounter("active-folder-operations", this)
     {
         DisplayName  = "# of operations in the folder",
         DisplayUnits = "count"
     };
     TotalFolderOperationCounter = new PollingCounter("total-folder-operations",
                                                      this, () => Interlocked.Read(ref totalFolderOperationsCount))
     {
         DisplayName = "# of operations in the folder (total)",
     };
 }
Esempio n. 4
0
 private PerfCounters()
 {
     _messagesActive      = new PollingCounter("messages-active", this, () => _messagesActiveCount);
     _messagesFailedTotal = new PollingCounter("messages-failed-total", this, () => _messagesErrorTotalCount);
     _messageTime         = new EventCounter("message-time", this);
     _messagesAttemtped   = new IncrementingEventCounter("messages-attempted", this);
     _sagaBlocks          = new IncrementingEventCounter("saga-blocks", this);
     _messageRetries      = new IncrementingEventCounter("messages-retry", this);
     _messagesFailed      = new IncrementingEventCounter("messages-failed", this);
     _messagesComplete    = new IncrementingEventCounter("messages-complete", this);
     _messagesSent        = new IncrementingEventCounter("messages-sent", this);
     _messagesDelayed     = new IncrementingEventCounter("messages-delayed", this);
 }
        protected override void OnEventCommand(EventCommandEventArgs command)
        {
            if (command.Command == EventCommand.Enable)
            {
                _scanInvocationCounter = new IncrementingEventCounter("scan-invocations", this)
                {
                    DisplayName          = "Scan Invocations",
                    DisplayRateTimeScale = TimeSpan.FromSeconds(1)
                };

                _scanInvocationDurationCounter = new EventCounter("scan-invocation-duration", this)
                {
                    DisplayName  = "Scan Duration",
                    DisplayUnits = "ms"
                };

                _scanEntriesFoundCounter = new IncrementingEventCounter("scan-entries-count", this)
                {
                    DisplayName          = "Scan XML Count",
                    DisplayUnits         = "Entries",
                    DisplayRateTimeScale = TimeSpan.FromSeconds(1)
                };
            }
        }
Esempio n. 6
0
 public CustomEventSource() : base(nameof(CustomEventSource))
 {
     _rng     = new Random();
     _counter = new IncrementingEventCounter(CounterName, this);
     _gauge   = new EventCounter(GaugeName, this);
 }
Esempio n. 7
0
 public Log()
 {
     _messagesReceived   = new IncrementingEventCounter("MessagesReceived", this);
     _partitionsAssigned = new EventCounter("PartitionsAssigned", this);
 }
Esempio n. 8
0
 public ProtoEventSource()
 {
     _cacheHits   = new IncrementingEventCounter("CacheHits", this);
     _cacheMisses = new IncrementingEventCounter("CacheMisses", this);
 }
Esempio n. 9
0
 public SampleEventHostedService(SampleEventSource eventSource)
 {
     m_Counter = new IncrementingEventCounter("test-incrementing", eventSource);
 }