Skip to content

Commit c348e9f

Browse files
authored
Merge pull request #33 from dist-sys/fix_issue32
Fix issue32 and log problem
2 parents a2a1b33 + 4b17c3d commit c348e9f

File tree

10 files changed

+31
-24
lines changed

10 files changed

+31
-24
lines changed

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
wrapper {
7-
gradleVersion = '7.6'
7+
gradleVersion = '8.2'
88
}
99

1010
mainClassName = 'mqttloader.Loader'
@@ -33,7 +33,7 @@ CreateStartScripts startScripts = project.startScripts
3333
startScripts.with {
3434
doLast {
3535
unixScript.text = unixScript.text.replaceFirst('-Djava.util.logging.config.file=src/dist/logging.properties',
36-
'-Djava.util.logging.config.file=\\$APP_HOME/logging.properties')
36+
'-Djava.util.logging.config.file=\'\"\\$APP_HOME\"\'/logging.properties')
3737
windowsScript.text = windowsScript.text.replaceFirst('-Djava.util.logging.config.file=src/dist/logging.properties',
3838
'-Djava.util.logging.config.file=%~dp0../logging.properties')
3939
}

doc/usage_en.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MQTTLoader usage (v0.8.5)
1+
# MQTTLoader usage (v0.8.6)
22
MQTTLoader is a load testing tool (client tool) for MQTT.
33
It supports both MQTT v5.0 and v3.1.1.
44
From v0.8.0, it supports TLS authentication.
@@ -13,7 +13,7 @@ Download the archive file (zip or tar) from: https://github.com/dist-sys/mqttloa
1313
Below is an example of downloading by using curl command.
1414

1515
```
16-
$ curl -OL https://github.com/dist-sys/mqttloader/releases/download/v0.8.5/mqttloader-0.8.5.zip
16+
$ curl -OL https://github.com/dist-sys/mqttloader/releases/download/v0.8.6/mqttloader-0.8.6.zip
1717
```
1818

1919
By extracting it, you can get the following files.

doc/usage_jp.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MQTTLoader 利用方法 (v0.8.5)
1+
# MQTTLoader 利用方法 (v0.8.6)
22
MQTTLoaderは、MQTT v5.0とv3.1.1に対応した負荷テストツール(クライアントツール)です。
33
v0.8.0から、ブローカとのTLS接続にも対応しました。
44

@@ -14,7 +14,7 @@ https://github.com/dist-sys/mqttloader/releases
1414
以下は、Curlコマンドを使ってダウンロードする場合の例です。
1515

1616
```
17-
$ curl -OL https://github.com/dist-sys/mqttloader/releases/download/v0.8.5/mqttloader-0.8.5.zip
17+
$ curl -OL https://github.com/dist-sys/mqttloader/releases/download/v0.8.6/mqttloader-0.8.6.zip
1818
```
1919

2020
ダウンロードしたファイルを解凍すると、以下のディレクトリ構造が得られます。

gradle/wrapper/gradle-wrapper.jar

1.76 KB
Binary file not shown.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

+10-6
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -133,26 +130,29 @@ location of your Java installation."
133130
fi
134131
else
135132
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+
if ! command -v java >/dev/null 2>&1
134+
then
135+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137136
138137
Please set the JAVA_HOME variable in your environment to match the
139138
location of your Java installation."
139+
fi
140140
fi
141141

142142
# Increase the maximum file descriptors if we can.
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146146
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
147+
# shellcheck disable=SC3045
148148
MAX_FD=$( ulimit -H -n ) ||
149149
warn "Could not query maximum file descriptor limit"
150150
esac
151151
case $MAX_FD in #(
152152
'' | soft) :;; #(
153153
*)
154154
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
155+
# shellcheck disable=SC3045
156156
ulimit -n "$MAX_FD" ||
157157
warn "Could not set maximum file descriptor limit to $MAX_FD"
158158
esac
@@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
197197
done
198198
fi
199199

200+
201+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203+
200204
# Collect all arguments for the java command;
201205
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202206
# shell script including quotes and variable substitutions, so put them in

src/main/java/mqttloader/Constants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import java.text.SimpleDateFormat;
2020

2121
public class Constants {
22-
public static final String VERSION = "0.8.5";
22+
public static final String VERSION = "0.8.6";
2323
public static final String BROKER_PREFIX_TCP = "tcp://";
2424
public static final String BROKER_PREFIX_TLS = "ssl://";
2525
public static final String BROKER_PORT_TCP = "1883";

src/main/java/mqttloader/Loader.java

+1
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ private void startMeasurement() {
429429

430430
measurementStartTime = Util.getCurrentTimeWithOffset().plusMillis(delay);
431431
lastRecvTime = measurementStartTime;
432+
recorder.writeStartTime();
432433

433434
// publish interval in micro seconds.
434435
int interval = Util.getPropValueInt(Prop.INTERVAL);

src/main/java/mqttloader/Recorder.java

+11-9
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,21 @@ public Recorder(File file, boolean inMemory) {
5757
}
5858
}
5959

60+
public void writeStartTime(){
61+
if(!inMemory) {
62+
try {
63+
bw.write(Util.getEpochMicros(Loader.measurementStartTime) + ",,,");
64+
bw.newLine();
65+
} catch (IOException e) {
66+
e.printStackTrace();
67+
}
68+
}
69+
}
70+
6071
@Override
6172
public void run() {
6273
thread = Thread.currentThread();
6374

64-
if(!inMemory) {
65-
try {
66-
bw.write(Util.getEpochMicros(Loader.measurementStartTime) + ",,,");
67-
bw.newLine();
68-
} catch (IOException e) {
69-
e.printStackTrace();
70-
}
71-
}
72-
7375
Record record = null;
7476
while (true) {
7577
try {

src/main/java/mqttloader/client/AbstractPublisher.java

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.util.concurrent.ScheduledExecutorService;
2323
import java.util.concurrent.ScheduledFuture;
2424
import java.util.concurrent.TimeUnit;
25-
import mqttloader.Constants;
2625
import mqttloader.Loader;
2726
import mqttloader.Record;
2827
import mqttloader.Recorder;

0 commit comments

Comments
 (0)