Add disk benchmark tool

This commit is contained in:
Taylor Helsper 2021-10-13 19:15:24 -05:00
parent f663eeb916
commit c7bfc759d7
4 changed files with 35 additions and 1 deletions

View File

@ -113,7 +113,7 @@ if ! skip_base_upgrades ; then
$TORIFY apt-get -y install xorg chromium openbox lightdm openjdk-11-jre libevent-dev ncurses-dev
$TORIFY apt-get -y install libudev-dev libusb-1.0-0-dev python3-venv gunicorn sqlite3 libsqlite3-dev
$TORIFY apt-get -y install torsocks python3-requests libsystemd-dev libjpeg-dev zlib1g-dev psmisc
$TORIFY apt-get -y install hexyl libbz2-dev liblzma-dev netcat-openbsd
$TORIFY apt-get -y install hexyl libbz2-dev liblzma-dev netcat-openbsd hdparm
# Install device specific packages
if [ $IS_X86 = 1 ]; then

View File

@ -186,4 +186,18 @@ def api_toggle_setting():
else:
data["status"] = "unknown_setting"
return jsonify(data)
@mynode_api.route("/api/get_drive_benchmark")
def api_get_drive_benchmark():
check_logged_in()
data = {}
data["status"] = "error"
data["data"] = "UNKNOWN"
try:
data["data"] = subprocess.check_output("hdparm -Tt $(cat /tmp/.mynode_drive)", shell=True)
data["status"] = "success"
except Exception as e:
data["data"] = str(e)
return jsonify(data)

View File

@ -158,6 +158,17 @@
okFunction)
});
$("#run-disk-benchmark").on("click", function() {
$("#run-disk-benchmark").prop("disabled",true);
$("#run-disk-benchmark-results").html("Loading...");
$.get("/api/get_drive_benchmark")
.done(function( data ) {
$("#run-disk-benchmark").prop("disabled",false);
$("#run-disk-benchmark-results").html( data["data"] );
}
);
});
function factoryReset() {
$("#factory_reset_form").submit();
factory_reset_dialog.dialog( "close" );
@ -992,6 +1003,14 @@
<option value="4" {% if swap_size == "4" %}selected="selected"{% endif %}>4 GB</option>
</select>
<button id="swap_button">Save</button>
<div class="divider"></div>
<div class="settings_block_subheader">Benchmark External Drive</div>
Run a disk benchmark on the external storage and see results below.
<br/>
<button id="run-disk-benchmark" class="ui-button ui-widget ui-corner-all settings_button">Run Disk Benchmark</button>
<pre id="run-disk-benchmark-results"></pre>
<div class="divider"></div>

View File

@ -176,6 +176,7 @@ apt-get -y install xorg chromium openbox lightdm openjdk-11-jre libevent-dev ncu
apt-get -y install zlib1g-dev libudev-dev libusb-1.0-0-dev python3-venv gunicorn
apt-get -y install sqlite3 libsqlite3-dev torsocks python3-requests libsystemd-dev
apt-get -y install libjpeg-dev zlib1g-dev psmisc hexyl libbz2-dev liblzma-dev netcat-openbsd
apt-get -y install hdparm
# Install device specific packages
if [ $IS_X86 = 1 ]; then