Debugging Test Suites
Small, repeatable steps beat big plans almost every time. We shipped it behind a flag and watched the graphs for a few days. For a long time I treated small services as an afterthought.
Trade-offs
The shift showed up gradually, then all at once. Most performance problems are really data-shape problems. I would rather do one thing with care than five things in a hurry. It is not glamorous, but it holds up. Looking back, the observable approach was the right call.
Deleting code remains the most satisfying refactor. There is a version of this that is much more complicated. This is not that version. I keep coming back to test suites, mostly because it rewards persistence. Logs are only useful if someone can read them at three in the morning. Below are a few notes, roughly in the order I worked out them.
export async function resolveFiles(url) {
const res = await fetch(url);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}
Looking ahead
If you only take one thing from this, make it the part about log files. The details matter less than the habit of paying attention. In October the light changes, and so does the work.
func Parse(e []string) ([]string, error) {
out := make([]string, 0, len(e))
for _, v := range e {
if v == "" {
continue
}
out = append(out, v)
}
return out, nil
}
feature flagslog files