Just some general updates to bots and such

This commit is contained in:
RussellChamp committed 2017-08-04 12:06:58 +00:00
1 parent d9eac44b35
commit c89ac52460
9 files changed
+91 -26

No files matched your search

+14 -4
View File
@@ -4,11 +4,21 @@
<div>
<select id="series">
<option value="">Today</option>
<option value="_2017_07">Jul 2017</option>
<option value="_2017_06">Jun 2017</option>
<option value="_2017_06">Jun 2017</option>
<option value="_2017_05">May 2017</option>
<option value="_2017_04">Apr 2017</option>
<option value="_2017_03">Mar 2017</option>
<option value="_2017_02">Feb 2017</option>
<option value="_2017_01">Jan 2017</option>
<option value="_2016_12">Dec 2016</option>
<option value="_2016_11">Nov 2016</option>
<option value="_2016_10">Oct 2016</option>
<option value="_2016_09">Sep 2016</option>
<option value="_2016_08">Aug 2016</option>
<option value="_2016_07">July 2016</option>
<option value="_2016_06">June 2016</option>
<option value="_2016_07">Jul 2016</option>
<option value="_2016_06">Jun 2016</option>
<option value="_2016_05">May 2016</option>
<option value="_2016_04">Apr 2016</option>
<option value="_2016_03">Mar 2016</option>
@@ -19,8 +29,8 @@
<option value="_2015_10">Oct 2015</option>
<option value="_2015_09">Sep 2015</option>
<option value="_2015_08">Aug 2015</option>
<option value="_2015_07">July 2015</option>
<option value="_2015_06">June 2015</option>
<option value="_2015_07">Jul 2015</option>
<option value="_2015_06">Jun 2015</option>
<option value="_2015_05">May 2015</option>
<option value="_2015_04">Apr 2015</option>
<option value="_2015_03">Mar 2015</option>
+27 -3
View File
@@ -21,7 +21,6 @@
data.addColumn('number', 'Disk Usage');
data.addColumn('number', 'File Count');
var pieoptions = {
title: 'Tilder Disk Usage',
subtitle: 'in kb',
@@ -48,15 +47,39 @@
//Draw LineChart
linedata.addColumn('date', 'Date');
var userData = {};
var userInterest = {};
var cutoffDate = new Date(); cutoffDate.setMonth(cutoffDate.getMonth() - 6); cutoffDate = cutoffDate.getTime() / 1000; //the last 3 months
var cutoffDate = new Date(); cutoffDate.setMonth(cutoffDate.getMonth() - 6); cutoffDate = cutoffDate.getTime() / 1000; //the last 3 monthsa
var interestQuotent = 0.005;
_.forEach(json, function(set, idx) { //generate the 'interest quotent' for each user as a value of change
if(set.date < cutoffDate) return;
_.forEach(set.data, function(point) {
if(!userInterest[point.user]) {
userInterest[point.user] = { absChange: 0, lastValue: point.du, count: 1 };
} else {
userInterest[point.user].absChange = userInterest[point.user].absChange
+ Math.abs(point.du - userInterest[point.user].lastValue) / userInterest[point.user].lastValue;
userInterest[point.user].lastValue = point.du;
userInterest[point.user].count = userInterest[point.user].count + 1;
}
})
})
function isInteresting(point) {
if($("#onlyInteresting").is(":checked")) {
return userInterest[point.user].absChange / userInterest[point.user].count > interestQuotent;
} else {
return point.du > 5000; //the 'interesting' threshold is set at 5000kb
}
}
_.forEach(json, function(set, idx) {
//only display 1/8 the points. (every 2 days instead of every 6 hours) page is loading too slow
//maybe i could add something to show more points but we're not losing too much granularity for the speed we gain
if(idx % 4 != 0 || set.date < cutoffDate) return;
_.forEach(set.data, function(point) {
if(point.du > 5000) { //the 'interesting' threshold is set at 5000kb
if(isInteresting(point)) {
if(!userData[point.user]) { //if the current user has not been initialized yet
userData[point.user] = []; //create an empty array
var size = json.length;
@@ -89,5 +112,6 @@
</script>
<body>
<div id="donutchart" style="width: 700px; height: 400px;"></div>
<input id="onlyInteresting" type="checkbox" onClick="drawCharts()">Only Interesting Data</input>
<div id="linechart" style="width: 120%; height: 130%; margin-left: -10%"></div>
</body>