skip to content
Relatively General .NET

Listing all available ETW events in a .NET application

by Gérald Barré

posted on: April 03, 2023

When tracing an application, it can be useful to know which ETW events are available. .NET exposes many events to trace an application as shown in some previous posts (Getting telemetry data from inside or outside a .NET application, or Avoid DNS issues with HttpClient in .NET). It's hard to know w

Tricks of the trade: Figuring out progress of a large upload

by Oren Eini

posted on: March 31, 2023

I found myself today needing to upload a file to S3, the upload size is a few hundred GBs in size. I expected the appropriate command, like so: aws s3api put-object --bucket twitter-2020-rvn-dump --key mydb.backup --body ./mydb.backup But then I realized that this is uploading a few hundred GB file to S3, which may take a while. The command doesn’t have any progress information, so I had no way to figure out where it is at. I decided to see what I can poke around to find, first, I ran this command: ps -aux | grep s3api This gave me the PID of the upload process in question. Then I checked the file descriptors for this process, like so: $ ls -alh /proc/84957/fd total 0dr-x------ 2 ubuntu ubuntu  0 Mar 30 08:10 .dr-xr-xr-x 9 ubuntu ubuntu  0 Mar 30 08:00 ..lrwx------ 1 ubuntu ubuntu 64 Mar 30 08:10 0 -> /dev/pts/8lrwx------ 1 ubuntu ubuntu 64 Mar 30 08:10 1 -> /dev/pts/8lrwx------ 1 ubuntu ubuntu 64 Mar 30 08:10 2 -> /dev/pts/8lr-x------ 1 ubuntu ubuntu 64 Mar 30 08:10 3 -> /backups/mydb.backup As you can see, we can tell that file descriptor#3 is the one that we care about, then we can ask for more details: $ cat /proc/84957/fdinfo/3 pos: 140551127040 flags: 02400000 mnt_id: 96 ino: 57409538 In other words, the process is currently at ~130GB of the file or there about. It’s not ideal, but it does give me some idea about where we are at. It is a nice demonstration of the ability to poke into the insides of a running system to figure out what is going on.

Storing information in its highest form

by Vladimir Khorikov

posted on: March 29, 2023

There’s an interesting guideline I’ve been meaning to write about for a long time. I call it Storing information in its highest form.

Handling CancelKeyPress using a CancellationToken

by Gérald Barré

posted on: March 27, 2023

You sometimes need to detect when a console application is closing to perform some cleanup. Console.CancelKeyPress allows registering a callback when a user press Ctrl+C or Ctrl+Break. This event can prevent the application from closing, so you can take a few seconds to perform the cleanup before a

RavenDB 6.0 live instance is now up & running: Come test it out!

by Oren Eini

posted on: March 21, 2023

RavenDB has the public live test instance, and we have recently upgraded that to version 6.0.  That means that you can start playing around with RavenDB 6.0 directly, including giving us feedback on any issues that you find. Of particular interest, of course, is the sharding feature, it is right here: And once enabled, you can see things in more details: If we did things properly, the only thing you’ll notice that indicates that you are running in sharded mode is: Take a look, and let us know what you think. As a reminder, at the top right of the page, there is the submit feedback option: Use it, we are waiting for your insights.

Too many timers in .NET?

by Gérald Barré

posted on: March 20, 2023

There are at least 6 different timers classes in .NET! Each timer has its purpose and use-case. I will try to explain the differences between them.First, there are UI-specific timers. These timers are used to execute code on the UI thread. They are:System.Windows.Forms.TimerSystem.Windows.Threading

Working with Git in JetBrains Rider

by Andrew Lock

posted on: March 14, 2023

In this post, I describe how I work day-to-day with Git using JetBrains' Rider, working exclusively with keyboard shortcuts, but with the benefits of a GUI…