Skip to content

Instantly share code, notes, and snippets.

View Aaronontheweb's full-sized avatar
🚀
Shipping!

Aaron Stannard Aaronontheweb

🚀
Shipping!
View GitHub Profile
@Aaronontheweb
Aaronontheweb / TcpInstrumentation.cs
Last active April 25, 2025 15:19
.NET OpenTelemetry Metrics for TCP Listeners
// -----------------------------------------------------------------------
// <copyright file="TcpInstrumentation.cs" company="Petabridge, LLC">
// Copyright (C) 2024 - 2024 Petabridge, LLC <https://petabridge.com>
// </copyright>
// -----------------------------------------------------------------------
using System.Net;
using System.Net.NetworkInformation;
using OpenTelemetry.Metrics;
using static OpenTelemetry.TcpInstrumentation.TcpInstrumentationMeter;
@Aaronontheweb
Aaronontheweb / publish_container.yml
Created April 23, 2025 18:57
GitHub Actions `docker compose` Deploy with Tailscale
name: Publish Site to Docker
on:
push:
tags:
- '*'
jobs:
publish-docker:
@Aaronontheweb
Aaronontheweb / program1.fs
Created April 20, 2025 19:14
Falco Static Files
module Program
open Falco
open Falco.Routing
open Microsoft.AspNetCore.Builder
let wapp = WebApplication.Create()
wapp.UseRouting()
.UseDefaultFiles()
@Aaronontheweb
Aaronontheweb / buildwarnings.md
Created March 22, 2025 13:48
Cursor AI prompts for Akka.NET

Akka.NET Build Warning Resolution Procedure

Initial Assessment

  1. Capture full build output:
    dotnet build src/Akka.sln > TestResults/full_build_output.txt
    Use TestResults directory as it's already in .gitignore.

Warning Analysis Checklist

@Aaronontheweb
Aaronontheweb / PlainPartitionedSource.md
Created March 19, 2025 16:40
Akka.Streams.Kafka v1.5.39 Benchmark Results

BenchmarkDotNet v0.14.0, Pop!_OS 22.04 LTS
13th Gen Intel Core i7-1360P, 1 CPU, 16 logical and 12 physical cores
.NET SDK 9.0.100
  [Host]  : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
  LongRun : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2

Job=LongRun  EvaluateOverhead=False  Concurrent=True
Server=True InvocationCount=1 IterationCount=10
@Aaronontheweb
Aaronontheweb / selectasync.linq
Created March 19, 2025 16:06
SelectAsync Akka.NET v1.5.39 Reproduction Attempt
var actorSystem = ActorSystem.Create("Foo");
async Task DoCount(int parallelism, int elements, bool configureAwait)
{
Console.WriteLine($"[{DateTime.UtcNow}] Starting calculation of [{elements}] elements with parallelism [{parallelism}]");
var timer = Stopwatch.StartNew();
var total = await Source.Repeat(1)
.SelectAsync(10, async i =>
{
@Aaronontheweb
Aaronontheweb / PlainPartitionSourceBenchmarks.md
Last active March 18, 2025 13:28
Akka.Streams.Kafka v1.5.39-beta3 benchmark results

BenchmarkDotNet v0.14.0, Pop!_OS 22.04 LTS
13th Gen Intel Core i7-1360P, 1 CPU, 16 logical and 12 physical cores
.NET SDK 9.0.100
  [Host]  : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
  LongRun : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2

Job=LongRun  EvaluateOverhead=False  Concurrent=True
Server=True InvocationCount=1 IterationCount=10
@Aaronontheweb
Aaronontheweb / loadtest.linq
Created November 21, 2024 02:19
LINQPad HTTP Load Testing
async Task Main()
{
// Configuration
const string url = "Your URL here"; // Replace with your URL
const int numberOfRequests = 2000; // Adjust the number of requests as needed
// Data storage
var tasks = new List<Task<RequestResult>>();
// HTTP Client setup
@Aaronontheweb
Aaronontheweb / MaterializedViewBenchmark.cs
Last active September 19, 2024 19:43
MaterializedViewState Serialization
// Note that you must explicitly enable compiler optimizations:
#LINQPad optimize+
void Main()
{
Util.AutoScrollResults = true;
BenchmarkRunner.Run<MaterializedViewStateBenchmarks>();
}
// You can define other methods, fields, classes and namespaces here
@Aaronontheweb
Aaronontheweb / dashboard.json
Created September 4, 2024 20:50
Phobos Experimental OTLP Dashboards (Prometheus Data Source, Grafana Dashboard)
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}