[RRDTool](https://en.wikipedia.org/wiki/RRDtool) matches pretty well with those criteria, and was designed pretty much exactly for the OP's sort of problem.
[RRDTool](https://en.wikipedia.org/wiki/RRDtool) matches pretty well with those criteria, and was designed pretty much exactly for the OP's sort of problem.