Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#151] Improve users.html page by adding percentage of old files #155

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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