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

function.xml is perceivable #390

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions configuration/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ fi

# check BENCHMARK_HOME
if [ -z "${BENCHMARK_HOME}" ]; then
export BENCHMARK_HOME="$(cd "`dirname "$0"`"/.. && pwd)"
export BENCHMARK_HOME="$(cd "$(dirname "$0")" && pwd)"
fi

# check $benchmark_conf
if [ -z $benchmark_conf ] ; then
if [ -z "${benchmark_conf}" ] ; then
benchmark_conf=${BENCHMARK_HOME}/conf/config.properties
else
benchmark_conf="$(cd "$(dirname "$benchmark_conf")" && pwd)/$(basename "$benchmark_conf")"
Expand All @@ -93,7 +93,7 @@ else
exit 1
fi
fi
echo Using configuration file: $benchmark_conf
echo Using configuration file: "${benchmark_conf}"

# set MAIN_CLASS
MAIN_CLASS=cn.edu.tsinghua.iot.benchmark.App
Expand All @@ -106,6 +106,7 @@ done
# set benchmark_parms
benchmark_parms="$benchmark_parms -Duser.timezone=GMT+8"
benchmark_parms="$benchmark_parms -Dlogback.configurationFile=${BENCHMARK_HOME}/conf/logback.xml"
benchmark_parms="$benchmark_parms -DBENCHMARK_HOME=${BENCHMARK_HOME}"
if [ -n "$MAX_HEAP_SIZE" ]; then
echo Set MAX_HEAP_SIZE=$MAX_HEAP_SIZE
benchmark_parms="$benchmark_parms -Xmx${MAX_HEAP_SIZE}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import javax.xml.bind.Unmarshaller;

import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;

Expand Down Expand Up @@ -402,11 +404,22 @@ public class Config {
/** Sensor function */
private Map<String, FunctionParam> SENSOR_FUNCTION = new HashMap<>();

public String getHomeDir() {
// When start benchmark with the script, the environment variables will be set.
// But in developer mode it will return another dir to find resources.
return System.getProperty(Constants.BENCHMARK_HOME, null);
}

/** init inner functions */
public void initInnerFunction() {
FunctionXml xml = null;
try {
InputStream input = Function.class.getResourceAsStream("/function.xml");
InputStream input;
if (getHomeDir() == null) {
input = Function.class.getResourceAsStream("/function.xml");
} else {
input = Files.newInputStream(Paths.get(getHomeDir() + "/resources/function.xml"));
}
JAXBContext context = JAXBContext.newInstance(FunctionXml.class, FunctionParam.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
xml = (FunctionXml) unmarshaller.unmarshal(input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class Constants {
public static final long START_TIMESTAMP =
TimeUtils.convertDateStrToTimestamp(config.getSTART_TIME());
public static final String CONSOLE_PREFIX = "iot-benchmark>";

public static final String BENCHMARK_HOME = "BENCHMARK_HOME";
public static final String BENCHMARK_CONF = "benchmark-conf";

public static final String MYSQL_DRIVENAME = "com.mysql.jdbc.Driver";
Expand Down
4 changes: 4 additions & 0 deletions iginx/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions influxdb-2.0/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions influxdb/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions iotdb-0.12/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions iotdb-0.13/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions iotdb-1.0/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions iotdb-1.1/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions kairosdb/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions mssqlserver/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions opentsdb/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions pi/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions questdb/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions sqlite/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions tdengine-3.0/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions tdengine/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions timescaledb-cluster/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions timescaledb/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions verification/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
4 changes: 4 additions & 0 deletions victoriametrics/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/core/src/main/resources</directory>
<outputDirectory>resources</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
Expand Down
Loading