While thinking about how to combine latency measurement with diagnostic events in the DHCP server, I noticed a particular gap in the design. Right now the event interfaces look like this: However, if we want to incorporate latency metrics, we…
Low-latency latency measurement
Measuring latency is easy with .NET. Just use a Stopwatch! This is certainly the most commonly recommended way to measure operational timings. But is it the fastest way? It seems almost absurd to ask for a low-latency latency measurement, but…
Let’s do DHCP: diagnostic events
There is always something new to do with the DHCP server sample. Today we will look at how to add diagnostic events. After all, any good server technology intended to run in real world production scenarios needs observability. One approach…
EventSource and Span: take 3
Previously, we determined that mixing EventSource and Span is costly. Now it’s just a matter of finding the lowest cost. The last approach used an ArrayPool for all ETW strings. But remember that ETW events are capped at 64 KB.…
EventSource and Span: take 2
Last time, we talked about how EventSource and Span don’t really mix. ETW wants a null-terminated string for tracing and Span isn’t set up for that. It turns out this null terminator issue has been explored in some depth by…
EventSource and Span: take 1
Let’s say you’re living the zero-allocation, universal memory .NET life, and you need to trace some char data. The only problem is that you have a Span<char> and EventSource only supports string. What to do? We’ll start with a typical…
Tasks do scale (well enough)
I’ve said it before and I’ll say it again: threads don’t scale. But what about Tasks? Here is a simple application which spawns a large (configurable) amount of periodic background tasks: The tasks themselves are technically CPU bound, though they…
Design for disaster: the small stuff
Is your system designed with disaster recovery in mind? There are obvious things like taking backups of state (and maybe validating them, too) and configuring geo-replication to mitigate the effects of regional outages. But what about the more subtle aspects…
Log once, throw many
In my list of unsavory exception practices, I mentioned logging overload as a common issue. It often arises in code like this: We can see that some of the individual actions have exception logging, but so does the entire outer…
EventSource and rich payload data
Long ago, I wrote about EventSource, the simple and modern ETW-based tracing solution for .NET 4.5+. Much to the diagnosticians’ delight, EventSource continues to evolve in .NET 4.6. Check out Vance Morrison’s post describing the useful new “rich payload data”…