Skip to content

Commit

Permalink
Update content if advisors.yaml (#22959)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Dec 18, 2022
1 parent 50f743f commit 1be8a5a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ public void assertUnmarshal() {
assertThat(actual.getAdvisors().size(), is(5));
List<YamlAdvisorConfiguration> actualYamlAdvisorConfigs = new ArrayList<>(actual.getAdvisors());
assertYamlAdvisorConfiguration(actualYamlAdvisorConfigs.get(0), createExpectedYamlAdvisorConfiguration("org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask",
"org.apache.shardingsphere.agent.metrics.api.advice.CommandExecutorTaskAdvice",
"org.apache.shardingsphere.agent.metrics.core.advice.CommandExecutorTaskAdvice",
Arrays.asList(createExpectedYamlPointcutConfiguration("run", "instance"), createExpectedYamlPointcutConfiguration("processException", "instance"))));
assertYamlAdvisorConfiguration(actualYamlAdvisorConfigs.get(1), createExpectedYamlAdvisorConfiguration("org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler",
"org.apache.shardingsphere.agent.metrics.api.advice.ChannelHandlerAdvice",
"org.apache.shardingsphere.agent.metrics.core.advice.ChannelHandlerAdvice",
Arrays.asList(createExpectedYamlPointcutConfiguration("channelActive", "instance"),
createExpectedYamlPointcutConfiguration("channelRead", "instance"), createExpectedYamlPointcutConfiguration("channelInactive", "instance"))));
assertYamlAdvisorConfiguration(actualYamlAdvisorConfigs.get(2), createExpectedYamlAdvisorConfiguration("org.apache.shardingsphere.infra.route.engine.SQLRouteEngine",
"org.apache.shardingsphere.agent.metrics.api.advice.SQLRouteEngineAdvice", Collections.singleton(createExpectedYamlPointcutConfiguration("route", "instance"))));
"org.apache.shardingsphere.agent.metrics.core.advice.SQLRouteEngineAdvice", Collections.singleton(createExpectedYamlPointcutConfiguration("route", "instance"))));
assertYamlAdvisorConfiguration(actualYamlAdvisorConfigs.get(3), createExpectedYamlAdvisorConfiguration(
"org.apache.shardingsphere.proxy.backend.communication.jdbc.transaction.BackendTransactionManager",
"org.apache.shardingsphere.agent.metrics.api.advice.TransactionAdvice",
"org.apache.shardingsphere.agent.metrics.core.advice.TransactionAdvice",
Arrays.asList(createExpectedYamlPointcutConfiguration("commit", "instance"), createExpectedYamlPointcutConfiguration("rollback", "instance"))));
assertYamlAdvisorConfiguration(actualYamlAdvisorConfigs.get(4), createExpectedYamlAdvisorConfiguration("org.apache.shardingsphere.infra.config.datasource.JDBCParameterDecoratorHelper",
"org.apache.shardingsphere.agent.metrics.api.advice.DataSourceAdvice", Collections.singleton(createExpectedYamlPointcutConfiguration("decorate", "static"))));
"org.apache.shardingsphere.agent.metrics.core.advice.DataSourceAdvice", Collections.singleton(createExpectedYamlPointcutConfiguration("decorate", "static"))));
}

private void assertYamlAdvisorConfiguration(final YamlAdvisorConfiguration actual, final YamlAdvisorConfiguration expected) {
Expand Down
10 changes: 5 additions & 5 deletions agent/core/src/test/resources/advisors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

advisors:
- target: org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask
advice: org.apache.shardingsphere.agent.metrics.api.advice.CommandExecutorTaskAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.CommandExecutorTaskAdvice
pointcuts:
- name: run
type: instance
- name: processException
type: instance
- target: org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler
advice: org.apache.shardingsphere.agent.metrics.api.advice.ChannelHandlerAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.ChannelHandlerAdvice
pointcuts:
- name: channelActive
type: instance
Expand All @@ -33,19 +33,19 @@ advisors:
- name: channelInactive
type: instance
- target: org.apache.shardingsphere.infra.route.engine.SQLRouteEngine
advice: org.apache.shardingsphere.agent.metrics.api.advice.SQLRouteEngineAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.SQLRouteEngineAdvice
pointcuts:
- name: route
type: instance
- target: org.apache.shardingsphere.proxy.backend.communication.jdbc.transaction.BackendTransactionManager
advice: org.apache.shardingsphere.agent.metrics.api.advice.TransactionAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.TransactionAdvice
pointcuts:
- name: commit
type: instance
- name: rollback
type: instance
- target: org.apache.shardingsphere.infra.config.datasource.JDBCParameterDecoratorHelper
advice: org.apache.shardingsphere.agent.metrics.api.advice.DataSourceAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.DataSourceAdvice
pointcuts:
- name: decorate
type: static
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

advisors:
- target: org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask
advice: org.apache.shardingsphere.agent.metrics.api.advice.CommandExecutorTaskAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.CommandExecutorTaskAdvice
pointcuts:
- name: run
type: instance
- name: processException
type: instance
- target: org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler
advice: org.apache.shardingsphere.agent.metrics.api.advice.ChannelHandlerAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.ChannelHandlerAdvice
pointcuts:
- name: channelActive
type: instance
Expand All @@ -33,19 +33,19 @@ advisors:
- name: channelInactive
type: instance
- target: org.apache.shardingsphere.infra.route.engine.SQLRouteEngine
advice: org.apache.shardingsphere.agent.metrics.api.advice.SQLRouteEngineAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.SQLRouteEngineAdvice
pointcuts:
- name: route
type: instance
- target: org.apache.shardingsphere.proxy.backend.communication.jdbc.transaction.JDBCBackendTransactionManager
advice: org.apache.shardingsphere.agent.metrics.api.advice.TransactionAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.TransactionAdvice
pointcuts:
- name: commit
type: instance
- name: rollback
type: instance
- target: org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine
advice: org.apache.shardingsphere.agent.metrics.api.advice.SQLParserEngineAdvice
advice: org.apache.shardingsphere.agent.metrics.core.advice.SQLParserEngineAdvice
pointcuts:
- name: parse
type: instance

0 comments on commit 1be8a5a

Please sign in to comment.