marketstore
marketstore copied to clipboard
Adding additional timeframe buckets, is a bit of a process.
I was fooled by the config into thinking I could just enter another entry in the list, but realized this does not actually handle the mappings from these tags.
To solve, I added an entry to Timeframes, and rebuilt my docker image
I thought I was going to need to resend my data into the 1Min bucket for the ondiskagg to populate the new timeslot, but somehow it already did this? Not certain how exactly this magic happens, but that was surprising. ;)
Just posting this idea out here, as it feels like this could be easier, e.g. TimeframeStrings can already be parsed, why not let the buckets be a bit more dynamic?
--- a/utils/timeframe.go
+++ b/utils/timeframe.go
@@ -26,6 +26,7 @@ var timeframeDefs = []Timeframe{
var Timeframes = []*Timeframe{
{"1Min", time.Minute},
{"5Min", 5 * time.Minute},
+ {"10Min", 10 * time.Minute},
{"15Min", 15 * time.Minute},
{"1H", time.Hour},
{"4H", 4 * time.Hour},
Yeah, this list does not make much sense and we should accept any timeframe between 1 sec to years. That change may need a bit more thought though.