Skip to content

Commit

Permalink
[#151] Improve users.html page by adding percentage of old files
Browse files Browse the repository at this point in the history
  • Loading branch information
pjeli authored Nov 1, 2018
1 parent 07e2769 commit 2a3e68c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/main/resources/public/users.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<div class="jumbotron">
<h1>User Information</h1>
<div id="connection"></div>
<p>
View and compare users on their cluster usage.<br />
</p>
</div>
<div id="userMetrics">
<table id="userDataTable" class="table table-bordered" style="width: 100%;">
Expand All @@ -50,6 +53,7 @@ <h1>User Information</h1>
<th>Dir Count</th>
<th>File Count</th>
<th>Space Used</th>
<th>% Old Files</th>
</tr>
</thead>
</table>
Expand Down Expand Up @@ -82,6 +86,7 @@ <h1>User Information</h1>
innerArray.push(value.numDirs);
innerArray.push(value.numFiles);
innerArray.push(numberWithCommas(value.diskspace));
innerArray.push(getPercentage(value.oldFiles1yr,value.numFiles));
array.push(innerArray);
});
return array
Expand All @@ -106,7 +111,7 @@ <h1>User Information</h1>
},
"iDisplayLength": 100,
"aLengthMenu": [[10, 50, 100, -1], [10, 50, 100, "All"]],
"order": [[1, "desc"]],
"order": [[1, "desc"], [4, "desc"], [5, "desc"]],
"dom": 'Bfrtipl',
"buttons": [
'copyHtml5', 'csvHtml5', 'excelHtml5'
Expand All @@ -121,7 +126,11 @@ <h1>User Information</h1>
{ title: "Last Token" },
{ title: "Dir Count" },
{ title: "File Count" },
{ title: "Space Used" }
{ title: "Space Used" },
{ title: "% Old Files" }
],
"columnDefs": [
{ width: "10%", targets: [1,5] }
]
});
table.draw();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ protected void addFiles(int numOfFiles, long sleepBetweenMs) throws Exception {
if (repFactor != 0) {
fileSystem.setReplication(filePath, repFactor);
}
int weeksAgo = RANDOM.nextInt(10);
int weeksAgo = RANDOM.nextInt(60);
long timeStamp = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(weeksAgo * 7);
if (weeksAgo != 0) {
fileSystem.setTimes(filePath, timeStamp, timeStamp);
Expand Down

0 comments on commit 2a3e68c

Please sign in to comment.