Commit 488def5f authored by zhang.xin's avatar zhang.xin
Browse files

Add demo pages

parent 4244ab71
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
<component name="libraryTable">
  <library name="Maven: com.alibaba:dubbox:2.8.4">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/alibaba/dubbox/2.8.4/dubbox-2.8.4.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/alibaba/dubbox/2.8.4/dubbox-2.8.4-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/alibaba/dubbox/2.8.4/dubbox-2.8.4-sources.jar!/" />
    </SOURCES>
  </library>
</component>
 No newline at end of file
+37 −6
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ package com.ai.cloud.skywalking.analysis.mapper;
import com.ai.cloud.skywalking.analysis.chainbuild.ChainBuildMapper;
import com.ai.cloud.skywalking.analysis.chainbuild.ChainBuildReducer;
import com.ai.cloud.skywalking.analysis.chainbuild.po.ChainInfo;
import com.ai.cloud.skywalking.analysis.chainbuild.po.ChainNode;
import com.ai.cloud.skywalking.analysis.config.ConfigInitializer;
import com.ai.cloud.skywalking.analysis.config.HBaseTableMetaData;
import com.ai.cloud.skywalking.protocol.Span;
@@ -29,8 +28,8 @@ import java.util.*;
 */
public class CallChainMapperTest {

    //private static String ZK_QUORUM = "10.1.235.197,10.1.235.198,10.1.235.199";
    private static String ZK_QUORUM = "10.1.241.18,10.1.241.19,10.1.241.20";
    private static String ZK_QUORUM = "10.1.235.197,10.1.235.198,10.1.235.199";
    //    private static String ZK_QUORUM = "10.1.241.18,10.1.241.19,10.1.241.20";
    private static String ZK_CLIENT_PORT = "29181";
    private static String chain_Id = "1.0a2.1457436000002.860568c.21818.49.82";
//    private static String chain_Id = "1.0a2.1453429608422.2701d43.6468.56.1";
@@ -62,11 +61,39 @@ public class CallChainMapperTest {
        return entries;
    }

    public static List<ChainInfo> selectSpans() throws IOException, ParseException {
    @Test
    public void validateSummaryResult() throws IOException, ParseException {
        List<ChainInfo> chainInfoList = selectSpecificCallEntranceSpansOnSpecificCallTime("com.ai.aisse.core.service.impl.SynchAisseWorkDataServiceImpl.SynchAisseDataDel()", "2016-01-26/10:00:00", "2016-02-08/10:00:00");

        System.out.println("size :" + chainInfoList.size());
        Map<String, Integer> summaryResult = new HashMap<String, Integer>();
        for (ChainInfo chainInfo : chainInfoList) {
            String key = generateKey(chainInfo.getStartDate());
            Integer total = summaryResult.get(key);
            if (total == null){
                total = 0;
            }
            summaryResult.put(key, ++total);
        }

        for (Map.Entry<String, Integer> entry : summaryResult.entrySet()){
            System.out.println(entry.getKey() + "  " + entry.getValue());
        }

    }

    private String generateKey(long startDate) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date(startDate));
        return calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-"
                + calendar.get(Calendar.DAY_OF_MONTH);
    }

    public static List<ChainInfo> selectSpecificCallEntranceSpansOnSpecificCallTime(String callEntrance, String startDate, String endDate) throws IOException, ParseException {
        List<ChainInfo> chainInfos = new ArrayList<ChainInfo>();
        Table table = connection.getTable(TableName.valueOf(HBaseTableMetaData.TABLE_CALL_CHAIN.TABLE_NAME));
        Scan scan = new Scan();
        scan.setTimeRange(new SimpleDateFormat("yyyy-MM-dd/HH:mm:ss").parse("2016-01-10/11:55:48").getTime(), new SimpleDateFormat("yyyy-MM-dd/HH:mm:ss").parse("2016-02-10/11:55:48").getTime());
        scan.setTimeRange(new SimpleDateFormat("yyyy-MM-dd/HH:mm:ss").parse(startDate).getTime(), new SimpleDateFormat("yyyy-MM-dd/HH:mm:ss").parse(endDate).getTime());
        ResultScanner resultScanner = table.getScanner(scan);
        Iterator<Result> resultIterator = resultScanner.iterator();
        while (resultIterator.hasNext()) {
@@ -82,8 +109,11 @@ public class CallChainMapperTest {
            } catch (Exception e) {
                continue;
            }
            // System.out.println(chainInfo.getCallEntrance());
            if (callEntrance.equalsIgnoreCase(chainInfo.getCallEntrance())) {
                chainInfos.add(chainInfo);
            }
        }

        return chainInfos;
    }
@@ -95,6 +125,7 @@ public class CallChainMapperTest {
            configuration = HBaseConfiguration.create();
            configuration.set("hbase.zookeeper.quorum", ZK_QUORUM);
            configuration.set("hbase.zookeeper.property.clientPort", ZK_CLIENT_PORT);
            configuration.set("hbase.rpc.timeout", "600000");
            connection = ConnectionFactory.createConnection(configuration);
        }

+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@
						</goals>
					</execution>
				</executions>
				<version>2.4</version>
			</plugin>
		</plugins>
	</build>
+68.8 KiB
Loading image diff...
+49 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  <link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="./node_modules/jquery/dist/jquery.min.js"></script>
  <script src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
</head>
<body>
  <div class="navbar navbar-default">
      <div class="container">
        <div class="navbar-header">
          <button data-target=".navbar-collapse" data-toggle="collapse" type="button" class="navbar-toggle collapsed">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a onclick="javascript:void(0);" href="#" class="navbar-brand hidden-sm">Skywalking-系统守望者</a>
        </div>
        <div role="navigation" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right hidden-sm">
            <li>
              <a onclick="javascript:void(0);" href="./login.html"><ins>Sign In</ins></a>
            </li>
            <li>
              <a onclick="javascript:void(0);" href="#"><ins>Sign up</ins></a>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-6 col-md-4 col-md-offset-4">
          <img src="./image/logo.png" class="img-responsive center-block"/>
        </div>
        <div class="row">
          <img
        </div>
        <div class="input-group col-sm-6 col-md-6 col-md-offset-3 col-xs-4">
            <input type="text" class="form-control">
            <a class="input-group-addon btn btn-primary" href="./searchResult.html">搜索</a>
        </div>
      </div>
    </div>
</body>
</html>
Loading