Skip to content

Instantly share code, notes, and snippets.

@flga
flga / odin.py
Last active February 21, 2025 16:16
WIP Odin lldb
import lldb
import math
import traceback
def __lldb_init_module(debugger, dict):
debugger.HandleCommand('type summary add -F odin.string_summary -w odin string')
debugger.HandleCommand('type summary add -F odin.typeid_summary -w odin typeid')
debugger.HandleCommand('type synth add -l odin.TypeidSynth -w odin typeid')
@flga
flga / odin-gdb-pretty-printers.py
Last active January 6, 2025 15:57
GDB pretty printers for Odin types
import gdb
import re
# Set it to true if you're using Microsoft's vscode plugin for c/c++.
# This works around the fact that it doesn't handle "map" display hints properly.
enable_msft_workarounds = False
class OdinAnyPrinter(gdb.ValuePrinter):
"Pretty print Odin any."
@flga
flga / test.odin
Created December 2, 2023 03:25
odin regression c12eb3ec933b2415b5d6ca12e173b1fac8c3c847
package main
import "core:fmt"
import "core:runtime"
import "core:time"
PATH_NODE_LEN :: 64
PathNode :: struct {
len: int,
@flga
flga / caddy_metrics.md
Last active September 22, 2022 00:16
caddy metrics proposal

I've been reading the metrics related issues and I must admit it's a little hard to follow.

Performance and metric quality #4644

We instrument every handler in the chain, this is both expensive and at the same time not that useful for complex setups.

As someone who recently had to configure metrics and dashboards for a caddy instance I was underwhelmed.

The core issue (for me) is that a handler's metrics don't provide much value. On one hand, as was mentioned before, with deep chains they tend to be very redundant, on the other, they're not granular enough - I can see I'm serving N qps on file_server, but, which one?

I posit that there are 2 main use cases for http metrics: