• Facebook
  • Twitter
  • Youtube
  • LinedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Download
  • Contact Us
Download
Show / Hide Table of Contents

Trace Events

Event Tracing is a high-speed logging facility used by operating systems and applications to capture system and software activity in real time. It allows developers and administrators to monitor software behavior, diagnose bugs, and analyze performance bottlenecks with minimal impact on system resources. Essentially, you can opt for Event Tracing over Logging when you need to analyze complex execution flows, capture precise timing, or understand system-wide causality, i.e., how an action moves through a complex system. Additionally, event tracing is very fast and has very little performance overhead.

In Event Tracing, a process represents the running application or service that produces specific trace events. Within that process, a source acts as a trace or event provider and typically represents a specific component, module, or subsystem responsible for emitting events. Each event generated by a source is recorded as a trace, which captures diagnostic details such as the event message, timestamp, severity level, event ID, and any related runtime information needed for monitoring, troubleshooting, or analysis. However, these traces are not generated unless there is a dedicated listener.

NCache provides this option across multiple configuration areas such as cache, client and service processes. The following is a complete list of the event sources available for this purpose:

  • Alachisoft.NCache.Client
  • Alachisoft.NCache.Caching/ClientCache
  • Alachisoft.NCache.Client/Continuous Queries
  • Alachisoft.NCache.Client/Messaging
  • Alachisoft.NCache.Client/QueryIndex
  • Alachisoft.NCache.Client/CacheEvent
  • Alachisoft.NCache.Cache/QueryIndex
  • Alachisoft.NCache.Cache/StateTransfer
  • Alachisoft.NCache.Caching/CacheEvent
  • Alachisoft.NCache.SocketServer
  • Alachisoft.NCache.Cache/Messaging

The concept is primarily recognized as Event Tracing for Windows (ETW), which is deeply integrated into the Windows OS and serves as a collection mechanism for these traces, though similar event tracing mechanisms also exist in Linux such as EventPipe. After configuring Event Tracing, you can use PerfView or dotnet-trace on Windows, and dotnet-trace on Linux to collect traces.

This page demonstrates using Event Tracing for Alachisoft.NCache.Cache/StateTransfer on Windows and Linux.

Note

ETW requires more OS privileges and is thus more powerful as compared to EventPipe.

How to Enable Event Tracing

  • Windows
  • Linux

Step 1: Download & Install PerfView

  • Download PerfView.
  • Run the executable file and accept the EULA agreement. The PerfView welcome screen will appear.

PerfView Welcome Screen

  • Click Collect. A Windows permission prompt will appear asking whether you want to allow the application to make changes to your device. Click Yes to continue. This opens the initial collection screen.

PerfView Initial Collection Screen

Step 2: Set Up & Start Collection

  • On the collection screen, click Advanced Options. In the Additional Providers field, specify the required provider. For example:
Alachisoft.NCache.Cache/StateTransfer
Note

You can add multiple providers using a comma separated list.

Then, click Start Collection.

PerfView Setting Up Data Collection

Step 3: Analyze Collection

  • The lower-right corner of the main PerfView window displays the collection status. When you have captured the required trace data, click Stop Collection. After a few moments, PerfView creates an .etl.zip file that can be opened and analyzed in PerfView.

PerfView ZIP File

  • Open the generated trace file in PerfView, expand the folder, and click Events. You can then filter the results and select a specific event to view, as shown below.

PerfView Event View

Step 1: Download & Install PerfView

Note

dotnet-trace is a CLI-based tool. To collect traces, you may need two terminals: one to run or monitor the target process, and another to execute the tracing command.

Important

Unlike ETW-based tracing, EventPipe requires the process ID of the running .NET process you want to trace.

  • Download dotnet-trace using the following command:
curl -L https://aka.ms/dotnet-trace/linux-x64 -o dotnet-trace
  • Make the downloaded file executable:
chmod +x dotnet-trace
  • Verify that dotnet-trace is available:
./dotnet-trace --version

Step 2: Set Up & Start Collection

  • List the running .NET processes to identify the required process ID:
./dotnet-trace ps
  • Start collecting traces by specifying the process ID and the required provider. For example:
./dotnet-trace collect -p 250 --providers Alachisoft.NCache.Cache/StateTransfer
Note

You can add multiple providers using a comma separated list.

Important

Replace 250 with the actual process ID returned by dotnet-trace ps.

Step 3: Analyze Collection

  • When you have collected enough trace data, press Ctrl+C to stop the collection. dotnet-trace creates a .nettrace file in the current directory.

  • You can locate the generated trace file using the following command:

ls
  • The .nettrace file can then be copied to a Windows system and opened in PerfView for analysis. The file can be analyzed directly on Linux as well, however, PerfView on Windows is more human readable.

See Also

NCache Counters
Monitor Caches using NCache Management Center
Test-Stress PowerShell Reference

Contact Us

PHONE

+1 214-619-2601   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top