Skip to content

Commit

Permalink
Added Loop Counter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ace-Krypton committed Aug 9, 2023
1 parent 0f947a4 commit 612cbfa
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 37 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 11.0.0, 2023-08-08T19:43:47. -->
<!-- Written by QtCreator 11.0.0, 2023-08-09T00:00:55. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
24 changes: 16 additions & 8 deletions include/builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ class Builder : public QObject {
public:
explicit Builder(QObject *parent = nullptr);

Q_INVOKABLE void seq1mq8t1_read(const QString &size, Benchmark *benchmark, bool is_all);
Q_INVOKABLE void seq1mq8t1_write(const QString &size, Benchmark *benchmark, bool is_all);
Q_INVOKABLE void seq128Kq8t1_read(const QString &size, Benchmark *benchmark, bool is_all);
Q_INVOKABLE void seq128Kq8t1_write(const QString &size, Benchmark *benchmark, bool is_all);
Q_INVOKABLE void rnd4kq32t1_read(const QString &size, Benchmark *benchmark, bool is_all);
Q_INVOKABLE void rnd4kq32t1_write(const QString &size, Benchmark *benchmark, bool is_all);
Q_INVOKABLE void rnd4kq1t1_read(const QString &size, Benchmark *benchmark, bool is_all);
Q_INVOKABLE void rnd4kq1t1_write(const QString &size, Benchmark *benchmark, bool is_all);
Q_INVOKABLE void seq1mq8t1_read(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all);
Q_INVOKABLE void seq1mq8t1_write(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all);
Q_INVOKABLE void seq128Kq8t1_read(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all);
Q_INVOKABLE void seq128Kq8t1_write(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all);
Q_INVOKABLE void rnd4kq32t1_read(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all);
Q_INVOKABLE void rnd4kq32t1_write(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all);
Q_INVOKABLE void rnd4kq1t1_read(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all);
Q_INVOKABLE void rnd4kq1t1_write(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all);
};
25 changes: 13 additions & 12 deletions qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ApplicationWindow {
seq1MWrite = ""
isBenchmarkingInProgress = true
builder.seq1mq8t1_read(parseInt(comboGiB.currentText.match(/\d+/)[0]),
benchmark, true)
combo.currentText, benchmark, true)
}

Connections {
Expand All @@ -65,7 +65,7 @@ ApplicationWindow {
function onSeq1MReadFinished(bandwidth, is_all) {
window.seq1MRead = bandwidth
builder.seq1mq8t1_write(parseInt(comboGiB.currentText.match(/\d+/)[0]),
benchmark, is_all)
combo.currentText, benchmark, is_all)
}

function onSeq1MWriteFinished(bandwidth, is_all) {
Expand All @@ -75,7 +75,8 @@ ApplicationWindow {
seq128KRead = ""
seq128KWrite = ""
builder.seq128Kq8t1_read(parseInt(comboGiB.currentText.match(
/\d+/)[0]), benchmark, is_all)
/\d+/)[0]), combo.currentText,
benchmark, is_all)
} else {
isBenchmarkingInProgress = false
}
Expand All @@ -84,7 +85,7 @@ ApplicationWindow {
function onSeq128KReadFinished(bandwidth, is_all) {
window.seq128KRead = bandwidth
builder.seq128Kq8t1_write(parseInt(comboGiB.currentText.match(/\d+/)[0]),
benchmark, is_all)
combo.currentText, benchmark, is_all)
}

function onSeq128KWriteFinished(bandwidth, is_all) {
Expand All @@ -94,7 +95,7 @@ ApplicationWindow {
rand4KQ32T1Read = ""
rand4KQ32T1Write = ""
builder.rnd4kq32t1_read(parseInt(comboGiB.currentText.match(/\d+/)[0]),
benchmark, is_all)
combo.currentText, benchmark, is_all)
} else {
isBenchmarkingInProgress = false
}
Expand All @@ -103,7 +104,7 @@ ApplicationWindow {
function onRand4KQ32T1ReadFinished(bandwidth, is_all) {
window.rand4KQ32T1Read = bandwidth
builder.rnd4kq32t1_write(parseInt(comboGiB.currentText.match(/\d+/)[0]),
benchmark, is_all)
combo.currentText, benchmark, is_all)
}

function onRand4KQ32T1WriteFinished(bandwidth, is_all) {
Expand All @@ -113,7 +114,7 @@ ApplicationWindow {
rand4KQ1T1Read = ""
rand4KQ1T1Write = ""
builder.rnd4kq1t1_read(parseInt(comboGiB.currentText.match(/\d+/)[0]),
benchmark, is_all)
combo.currentText, benchmark, is_all)
} else {
isBenchmarkingInProgress = false
}
Expand All @@ -122,7 +123,7 @@ ApplicationWindow {
function onRand4KQ1T1ReadFinished(bandwidth, is_all) {
window.rand4KQ1T1Read = bandwidth
builder.rnd4kq1t1_write(parseInt(comboGiB.currentText.match(/\d+/)[0]),
benchmark, is_all)
combo.currentText, benchmark, is_all)
}

function onRand4KQ1T1WriteFinished(bandwidth, is_all) {
Expand Down Expand Up @@ -603,7 +604,7 @@ ApplicationWindow {
isBenchmarkingInProgress = true
builder.seq1mq8t1_read(parseInt(comboGiB.currentText.match(
/\d+/)[0]),
benchmark, false)
combo.currentText, benchmark, false)
}
}
}
Expand Down Expand Up @@ -688,7 +689,7 @@ ApplicationWindow {
isBenchmarkingInProgress = true
builder.seq128Kq8t1_read(
parseInt(comboGiB.currentText.match(/\d+/)[0]),
benchmark, false)
combo.currentText, benchmark, false)
}
}
}
Expand Down Expand Up @@ -771,7 +772,7 @@ ApplicationWindow {
isBenchmarkingInProgress = true
builder.rnd4kq32t1_read(parseInt(comboGiB.currentText.match(
/\d+/)[0]),
benchmark, false)
combo.currentText, benchmark, false)
}
}
}
Expand Down Expand Up @@ -854,7 +855,7 @@ ApplicationWindow {
isBenchmarkingInProgress = true
builder.rnd4kq1t1_read(parseInt(comboGiB.currentText.match(
/\d+/)[0]),
benchmark, false)
combo.currentText, benchmark, false)
}
}
}
Expand Down
48 changes: 32 additions & 16 deletions src/builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ Builder::Builder(QObject *parent) : QObject(parent) { }
* @brief Runs a sequential read with 1M 8 Queues and 1 Thread.
*
* @param size The size of the data to read in gigabytes.
* @param test_count The number of tests that will be done.
* @param benchmark A pointer to the Benchmark object to record the results.
* @param is_all If true, the benchmark includes all data;
* otherwise, it includes important data only.
*/
void Builder::seq1mq8t1_read(const QString &size, Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=5 --size=32m --stonewall --zero_buffers=0 "
void Builder::seq1mq8t1_read(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=" + test_count + " --size=32m --stonewall --zero_buffers=0 "
"--randrepeat=1 --ioengine=libaio --direct=1 "
"--name=test --filename=test "
"--bs=1M --size=" + size + "G --readwrite=read --ramp_time=4 "
Expand All @@ -24,12 +26,14 @@ void Builder::seq1mq8t1_read(const QString &size, Benchmark *benchmark, bool is_
* @brief Runs a sequential write with 1M 8 Queues and 1 Thread.
*
* @param size The size of the data to read in gigabytes.
* @param test_count The number of tests that will be done.
* @param benchmark A pointer to the Benchmark object to record the results.
* @param is_all If true, the benchmark includes all data;
* otherwise, it includes important data only.
*/
void Builder::seq1mq8t1_write(const QString &size, Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=5 --size=32m --stonewall --zero_buffers=0 "
void Builder::seq1mq8t1_write(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=" + test_count + " --size=32m --stonewall --zero_buffers=0 "
"--randrepeat=1 --ioengine=libaio --direct=1 "
"--name=test --filename=test "
"--bs=1M --size=" + size + "G --readwrite=write --ramp_time=4 "
Expand All @@ -42,12 +46,14 @@ void Builder::seq1mq8t1_write(const QString &size, Benchmark *benchmark, bool is
* @brief Runs a sequential read with 128K 8 Queues and 1 Thread.
*
* @param size The size of the data to read in gigabytes.
* @param test_count The number of tests that will be done.
* @param benchmark A pointer to the Benchmark object to record the results.
* @param is_all If true, the benchmark includes all data;
* otherwise, it includes important data only.
*/
void Builder::seq128Kq8t1_read(const QString &size, Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=5 --size=32m --stonewall --zero_buffers=0 "
void Builder::seq128Kq8t1_read(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=" + test_count + " --size=32m --stonewall --zero_buffers=0 "
"--randrepeat=1 --ioengine=libaio --direct=1 "
"--name=test --filename=test "
"--bs=128K --size=" + size + "G --readwrite=read --ramp_time=4 "
Expand All @@ -60,12 +66,14 @@ void Builder::seq128Kq8t1_read(const QString &size, Benchmark *benchmark, bool i
* @brief Runs a sequential write with 128K 8 Queues and 1 Thread.
*
* @param size The size of the data to read in gigabytes.
* @param test_count The number of tests that will be done.
* @param benchmark A pointer to the Benchmark object to record the results.
* @param is_all If true, the benchmark includes all data;
* otherwise, it includes important data only.
*/
void Builder::seq128Kq8t1_write(const QString &size, Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=5 --size=32m --stonewall --zero_buffers=0 "
void Builder::seq128Kq8t1_write(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=" + test_count + " --size=32m --stonewall --zero_buffers=0 "
"--randrepeat=1 --ioengine=libaio --direct=1 "
"--name=test --filename=test "
"--bs=128K --size=" + size + "G --readwrite=write --ramp_time=4 "
Expand All @@ -78,12 +86,14 @@ void Builder::seq128Kq8t1_write(const QString &size, Benchmark *benchmark, bool
* @brief Runs a random read with 4K 32 Queues and 1 Thread.
*
* @param size The size of the data to read in gigabytes.
* @param test_count The number of tests that will be done.
* @param benchmark A pointer to the Benchmark object to record the results.
* @param is_all If true, the benchmark includes all data;
* otherwise, it includes important data only.
*/
void Builder::rnd4kq32t1_read(const QString &size, Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=5 --size=8m --stonewall --zero_buffers=0 "
void Builder::rnd4kq32t1_read(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=" + test_count + " --size=8m --stonewall --zero_buffers=0 "
"--randrepeat=1 --ioengine=libaio --direct=1 --name=test "
"--filename=test --iodepth=32 --bs=4K --size=" + size +
"G --readwrite=randread --ramp_time=1 --numjobs=1 > fio_results.txt";
Expand All @@ -95,12 +105,14 @@ void Builder::rnd4kq32t1_read(const QString &size, Benchmark *benchmark, bool is
* @brief Runs a random write with 4K 32 Queues and 1 Thread.
*
* @param size The size of the data to read in gigabytes.
* @param test_count The number of tests that will be done.
* @param benchmark A pointer to the Benchmark object to record the results.
* @param is_all If true, the benchmark includes all data;
* otherwise, it includes important data only.
*/
void Builder::rnd4kq32t1_write(const QString &size, Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=5 --size=8m --stonewall --zero_buffers=0 "
void Builder::rnd4kq32t1_write(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=" + test_count + " --size=8m --stonewall --zero_buffers=0 "
"--randrepeat=1 --ioengine=libaio --direct=1 --name=test "
"--filename=test --iodepth=32 --bs=4K --size=" + size +
"G --readwrite=randwrite --ramp_time=1 --numjobs=1 > fio_results.txt";
Expand All @@ -112,12 +124,14 @@ void Builder::rnd4kq32t1_write(const QString &size, Benchmark *benchmark, bool i
* @brief Runs a random read with 4K 1 Queue and 1 Thread.
*
* @param size The size of the data to read in gigabytes.
* @param test_count The number of tests that will be done.
* @param benchmark A pointer to the Benchmark object to record the results.
* @param is_all If true, the benchmark includes all data;
* otherwise, it includes important data only.
*/
void Builder::rnd4kq1t1_read(const QString &size, Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=5 --size=256m --stonewall --zero_buffers=0 "
void Builder::rnd4kq1t1_read(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=" + test_count + " --size=256m --stonewall --zero_buffers=0 "
"--randrepeat=1 --ioengine=libaio --direct=1 --name=test "
"--filename=test --iodepth=1 --bs=4K --size=" + size +
"G --readwrite=randread --ramp_time=1 --numjobs=1 > fio_results.txt";
Expand All @@ -129,12 +143,14 @@ void Builder::rnd4kq1t1_read(const QString &size, Benchmark *benchmark, bool is_
* @brief Runs a random write with 4K 1 Queue and 1 Thread.
*
* @param size The size of the data to read in gigabytes.
* @param test_count The number of tests that will be done.
* @param benchmark A pointer to the Benchmark object to record the results.
* @param is_all If true, the benchmark includes all data;
* otherwise, it includes important data only.
*/
void Builder::rnd4kq1t1_write(const QString &size, Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=5 --size=256m --stonewall --zero_buffers=0 "
void Builder::rnd4kq1t1_write(const QString &size, const QString &test_count,
Benchmark *benchmark, bool is_all) {
QString command = "sync;fio --loops=" + test_count + " --size=256m --stonewall --zero_buffers=0 "
"--randrepeat=1 --ioengine=libaio --direct=1 --name=test "
"--filename=test --iodepth=1 --bs=4K --size=" + size +
"G --readwrite=randwrite --ramp_time=1 --numjobs=1 > fio_results.txt";
Expand Down

0 comments on commit 612cbfa

Please sign in to comment.