Skip to content

Commit

Permalink
Merge pull request #23 from qunarcorp/dev
Browse files Browse the repository at this point in the history
v2.0.2
  • Loading branch information
xleiy authored Aug 27, 2019
2 parents 7d3fd81 + b3bc8bf commit 9c3bff3
Show file tree
Hide file tree
Showing 50 changed files with 368 additions and 274 deletions.
2 changes: 1 addition & 1 deletion bistoury-agent-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,12 @@ public class RocksDBStoreImpl implements KvDb {
this.rocksDB = TtlDB.open(options, path, ttl, false);
LOG.info("open rocks db success, path:{}, ttl:{}", path, ttl);

startCompactRange();
} catch (Exception e) {
LOG.error("open rocks db error, path:{}, ttl:{}", path, ttl, e);
throw new RuntimeException(e);
}
}

private void startCompactRange() {
executor.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
try {
LOG.debug("compact range rocks db");
rocksDB.compactRange();
} catch (RocksDBException e) {
LOG.error("rocks db compact range error", e);
}
}
}, 30, 30, TimeUnit.MINUTES);
}

private void ensureDirectoryExists(final String path) {
File file = new File(path);
if (!file.exists() || !file.isDirectory()) {
Expand Down
2 changes: 1 addition & 1 deletion bistoury-agent-task/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-application/bistoury-application-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury-application</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-application/bistoury-application-mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury-application</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-attach-arthas/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-attach-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-clientside-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-commands/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class BistouryConstants {
public static final String SPY_CLASSNAME = "qunar.tc.bistoury.instrument.spy.BistourySpys1";

// todo: 先这么写吧
public static final String CURRENT_VERSION = "2.0.0";
public static final String CURRENT_VERSION = "2.0.2";

public static final String BISTOURY_VERSION_LINE_PREFIX = "bistoury version:";

Expand Down
2 changes: 1 addition & 1 deletion bistoury-decompiler-fernflower/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
10 changes: 9 additions & 1 deletion bistoury-dist/bin/bistoury-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ BISTOURY_MAIN="qunar.tc.bistoury.indpendent.agent.Main"
. "$BISTOURY_BIN_DIR/bistoury-agent-env.sh"

for CMD in "$@";do true; done

APP_PID=""
LOCAL_IP=""

while getopts p:j:c:h opt;do
while getopts p:i:j:c:h opt;do
case $opt in
p) APP_PID=$OPTARG;;
i) LOCAL_IP=$OPTARG;;
j) JAVA_HOME=$OPTARG;;
c) BISTOURY_APP_LIB_CLASS=$OPTARG;;
h|*) echo "-p 通过-p指定应用进程pid"
echo "-i 通过-i参数指定本机ip"
echo "-j 通过-j指定java home"
echo "-c 通过-c指定应用依赖的jar包中的一个类(推荐使用公司内部中间件的jar包或Spring相关包中的类,如org.springframework.web.servlet.DispatcherServlet),agent通过该类获取应用jar包路径"
echo "-h 通过-h查看命令帮助"
Expand All @@ -36,6 +40,10 @@ if [[ ! -n $BISTOURY_APP_LIB_CLASS ]]; then
exit 0
fi

if [[ -n $LOCAL_IP ]]; then
JAVA_OPTS="$JAVA_OPTS -Dbistoury.local.host=$LOCAL_IP"
fi

if [[ -n $APP_PID ]]; then
JAVA_OPTS="$JAVA_OPTS -Dbistoury.user.pid=$APP_PID"
fi
Expand Down
2 changes: 1 addition & 1 deletion bistoury-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-independent-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-instrument-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ private static ClassLoader findUserClassLoader(Instrumentation inst, final Strin
// 这个方法和DefaultDebugger里面是一样的,但是这个地方不应该有依赖,所以两边都要写
private static Class<?> findLibClass(Instrumentation inst, final String libClass) {
if (libClass == null || "".equals(libClass)) {
ps.println("can not find lib class");
throw new IllegalStateException("can not find lib class");
ps.println("can not find lib class, [" + libClass + "]");
throw new IllegalStateException("can not find lib class, [" + libClass + "]");
}

Class[] allLoadedClasses = inst.getAllLoadedClasses();
Expand All @@ -140,8 +140,13 @@ private static Class<?> findLibClass(Instrumentation inst, final String libClass
return clazz;
}
}
ps.println("can not find lib class");
throw new IllegalStateException("can not find lib class");
ps.println("can not find lib class, [" + libClass + "]");
ps.println("begin print all loaded classes");
for (Class allLoadedClass : allLoadedClasses) {
ps.println("[" + allLoadedClass.getName() + "]");
}
ps.println("end print all loaded classes");
throw new IllegalStateException("can not find lib class, [" + libClass + "]");
}

private static File[] getNonSpyJarFiles(File dir, final List<File> spyJarFiles) {
Expand Down
2 changes: 1 addition & 1 deletion bistoury-instrument-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ private static Class<?> findOneAppLibClass(Instrumentation instrumentation) {
Class[] allLoadedClasses = instrumentation.getAllLoadedClasses();
final String libClass = System.getProperty("bistoury.app.lib.class");
if (Strings.isNullOrEmpty(libClass)) {
System.err.println("can not find lib class");
throw new IllegalStateException("can not find lib class");
System.err.println("can not find lib class, [" + libClass + "]");
throw new IllegalStateException("can not find lib class, [" + libClass + "]");
}
for (Class clazz : allLoadedClasses) {
if (libClass.equals(clazz.getName())) {
return clazz;
}
}
System.err.println("can not find lib class");
throw new IllegalStateException("can not find lib class");
System.err.println("can not find lib class, [" + libClass + "]");
throw new IllegalStateException("can not find lib class, [" + libClass + "]");
}
}
2 changes: 1 addition & 1 deletion bistoury-instrument-spy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-magic-classes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-magic-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-metrics-prometheus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bistoury-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
12 changes: 10 additions & 2 deletions bistoury-proxy/src/bin/bistoury-proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ BISTOURY_MAIN="qunar.tc.bistoury.proxy.container.Bootstrap"

for CMD in "$@";do true; done

while getopts j: opt;do
LOCAL_IP=""
while getopts j:i:h opt;do
case $opt in
j) JAVA_HOME=$OPTARG;;
*) echo "-j 通过-j指定java home"
i) LOCAL_IP=$OPTARG;;
h|*) echo "-j 通过-j指定java home"
echo "-i 通过-i参数指定本机ip"
echo "-h 通过-h查看命令帮助"
exit 0
esac
Expand All @@ -24,6 +27,11 @@ if [[ "$JAVA_HOME" != "" ]];then
else
JAVA=java;
fi

if [[ -n $LOCAL_IP ]]; then
JAVA_OPTS="$JAVA_OPTS -Dbistoury.local.host=$LOCAL_IP"
fi

CLASSPATH="$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/sa-jdi.jar"
JAVA_OPTS="$JAVA_OPTS -Xloggc:${BISTOURY_LOG_DIR}/bistoury-gc-${TIMESTAMP}.log -XX:+PrintGC -XX:+PrintGCDetails -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BISTOURY_LOG_DIR}"
BISTOURY_PID_FILE="$BISTOURY_PID_DIR/bistoury-proxy.pid"
Expand Down
8 changes: 5 additions & 3 deletions bistoury-proxy/src/main/resources.local/spring/database.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

<bean id="h2DataBeseUtil" class="qunar.tc.bistoury.serverside.database.H2DataBeseUtil"></bean>

<bean id="h2DataSource" class="org.apache.tomcat.jdbc.pool.DataSource">
<property name="driverClassName" value="org.h2.Driver"/>
<property name="url"
value="jdbc:h2:tcp://localhost//tmp/bistoury/h2/bistoury;MODE=MYSQL;TRACE_LEVEL_SYSTEM_OUT=2;AUTO_SERVER=TRUE"/>
value="#{h2DataBeseUtil.getUrl()}"/>
<property name="username" value=""/>
<property name="password" value=""/>
</bean>
Expand Down
6 changes: 3 additions & 3 deletions bistoury-proxy/src/main/webapp/proxy.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<meta charset="UTF-8">
<title>Bistoury Proxy Version</title>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="css/bootstrap.min.css?version=2.0.0">
<script type="text/javascript" src="js/jquery-3.3.1.min.js?version=2.0.0"></script>
<script type="text/javascript" src="js/bootstrap.min.js?version=2.0.0"></script>
<link rel="stylesheet" href="css/bootstrap.min.css?version=2.0.2">
<script type="text/javascript" src="js/jquery-3.3.1.min.js?version=2.0.2"></script>
<script type="text/javascript" src="js/bootstrap.min.js?version=2.0.2"></script>
</head>
<style>
li[role=presentation] > a {
Expand Down
2 changes: 1 addition & 1 deletion bistoury-remoting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bistoury</artifactId>
<groupId>qunar.tc.bistoury</groupId>
<version>2.0.0</version>
<version>2.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading

0 comments on commit 9c3bff3

Please sign in to comment.