This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/02/suppressing-application-insights.html | |
// ********************************************** | |
// To register your custom telemetry processor, update the | |
// ConfigureServices on your Startup.cs class adding your custom | |
/// telemetry processor. Ex: SuppressFaviconFilter | |
public void ConfigureServices(IServiceCollection services) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/02/suppressing-application-insights.html | |
// ********************************************** | |
// add this on your Global.asax | |
var builder = TelemetryConfiguration.Active.DefaultTelemetrySink.TelemetryProcessorChainBuilder; | |
builder.Use((next) => new SuppressFaviconFilter(next)); | |
builder.Build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/02/suppressing-application-insights.html | |
// ********************************************** | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.ApplicationInsights.Channel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/03/adding-application-insights-telemetry.html | |
// ********************************************** | |
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] | |
public IActionResult Error() | |
{ | |
// IExceptionHandlerPathFeature requires Microsoft.AspNetCore.Diagnostics | |
// run: dotnet add package Microsoft.AspNetCore.Diagnostics --version 2.2.0 | |
var error = HttpContext.Features.Get<IExceptionHandlerFeature>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/03/adding-application-insights-telemetry.html | |
// ********************************************** | |
public IActionResult Privacy() | |
{ | |
_telemetry.TrackEvent($"Privacy requested @ {DateTime.UtcNow} UTC"); | |
return View(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/03/adding-application-insights-telemetry.html | |
// ********************************************** | |
public class HomeController : Controller | |
{ | |
private readonly ILogger<HomeController> _logger; | |
private readonly TelemetryClient _telemetry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************** | |
// Fore more information, visit: | |
// Blog: https://blog.hildenco.com/2018/08/masstransit-real-alternative-to.html | |
// Source: https://github.com/MassTransit/Sample-Direct | |
// ********************************************** | |
using System; | |
using System.Diagnostics; | |
using System.Threading.Tasks; | |
using Contracts; | |
using MassTransit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************** | |
// Fore more information, visit: | |
// Blog: https://blog.hildenco.com/2018/08/masstransit-real-alternative-to.html | |
// Source: https://github.com/MassTransit/Sample-Direct | |
// ********************************************** | |
using System; | |
using System.Threading.Tasks; | |
using Contracts; | |
using MassTransit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2018/08/masstransit-real-alternative-to.html | |
// ********************************************** | |
using System.Threading; | |
using System.Threading.Tasks; | |
using MassTransit; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; |
NewerOlder