It was staring me in the face in gateway.js.
dbLog.remove({_id:{$lte: ((new Date().getTime())-604800000)}}, {multi:true}, function(err, count){ console.log('Removed ' + count + ' records'); }); //604800000ms = 1 week
I have increased the 1 week (as ms) so hopefully that's all that is needed.
Here are the modifications I've done in index.php for adding the autoscaling.
I'm quite new to javascrip/node.js so that's probably not the best way to do it but it works for me.
index.php:
adding yaxis properties to graphOptions
graphOptions = {
lines: {show: true, steps: true, fill:true },
xaxis: { mode: "time", timezone: "browser", min:graphView.start, max:graphView.end},
yaxis: { min:null, max:null, autoscaleMargin:0.02},
grid: {hoverable: true, clickable: true, backgroundColor: {colors:['#000', '#666']}},
selection: { mode: "x" },
};
and the scaling
socket.on('GRAPHDATAREADY', function(rawData){
graphData = [];
var max = Number.NEGATIVE_INFINITY;
var min = Number.POSITIVE_INFINITY;
var minmax = 0;
LOG('Got ' + rawData.graphData.data.length + ' graph data points...');
//finding the min and max of the dataset
for(var key in rawData.graphData.data) {
graphData.push([rawData.graphData.data[key]._id, rawData.graphData.data[key].v]);
max = Math.max(max, rawData.graphData.data[key].v);
min = Math.min(min, rawData.graphData.data[key].v);
}
//defining the upper and lower margin
minmax=(max-min) * graphOptions.yaxis.autoscaleMargin;
if (min==max) // in case of only one value in the dataset (motion detection)
minmax=graphOptions.yaxis.autoscaleMargin * min;
min -= minmax;
max += minmax;
//set the graph scale properties
graphOptions.xaxis.min = graphView.start;
graphOptions.xaxis.max = graphView.end;
graphOptions.yaxis.min = min;
graphOptions.yaxis.max = max;
graphOptions = $.extend(true, graphOptions, rawData.options); //http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically
//need to defer plotting until after pageshow is finished rendering, otherwise the wrapper will return an incorrect width of "100"
if (metricGraphWrapper.width()==100)
$(document).on("pageshow", "#metricdetails", renderPlot);
else renderPlot();
});
Hope this can help.
modified on 18/09/2015 to match the 06/08/2015 release