I'm tracking statistics about requests for this personal project.
Compiling these stats is expensive and affects performance, so I can't just analyze every request. So I have sampling where every X (say 20) request gets analyzed.
The service consuming this data can just assume all the numbers are actually 20x higher, with the caveat that it's super imprecise and there's gaps. There's enough churn with the requests and the type of data I'm collecting that you'll probably see evidence of whatever you're looking for. The numbers will just be fairly useless.
So in addition to the sampling, I have a selective "exact" data collection scheme where the consuming service can set specific criteria for requests where they get full, exact data collection. "get me exact data on requests from this IP address range"
So the consuming service can essentially mark some types of requests as "suspicious" and it'll return exact stats for them.
There's no technical problem here. This code is a comfy, lazy Sunday afternoon project.
But the naming is driving me up the wall. Like conveniently, "sample" is a noun and a verb.
So my sampling function (it gets called on batches of requests) is
RequestFrequencyTable.sample_requests. It gets called with every batch of requests and internally keeps the request modulo counter. I don't know what to name the exact version though. I'm just saying fuck it and calling it
RequestFrequencyTable.exact_requests. I know exact isn't a verb. Anything else is going to irk me more though. I need my metaphors and naming to line up or else I'll be thinking about this tonight when I'm trying to fall asleep.
Idk, I guess I could rename the older sample_requests function.
Technical stuff in programming is fine and dandy. But the real challenge is the autism in naming shit.
I could not continue watching after she praised a paper about feminism in glacier research, putting forward the idea that male researchers climb mountains for bragging rights.
Lol when I was a kid, my dad used to tell me "y'know what people say when they ask why they climb mountains? they say 'because it's there' " and then he'd cackle.
"Because it's there" the most airheaded hippie, "live laugh love" type thing to say. As a joke, I didn't get why it was so funny until I was an adult.