Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
killuaz丶x
SkyWalking
提交
a220ae9c
S
SkyWalking
项目概览
killuaz丶x
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a220ae9c
编写于
7月 30, 2017
作者:
P
pengys5
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Create ui module
上级
99222785
变更
23
显示空白变更内容
内联
并排
Showing
23 changed file
with
377 addition
and
0 deletion
+377
-0
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/grpc/AgentJVMGRPCConfigParser.java
...apm/collector/agentjvm/grpc/AgentJVMGRPCConfigParser.java
+3
-0
apm-collector/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/AgentRegisterGRPCConfigParser.java
...tor/agentregister/grpc/AgentRegisterGRPCConfigParser.java
+3
-0
apm-collector/apm-collector-agentserver/pom.xml
apm-collector/apm-collector-agentserver/pom.xml
+5
-0
apm-collector/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyConfigParser.java
...ector/agentserver/jetty/AgentServerJettyConfigParser.java
+3
-0
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCConfigParser.java
...llector/agentstream/grpc/AgentStreamGRPCConfigParser.java
+3
-0
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyConfigParser.java
...ector/agentstream/jetty/AgentStreamJettyConfigParser.java
+3
-0
apm-collector/apm-collector-boot/src/main/resources/application.yml
...tor/apm-collector-boot/src/main/resources/application.yml
+1
-0
apm-collector/apm-collector-stream/src/main/java/org/skywalking/apm/collector/stream/grpc/StreamGRPCConfigParser.java
...ing/apm/collector/stream/grpc/StreamGRPCConfigParser.java
+3
-0
apm-collector/apm-collector-ui/pom.xml
apm-collector/apm-collector-ui/pom.xml
+23
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleContext.java
...java/org/skywalking/apm/collector/ui/UIModuleContext.java
+13
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleDefine.java
.../java/org/skywalking/apm/collector/ui/UIModuleDefine.java
+51
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleException.java
...va/org/skywalking/apm/collector/ui/UIModuleException.java
+16
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleGroupDefine.java
.../org/skywalking/apm/collector/ui/UIModuleGroupDefine.java
+25
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleInstaller.java
...va/org/skywalking/apm/collector/ui/UIModuleInstaller.java
+36
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyConfig.java
.../org/skywalking/apm/collector/ui/jetty/UIJettyConfig.java
+10
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyConfigParser.java
...kywalking/apm/collector/ui/jetty/UIJettyConfigParser.java
+36
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyDataListener.java
...kywalking/apm/collector/ui/jetty/UIJettyDataListener.java
+20
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyModuleDefine.java
...kywalking/apm/collector/ui/jetty/UIJettyModuleDefine.java
+51
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyModuleRegistration.java
...ing/apm/collector/ui/jetty/UIJettyModuleRegistration.java
+13
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/TraceDagGetHandler.java
...ng/apm/collector/ui/jetty/handler/TraceDagGetHandler.java
+21
-0
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/UIJettyServerHandler.java
.../apm/collector/ui/jetty/handler/UIJettyServerHandler.java
+36
-0
apm-collector/apm-collector-ui/src/main/resources/META-INF/defines/group.define
...ector-ui/src/main/resources/META-INF/defines/group.define
+1
-0
apm-collector/apm-collector-ui/src/main/resources/META-INF/defines/module.define
...ctor-ui/src/main/resources/META-INF/defines/module.define
+1
-0
未找到文件。
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/grpc/AgentJVMGRPCConfigParser.java
浏览文件 @
a220ae9c
...
...
@@ -17,7 +17,10 @@ public class AgentJVMGRPCConfigParser implements ModuleConfigParser {
@Override
public
void
parse
(
Map
config
)
throws
ConfigParseException
{
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
HOST
)))
{
AgentJVMGRPCConfig
.
HOST
=
"localhost"
;
}
else
{
AgentJVMGRPCConfig
.
HOST
=
(
String
)
config
.
get
(
HOST
);
}
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
PORT
)))
{
AgentJVMGRPCConfig
.
PORT
=
11800
;
}
else
{
...
...
apm-collector/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/AgentRegisterGRPCConfigParser.java
浏览文件 @
a220ae9c
...
...
@@ -17,7 +17,10 @@ public class AgentRegisterGRPCConfigParser implements ModuleConfigParser {
@Override
public
void
parse
(
Map
config
)
throws
ConfigParseException
{
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
HOST
)))
{
AgentRegisterGRPCConfig
.
HOST
=
"localhost"
;
}
else
{
AgentRegisterGRPCConfig
.
HOST
=
(
String
)
config
.
get
(
HOST
);
}
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
PORT
)))
{
AgentRegisterGRPCConfig
.
PORT
=
11800
;
}
else
{
...
...
apm-collector/apm-collector-agentserver/pom.xml
浏览文件 @
a220ae9c
...
...
@@ -33,5 +33,10 @@
<artifactId>
apm-collector-agentregister
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.skywalking
</groupId>
<artifactId>
apm-collector-ui
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
apm-collector/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyConfigParser.java
浏览文件 @
a220ae9c
...
...
@@ -20,7 +20,10 @@ public class AgentServerJettyConfigParser implements ModuleConfigParser {
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
HOST
)))
{
AgentServerJettyConfig
.
HOST
=
"localhost"
;
}
else
{
AgentServerJettyConfig
.
HOST
=
(
String
)
config
.
get
(
HOST
);
}
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
PORT
)))
{
AgentServerJettyConfig
.
PORT
=
10800
;
}
else
{
...
...
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCConfigParser.java
浏览文件 @
a220ae9c
...
...
@@ -17,7 +17,10 @@ public class AgentStreamGRPCConfigParser implements ModuleConfigParser {
@Override
public
void
parse
(
Map
config
)
throws
ConfigParseException
{
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
HOST
)))
{
AgentStreamGRPCConfig
.
HOST
=
"localhost"
;
}
else
{
AgentStreamGRPCConfig
.
HOST
=
(
String
)
config
.
get
(
HOST
);
}
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
PORT
)))
{
AgentStreamGRPCConfig
.
PORT
=
11800
;
}
else
{
...
...
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyConfigParser.java
浏览文件 @
a220ae9c
...
...
@@ -20,7 +20,10 @@ public class AgentStreamJettyConfigParser implements ModuleConfigParser {
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
HOST
)))
{
AgentStreamJettyConfig
.
HOST
=
"localhost"
;
}
else
{
AgentStreamJettyConfig
.
HOST
=
(
String
)
config
.
get
(
HOST
);
}
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
PORT
)))
{
AgentStreamJettyConfig
.
PORT
=
12800
;
}
else
{
...
...
apm-collector/apm-collector-boot/src/main/resources/application.yml
浏览文件 @
a220ae9c
...
...
@@ -20,6 +20,7 @@ ui:
jetty
:
host
:
localhost
port
:
12800
context_path
:
/ui
storage
:
elasticsearch
:
cluster_name
:
CollectorDBCluster
...
...
apm-collector/apm-collector-stream/src/main/java/org/skywalking/apm/collector/stream/grpc/StreamGRPCConfigParser.java
浏览文件 @
a220ae9c
...
...
@@ -17,7 +17,10 @@ public class StreamGRPCConfigParser implements ModuleConfigParser {
@Override
public
void
parse
(
Map
config
)
throws
ConfigParseException
{
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
HOST
)))
{
StreamGRPCConfig
.
HOST
=
"localhost"
;
}
else
{
StreamGRPCConfig
.
HOST
=
(
String
)
config
.
get
(
HOST
);
}
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
PORT
)))
{
StreamGRPCConfig
.
PORT
=
11800
;
}
else
{
...
...
apm-collector/apm-collector-ui/pom.xml
浏览文件 @
a220ae9c
...
...
@@ -11,4 +11,27 @@
<artifactId>
apm-collector-ui
</artifactId>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
org.skywalking
</groupId>
<artifactId>
apm-collector-core
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.skywalking
</groupId>
<artifactId>
apm-collector-cluster
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.skywalking
</groupId>
<artifactId>
apm-collector-server
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.skywalking
</groupId>
<artifactId>
apm-collector-storage
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleContext.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui
;
import
org.skywalking.apm.collector.core.framework.Context
;
/**
* @author pengys5
*/
public
class
UIModuleContext
extends
Context
{
public
UIModuleContext
(
String
groupName
)
{
super
(
groupName
);
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleDefine.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui
;
import
java.util.List
;
import
java.util.Map
;
import
org.skywalking.apm.collector.cluster.ClusterModuleGroupDefine
;
import
org.skywalking.apm.collector.core.client.Client
;
import
org.skywalking.apm.collector.core.client.ClientException
;
import
org.skywalking.apm.collector.core.client.DataMonitor
;
import
org.skywalking.apm.collector.core.cluster.ClusterDataListenerDefine
;
import
org.skywalking.apm.collector.core.cluster.ClusterModuleContext
;
import
org.skywalking.apm.collector.core.config.ConfigParseException
;
import
org.skywalking.apm.collector.core.framework.CollectorContextHelper
;
import
org.skywalking.apm.collector.core.framework.DefineException
;
import
org.skywalking.apm.collector.core.framework.Handler
;
import
org.skywalking.apm.collector.core.module.ModuleDefine
;
import
org.skywalking.apm.collector.core.server.Server
;
import
org.skywalking.apm.collector.core.server.ServerException
;
import
org.skywalking.apm.collector.core.server.ServerHolder
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* @author pengys5
*/
public
abstract
class
UIModuleDefine
extends
ModuleDefine
implements
ClusterDataListenerDefine
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UIModuleDefine
.
class
);
@Override
public
final
void
initialize
(
Map
config
,
ServerHolder
serverHolder
)
throws
DefineException
,
ClientException
{
try
{
configParser
().
parse
(
config
);
Server
server
=
server
();
serverHolder
.
holdServer
(
server
,
handlerList
());
((
ClusterModuleContext
)
CollectorContextHelper
.
INSTANCE
.
getContext
(
ClusterModuleGroupDefine
.
GROUP_NAME
)).
getDataMonitor
().
addListener
(
listener
(),
registration
());
}
catch
(
ConfigParseException
|
ServerException
e
)
{
throw
new
UIModuleException
(
e
.
getMessage
(),
e
);
}
}
@Override
protected
final
Client
createClient
(
DataMonitor
dataMonitor
)
{
throw
new
UnsupportedOperationException
(
""
);
}
@Override
public
final
boolean
defaultModule
()
{
return
true
;
}
public
abstract
List
<
Handler
>
handlerList
();
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleException.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui
;
import
org.skywalking.apm.collector.core.module.ModuleException
;
/**
* @author pengys5
*/
public
class
UIModuleException
extends
ModuleException
{
public
UIModuleException
(
String
message
)
{
super
(
message
);
}
public
UIModuleException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleGroupDefine.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui
;
import
org.skywalking.apm.collector.core.framework.Context
;
import
org.skywalking.apm.collector.core.module.ModuleGroupDefine
;
import
org.skywalking.apm.collector.core.module.ModuleInstaller
;
/**
* @author pengys5
*/
public
class
UIModuleGroupDefine
implements
ModuleGroupDefine
{
public
static
final
String
GROUP_NAME
=
"ui"
;
@Override
public
String
name
()
{
return
GROUP_NAME
;
}
@Override
public
Context
groupContext
()
{
return
new
UIModuleContext
(
GROUP_NAME
);
}
@Override
public
ModuleInstaller
moduleInstaller
()
{
return
new
UIModuleInstaller
();
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/UIModuleInstaller.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui
;
import
java.util.Iterator
;
import
java.util.Map
;
import
org.skywalking.apm.collector.core.client.ClientException
;
import
org.skywalking.apm.collector.core.framework.CollectorContextHelper
;
import
org.skywalking.apm.collector.core.framework.DefineException
;
import
org.skywalking.apm.collector.core.module.ModuleDefine
;
import
org.skywalking.apm.collector.core.module.ModuleInstaller
;
import
org.skywalking.apm.collector.core.server.ServerHolder
;
import
org.skywalking.apm.collector.core.util.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* @author pengys5
*/
public
class
UIModuleInstaller
implements
ModuleInstaller
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UIModuleInstaller
.
class
);
@Override
public
void
install
(
Map
<
String
,
Map
>
moduleConfig
,
Map
<
String
,
ModuleDefine
>
moduleDefineMap
,
ServerHolder
serverHolder
)
throws
DefineException
,
ClientException
{
logger
.
info
(
"beginning ui module install"
);
UIModuleContext
context
=
new
UIModuleContext
(
UIModuleGroupDefine
.
GROUP_NAME
);
CollectorContextHelper
.
INSTANCE
.
putContext
(
context
);
Iterator
<
Map
.
Entry
<
String
,
ModuleDefine
>>
moduleDefineEntry
=
moduleDefineMap
.
entrySet
().
iterator
();
while
(
moduleDefineEntry
.
hasNext
())
{
ModuleDefine
moduleDefine
=
moduleDefineEntry
.
next
().
getValue
();
logger
.
info
(
"module {} initialize"
,
moduleDefine
.
getClass
().
getName
());
moduleDefine
.
initialize
((
ObjectUtils
.
isNotEmpty
(
moduleConfig
)
&&
moduleConfig
.
containsKey
(
moduleDefine
.
name
()))
?
moduleConfig
.
get
(
moduleDefine
.
name
())
:
null
,
serverHolder
);
}
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyConfig.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui.jetty
;
/**
* @author pengys5
*/
public
class
UIJettyConfig
{
public
static
String
HOST
;
public
static
int
PORT
;
public
static
String
CONTEXT_PATH
;
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyConfigParser.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui.jetty
;
import
java.util.Map
;
import
org.skywalking.apm.collector.core.config.ConfigParseException
;
import
org.skywalking.apm.collector.core.module.ModuleConfigParser
;
import
org.skywalking.apm.collector.core.util.ObjectUtils
;
import
org.skywalking.apm.collector.core.util.StringUtils
;
/**
* @author pengys5
*/
public
class
UIJettyConfigParser
implements
ModuleConfigParser
{
private
static
final
String
HOST
=
"host"
;
private
static
final
String
PORT
=
"port"
;
public
static
final
String
CONTEXT_PATH
=
"contextPath"
;
@Override
public
void
parse
(
Map
config
)
throws
ConfigParseException
{
UIJettyConfig
.
CONTEXT_PATH
=
"/"
;
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
HOST
)))
{
UIJettyConfig
.
HOST
=
"localhost"
;
}
else
{
UIJettyConfig
.
HOST
=
(
String
)
config
.
get
(
HOST
);
}
if
(
ObjectUtils
.
isEmpty
(
config
)
||
StringUtils
.
isEmpty
(
config
.
get
(
PORT
)))
{
UIJettyConfig
.
PORT
=
12800
;
}
else
{
UIJettyConfig
.
PORT
=
(
Integer
)
config
.
get
(
PORT
);
}
if
(
ObjectUtils
.
isNotEmpty
(
config
)
&&
StringUtils
.
isNotEmpty
(
config
.
get
(
CONTEXT_PATH
)))
{
UIJettyConfig
.
CONTEXT_PATH
=
(
String
)
config
.
get
(
CONTEXT_PATH
);
}
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyDataListener.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui.jetty
;
import
org.skywalking.apm.collector.cluster.ClusterModuleDefine
;
import
org.skywalking.apm.collector.core.cluster.ClusterDataListener
;
import
org.skywalking.apm.collector.ui.UIModuleGroupDefine
;
/**
* @author pengys5
*/
public
class
UIJettyDataListener
extends
ClusterDataListener
{
public
static
final
String
PATH
=
ClusterModuleDefine
.
BASE_CATALOG
+
"."
+
UIModuleGroupDefine
.
GROUP_NAME
+
"."
+
UIJettyModuleDefine
.
MODULE_NAME
;
@Override
public
String
path
()
{
return
PATH
;
}
@Override
public
void
addressChangedNotify
()
{
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyModuleDefine.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui.jetty
;
import
java.util.LinkedList
;
import
java.util.List
;
import
org.skywalking.apm.collector.core.cluster.ClusterDataListener
;
import
org.skywalking.apm.collector.core.framework.Handler
;
import
org.skywalking.apm.collector.core.module.ModuleConfigParser
;
import
org.skywalking.apm.collector.core.module.ModuleRegistration
;
import
org.skywalking.apm.collector.core.server.Server
;
import
org.skywalking.apm.collector.server.jetty.JettyServer
;
import
org.skywalking.apm.collector.ui.UIModuleDefine
;
import
org.skywalking.apm.collector.ui.UIModuleGroupDefine
;
import
org.skywalking.apm.collector.ui.jetty.handler.UIJettyServerHandler
;
/**
* @author pengys5
*/
public
class
UIJettyModuleDefine
extends
UIModuleDefine
{
public
static
final
String
MODULE_NAME
=
"jetty"
;
@Override
protected
String
group
()
{
return
UIModuleGroupDefine
.
GROUP_NAME
;
}
@Override
public
String
name
()
{
return
MODULE_NAME
;
}
@Override
protected
ModuleConfigParser
configParser
()
{
return
new
UIJettyConfigParser
();
}
@Override
protected
Server
server
()
{
return
new
JettyServer
(
UIJettyConfig
.
HOST
,
UIJettyConfig
.
PORT
,
UIJettyConfig
.
CONTEXT_PATH
);
}
@Override
protected
ModuleRegistration
registration
()
{
return
new
UIJettyModuleRegistration
();
}
@Override
public
ClusterDataListener
listener
()
{
return
new
UIJettyDataListener
();
}
@Override
public
List
<
Handler
>
handlerList
()
{
List
<
Handler
>
handlers
=
new
LinkedList
<>();
handlers
.
add
(
new
UIJettyServerHandler
());
return
handlers
;
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/UIJettyModuleRegistration.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui.jetty
;
import
org.skywalking.apm.collector.core.module.ModuleRegistration
;
/**
* @author pengys5
*/
public
class
UIJettyModuleRegistration
extends
ModuleRegistration
{
@Override
public
Value
buildValue
()
{
return
new
Value
(
UIJettyConfig
.
HOST
,
UIJettyConfig
.
PORT
,
UIJettyConfig
.
CONTEXT_PATH
);
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/TraceDagGetHandler.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui.jetty.handler
;
import
java.io.IOException
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.skywalking.apm.collector.server.jetty.JettyHandler
;
/**
* @author pengys5
*/
public
class
TraceDagGetHandler
extends
JettyHandler
{
@Override
public
String
pathSpec
()
{
return
"/traceDag"
;
}
@Override
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
}
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/UIJettyServerHandler.java
0 → 100644
浏览文件 @
a220ae9c
package
org.skywalking.apm.collector.ui.jetty.handler
;
import
com.google.gson.JsonArray
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.skywalking.apm.collector.cluster.ClusterModuleGroupDefine
;
import
org.skywalking.apm.collector.core.cluster.ClusterModuleContext
;
import
org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader
;
import
org.skywalking.apm.collector.core.framework.CollectorContextHelper
;
import
org.skywalking.apm.collector.server.jetty.JettyHandler
;
import
org.skywalking.apm.collector.ui.jetty.UIJettyDataListener
;
/**
* @author pengys5
*/
public
class
UIJettyServerHandler
extends
JettyHandler
{
@Override
public
String
pathSpec
()
{
return
"/ui/jetty"
;
}
@Override
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
ClusterModuleRegistrationReader
reader
=
((
ClusterModuleContext
)
CollectorContextHelper
.
INSTANCE
.
getContext
(
ClusterModuleGroupDefine
.
GROUP_NAME
)).
getReader
();
List
<
String
>
servers
=
reader
.
read
(
UIJettyDataListener
.
PATH
);
JsonArray
serverArray
=
new
JsonArray
();
servers
.
forEach
(
server
->
{
serverArray
.
add
(
server
);
});
reply
(
resp
,
serverArray
,
HttpServletResponse
.
SC_OK
);
}
}
apm-collector/apm-collector-ui/src/main/resources/META-INF/defines/group.define
0 → 100644
浏览文件 @
a220ae9c
org.skywalking.apm.collector.ui.UIModuleGroupDefine
\ No newline at end of file
apm-collector/apm-collector-ui/src/main/resources/META-INF/defines/module.define
0 → 100644
浏览文件 @
a220ae9c
org.skywalking.apm.collector.ui.jetty.UIJettyModuleDefine
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录