Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jd-bdp/hydra
Browse files Browse the repository at this point in the history
  • Loading branch information
shell0dh committed May 29, 2013
2 parents cc9da01 + de18462 commit 3680d19
Show file tree
Hide file tree
Showing 26 changed files with 269 additions and 51 deletions.
1 change: 0 additions & 1 deletion docs/.~lock.Hydra架构介绍.docx#

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metaq.zk.address=192.168.200.110:2181
metaq.topic=hydra_test
metaq.topic=hydra

metaq.consumer.maxDelayFetchTimeInMills=100
2 changes: 1 addition & 1 deletion modules/hydra-collector/src/main/resources/metaq.prop
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
metaq.zk=192.168.200.110:2181
metaq.topic=hydra_test
metaq.topic=hydra
metaq.zk.root=/meta
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@
<exclude>/scripts</exclude>
</excludes>
</fileSet>
<!--windows bat-->
<!--windows/shell scripts-->
<fileSet>
<directory>/src/main/resources/scripts/${runtime-env}</directory>
<outputDirectory>/bin</outputDirectory>
<includes>
<include>startABC/*.*</include>
<include>**/*.*</include>
<include>*.*</include>
</includes>
</fileSet>
<fileSet>
<directory>/src/main/resources/log</directory>
<outputDirectory>/log</outputDirectory>
</fileSet>
</fileSets>
</assembly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/bin/bash
cd `dirname $0`
source ./env.sh

MAINCLASSNAMES= \
"\
com.jd.bdp.hydra.benchmark.exp2.StartServiceA \
com.jd.bdp.hydra.benchmark.exp2.StartServiceB \
com.jd.bdp.hydra.benchmark.exp2.StartServiceC1 \
com.jd.bdp.hydra.benchmark.exp2.StartServiceC2 \
com.jd.bdp.hydra.benchmark.exp2.StartServiceD1 \
com.jd.bdp.hydra.benchmark.exp2.StartServiceD2 \
com.jd.bdp.hydra.benchmark.exp2.StartServiceE \
"
PID_FILE="$PID_DIR/.run.pid"

#function lists
PIDS=`ps -f | grep java | grep "$BASE_DIR" | awk '{print $2}'`
function running(){
if [ -f "$PID_FILE" ]; then
pid=$(cat "$PID_FILE")
process=`ps aux | grep " $pid " | grep -v grep`;
if [ "$process" == "" ]; then
return 1;
else
return 0;
fi
else
return 1
fi
}

function start_server() {
if running; then
echo "is running."
exit 1
fi

mkdir -p $PID_DIR
mkdir -p $LOG_DIR
chown -R $AS_USER $PID_DIR
chown -R $AS_USER $LOG_DIR

sleep 1
nohup $JAVA $SERVER_ARGS $MAINCLASSNAME $CONFIG_FILE >$TAIL_FILE &
echo $! > $PID_FILE
chmod 755 $PID_FILE
sleep 1;
tail -F $TAIL_FILE
}

function stop_server() {
if ! running; then
echo "service is not running."
exit 1
fi
count=0
pid=$(cat $PID_FILE)
while running;
do
let count=$count+1
echo "Stopping $count times"
if [ $count -gt 5 ]; then
echo "kill -9 $pid"
kill -9 $pid
else
kill $pid
fi
sleep 3;
done
echo "Stop service successfully."
rm $PID_FILE
}

function help() {
echo "Usage: startup.sh {start|stop}" >&2
echo " start: start the server"
echo " stop: stop the server"
}

command=$1
shift 1
case $command in
start)
start_server $@;
;;
stop)
stop_server $@;
;;
*)
help;
exit 1;
;;
esac
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
#Config your java home
#JAVA_HOME=/opt/jdk/

if [ -z "$BASE_DIR" ] ; then
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
BASE_DIR=`dirname "$PRG"`/../..
BASE_DIR=`cd "$BASE_DIR" && pwd`
fi
CONF_DIR=$BASE_DIR/conf
LIB_DIR=$BASE_DIR/lib
BIN_DIR=$BASE_DIR/bin
LOG_DIR=$BASE_DIR/log
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi

export BASE_DIR="$BASE_DIR"
export CONF_DIR="$CONF_DIR"
export LIB_DIR="$LIB_DIR"
export BIN_DIR="$BIN_DIR"
export LOG_DIR="$LOG_DIR"


if [ -z "$JAVA_HOME" ]; then
export JAVA=`which java`
else
export JAVA="$JAVA_HOME/bin/java"
fi

export CLASSPATH=$CLASSPATH:$CONF_DIR:$(ls $LIB_DIR/*.jar | tr '\n' :)

#Server jvm args
SERVER_JVM_ARGS="-Xmx512m -Xms512m -server -cp $CLASSPATH "

if [ -z "$SERVER_ARGS" ]; then
export SERVER_ARGS="$SERVER_JVM_ARGS"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
MAINCLASSNAME="com.jd.bdp.hydra.benchmark.exp2.StartServiceA"
LOGNAME="$MAINCLASSNAME".log

source ./env.sh
TAIL_FILE="$LOG_DIR/$LOGNAME"
java $SERVER_ARGS $MAINCLASSNAME > $TAIL_FILE &
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
MAINCLASSNAME="com.jd.bdp.hydra.benchmark.exp2.StartServiceB"
LOGNAME="$MAINCLASSNAME".log

source ./env.sh
TAIL_FILE="$LOG_DIR/$LOGNAME"
java $SERVER_ARGS $MAINCLASSNAME > $TAIL_FILE &
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
MAINCLASSNAME="com.jd.bdp.hydra.benchmark.exp2.StartServiceC1"
LOGNAME="$MAINCLASSNAME".log

source ./env.sh
TAIL_FILE="$LOG_DIR/$LOGNAME"
java $SERVER_ARGS $MAINCLASSNAME > $TAIL_FILE &
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
MAINCLASSNAME="com.jd.bdp.hydra.benchmark.exp2.StartServiceC2"
LOGNAME="$MAINCLASSNAME".log

source ./env.sh
TAIL_FILE="$LOG_DIR/$LOGNAME"
java $SERVER_ARGS $MAINCLASSNAME > $TAIL_FILE &
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
MAINCLASSNAME="com.jd.bdp.hydra.benchmark.exp2.StartServiceD1"
LOGNAME="$MAINCLASSNAME".log

source ./env.sh
TAIL_FILE="$LOG_DIR/$LOGNAME"
java $SERVER_ARGS $MAINCLASSNAME > $TAIL_FILE &
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
MAINCLASSNAME="com.jd.bdp.hydra.benchmark.exp2.StartServiceD2"
LOGNAME="$MAINCLASSNAME".log

source ./env.sh
TAIL_FILE="$LOG_DIR/$LOGNAME"
java $SERVER_ARGS $MAINCLASSNAME > $TAIL_FILE &
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
MAINCLASSNAME="com.jd.bdp.hydra.benchmark.exp2.StartServiceE"
LOGNAME="$MAINCLASSNAME".log

source ./env.sh
TAIL_FILE="$LOG_DIR/$LOGNAME"
java $SERVER_ARGS $MAINCLASSNAME > $TAIL_FILE &

This file was deleted.

31 changes: 17 additions & 14 deletions modules/hydra-web/src/main/webapp/WEB-INF/views/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<head>
<title>Hydra</title>
</head>
<script language="JavaScript" type="text/javascript">
var ctp = "<%=request.getContextPath() %>";
</script>
<body>
<div style="width:100%;background-color: #7AC5CD;height: 50px;color: #ffffff;font-size:35px;">
<div style="padding: 10 0 0 10">Hydra</div>
Expand All @@ -11,29 +14,29 @@



<link rel="stylesheet" type="text/css" href="/statics/lib/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/statics/css/app.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/statics/lib/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/statics/css/app.css" />


<script type="text/javascript" src="/statics/lib/jquery-1.8.0.min.js"></script>
<script src="/statics/lib/angular/angular.js"></script>
<script src="/statics/lib/angular/angular-resource.js?"></script>
<script type="text/javascript" src="/statics/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/statics/lib/jquery-1.8.0.min.js"></script>
<script src="<%=request.getContextPath() %>/statics/lib/angular/angular.js"></script>
<script src="<%=request.getContextPath() %>/statics/lib/angular/angular-resource.js?"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/statics/lib/bootstrap.min.js"></script>

<script src="/statics/js/app.js"></script>
<script src="<%=request.getContextPath() %>/statics/js/app.js"></script>
<!-- repo -->
<script src="/statics/js/repository/trace-repo.js"></script>
<script src="/statics/js/repository/service-repo.js"></script>
<script src="<%=request.getContextPath() %>/statics/js/repository/trace-repo.js"></script>
<script src="<%=request.getContextPath() %>/statics/js/repository/service-repo.js"></script>

<!-- service -->
<script src="/statics/js/service/sequence-service.js"></script>
<script src="/statics/js/service/tree-service.js"></script>
<script src="/statics/js/service/query-service.js"></script>
<script src="<%=request.getContextPath() %>/statics/js/service/sequence-service.js"></script>
<script src="<%=request.getContextPath() %>/statics/js/service/tree-service.js"></script>
<script src="<%=request.getContextPath() %>/statics/js/service/query-service.js"></script>
<!-- controller -->
<script src="/statics/js/controller/query-controller.js"></script>
<script src="<%=request.getContextPath() %>/statics/js/controller/query-controller.js"></script>

<!-- filter -->
<script src="/statics/js/filters.js"></script>
<script src="<%=request.getContextPath() %>/statics/js/filters.js"></script>
<%--<script src="/statics/js/directives.js"></script>--%>
</body>
</html>
29 changes: 14 additions & 15 deletions modules/hydra-web/src/main/webapp/WEB-INF/views/query.jsp
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
<style type="text/css">
</style>
<link href="/statics/lib/bootstrap/datetimepicker/css/datetimepicker.css" rel="stylesheet" media="screen">
<link href="/statics/lib/DataTables-1.9.4/media/css/jquery.dataTables.css" rel="stylesheet" type="text/css"/>
<link href="/statics/lib/jquery.qtip.min.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/statics/lib/d3.v3.min.js"></script>
<script src="/statics/lib/jquery.qtip.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/statics/lib/DataTables-1.9.4/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/statics/lib/DataTables-1.9.4/media/js/plugin.js"></script>
<script language="javascript" type="text/javascript">
var ctp = "<%=request.getContextPath() %>";
</script>
<link href="<%=request.getContextPath() %>/statics/lib/bootstrap/datetimepicker/css/datetimepicker.css" rel="stylesheet" media="screen">
<link href="<%=request.getContextPath() %>/statics/lib/DataTables-1.9.4/media/css/jquery.dataTables.css" rel="stylesheet" type="text/css"/>
<link href="<%=request.getContextPath() %>/statics/lib/jquery.qtip.min.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=request.getContextPath() %>/statics/lib/d3.v3.min.js"></script>
<script src="<%=request.getContextPath() %>/statics/lib/jquery.qtip.min.js" type="text/javascript"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/statics/lib/DataTables-1.9.4/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/statics/lib/DataTables-1.9.4/media/js/plugin.js"></script>
<script type="text/javascript"
src="/statics/lib/bootstrap/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
src="<%=request.getContextPath() %>/statics/lib/bootstrap/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"
src="/statics/lib/bootstrap/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
src="<%=request.getContextPath() %>/statics/lib/bootstrap/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
</head>
<body>
<div ng-show="showType == 'query'">
Expand Down Expand Up @@ -102,7 +101,7 @@
<div class="alert alert-error" id="alertDiv" ng-show="query.invalid">
{{query.validateMsg}}
</div>
<button class="btn btn-success btn-large" type="submit" style="width: 200px;">查询</button>
<button ng-class="query.queryBtn.myClass" type="submit" style="width: 200px;">{{query.queryBtn.name}}</button>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -150,7 +149,7 @@
<div class="traceDiv">
<div ng-show="!trace.available" class="alert alert-block">当前跟踪数据未收集全,无法展示.</div>
<div id="treeDiv" class="viewDiv" style="width:25%;" ng-show="trace.available"></div>
<div id="sequenceDiv" class="viewDiv" style="width:74%;" ng-show="trace.available"></div>
<div id="sequenceDiv" class="viewDiv" ng-show="trace.available" ng-style="env.sequenceDivStyle"></div>
</div>
</div>
</body>
Expand Down
1 change: 1 addition & 0 deletions modules/hydra-web/src/main/webapp/statics/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ path.link {
width: 98%;
margin: 20 20 20 20;
border: solid 1px #ddd;
overflow-x: hidden;
}

.myNavbar {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion modules/hydra-web/src/main/webapp/statics/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ angular.module('myApp',
'hydra.filters'
]).
config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/query', {templateUrl: '/index/query.html', controller: QueryCtrl});
$routeProvider.when('/query', {templateUrl: ctp + '/index/query.html', controller: QueryCtrl});
$routeProvider.otherwise({redirectTo: '/query'});
}]);
Loading

0 comments on commit 3680d19

Please sign in to comment.