Skip to content

fix: 优化熔断插件实现,解决用户通配API内存占用过高问题 #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
958608f
feat: support trace reporting
andrewshan Jun 17, 2024
e7d4417
feat: restore version to 1.15.7-SNAPSHOT
andrewshan Jun 17, 2024
ea5261d
Merge branch 'polarismesh:main' into main
andrewshan Jun 17, 2024
b76ddf4
feat: add initService to AssemblyAPI
andrewshan Jun 17, 2024
1746201
test: add test for initService
andrewshan Jun 17, 2024
bc9f0f6
fix: TraceReporterConfig type mistake
andrewshan Jun 18, 2024
24bd7fc
Merge branch 'polarismesh:main' into main
andrewshan Jun 18, 2024
87dd61e
feat: support modify loglevel over parameter & support log in tracere…
andrewshan Jun 18, 2024
3f1a1bb
Merge branch 'polarismesh:main' into main
andrewshan Jun 18, 2024
5e2cb15
feat: 上报监控及调用链失败不抛异常
andrewshan Jun 18, 2024
c1d81a5
fix: 校验失败打印端口号
andrewshan Jun 19, 2024
b752339
fix: add toString method to all configration classes
andrewshan Jun 19, 2024
8e2d5a7
Merge branch 'polarismesh:main' into main
andrewshan Jul 10, 2024
ab1967c
fix: 修复通配API导致counter及healthChecker膨胀的问题
andrewshan Jul 10, 2024
0f95f41
fix: 去掉统一的错误统计时长的配置,放回插件化配置中
andrewshan Jul 11, 2024
1f99337
fix: 补齐测试用例
andrewshan Jul 11, 2024
1303c57
fix: testcase failure
andrewshan Jul 11, 2024
cf094aa
fix: test case failed by git test
andrewshan Jul 11, 2024
4ee7102
fix: test case failed
andrewshan Jul 11, 2024
3e0b849
fix: test case failure
andrewshan Jul 11, 2024
31b4290
fix: 健康检查变更影响范围过大问题
andrewshan Jul 14, 2024
566e341
fix: 解决探测规则生效多个的问题,只生效1个探测规则,并进行排序
andrewshan Jul 17, 2024
c738e26
fix: 修复用例失败问题
andrewshan Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,54 @@

package com.tencent.polaris.circuitbreak.api;

import java.io.Closeable;

import com.tencent.polaris.api.plugin.circuitbreaker.ResourceStat;
import com.tencent.polaris.api.plugin.circuitbreaker.entity.Resource;
import com.tencent.polaris.circuitbreak.api.pojo.CheckResult;
import com.tencent.polaris.circuitbreak.api.pojo.FunctionalDecoratorRequest;
import com.tencent.polaris.circuitbreak.api.pojo.InvokeContext;

public interface CircuitBreakAPI {

/**
* check and acquire circuitbreaker
*
* @param resource
* @return pass or not, and fallback config if needed
*/
CheckResult check(Resource resource);

/**
* report the resource invoke result
*
* @param reportStat
*/
void report(ResourceStat reportStat);


/**
* make the function decorator
*
* @param functionalDecoratorRequest
* @return decorator
*/
FunctionalDecorator makeFunctionalDecorator(FunctionalDecoratorRequest functionalDecoratorRequest);

/**
* make the invoke handler
* @param requestContext
* @return InvokeHandler
*/
InvokeHandler makeInvokeHandler(InvokeContext.RequestContext requestContext);
public interface CircuitBreakAPI extends AutoCloseable, Closeable {

/**
* check and acquire circuitbreaker
*
* @param resource
* @return pass or not, and fallback config if needed
*/
CheckResult check(Resource resource);

/**
* report the resource invoke result
*
* @param reportStat
*/
void report(ResourceStat reportStat);


/**
* make the function decorator
*
* @param functionalDecoratorRequest
* @return decorator
*/
FunctionalDecorator makeFunctionalDecorator(FunctionalDecoratorRequest functionalDecoratorRequest);

/**
* make the invoke handler
* @param requestContext
* @return InvokeHandler
*/
InvokeHandler makeInvokeHandler(InvokeContext.RequestContext requestContext);

/**
* 清理并释放资源
*/
void destroy();

@Override
default void close() {
destroy();
}
}
Loading
Loading