Release 2.6.2

This commit is contained in:
lancer.hong
2022-04-27 22:53:53 +08:00
parent e7f792a5d4
commit 0a10dfc71b
13 changed files with 51 additions and 34 deletions

View File

@@ -4,7 +4,7 @@ English | [简体中文](./README.md)
<a href="https://www.fizzgate.com"><img src="https://raw.githubusercontent.com/wiki/wehotel/fizz-gateway-community/img/icon-color.png" width="70%"></a>
</p>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.6.1-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-2.6.2-blue.svg?cacheSeconds=2592000" />
<a href="http://www.fizzgate.com/fizz-gateway-community/" target="_blank">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
</a>
@@ -122,6 +122,7 @@ Starting from v1.3.0, the frontend and backend of the management backend are mer
| v2.5.2 | v2.5.2 |
| v2.6.0 | v2.6.0 |
| v2.6.1 | v2.6.1 |
| v2.6.2 | v2.6.2 |
Please download the corresponding management backend version according to the version of the community version

View File

@@ -3,7 +3,7 @@
<a href="https://www.fizzgate.com"><img src="https://raw.githubusercontent.com/wiki/wehotel/fizz-gateway-community/img/icon-color.png" width="70%"></a>
</p>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.6.1-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-2.6.2-blue.svg?cacheSeconds=2592000" />
<a href="http://www.fizzgate.com/fizz-gateway-community/" target="_blank">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
</a>
@@ -120,6 +120,7 @@ API地址http://demo.fizzgate.com/proxy/[服务名]/[API_Path]
| v2.5.2 | v2.5.2 |
| v2.6.0 | v2.6.0 |
| v2.6.1 | v2.6.1 |
| v2.6.2 | v2.6.2 |
请根据社区版的版本下载对应的管理后台版本

View File

@@ -2,7 +2,7 @@ version: "3.6"
services:
fizz-mysql:
image: "fizzgate/fizz-mysql:2.6.2-beta1"
image: "fizzgate/fizz-mysql:2.6.2"
container_name: fizz-mysql
restart: always
hostname: fizz-mysql
@@ -27,7 +27,7 @@ services:
- fizz
fizz-gateway-community:
image: "fizzgate/fizz-gateway-community:2.6.2-beta1"
image: "fizzgate/fizz-gateway-community:2.6.2"
container_name: fizz-gateway-community
restart: always
hostname: fizz-gateway-community
@@ -48,7 +48,7 @@ services:
- fizz
fizz-manager-professional:
image: "fizzgate/fizz-manager-professional:2.6.2-beta1"
image: "fizzgate/fizz-manager-professional:2.6.2"
container_name: fizz-manager-professional
restart: always
hostname: fizz-manager-professional

View File

@@ -12,7 +12,7 @@
<groupId>com.fizzgate</groupId>
<artifactId>fizz-bootstrap</artifactId>
<version>2.6.2-beta1</version>
<version>2.6.2</version>
<properties>
<java.version>1.8</java.version>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>fizz-gateway-community</artifactId>
<groupId>com.fizzgate</groupId>
<version>2.6.2-beta1</version>
<version>2.6.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>fizz-gateway-community</artifactId>
<groupId>com.fizzgate</groupId>
<version>2.6.2-beta1</version>
<version>2.6.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -52,6 +52,10 @@ public class FlowStat {
*/
public static long INTERVAL = 1000;
public boolean cleanResource = true;
public boolean createTimeSlotOnlyTraffic = true;
/**
* A string Resource ID as key
*/
@@ -73,6 +77,12 @@ public class FlowStat {
runScheduleJob();
}
public FlowStat(boolean cleanResource, boolean createTimeSlotOnlyTraffic) {
this.cleanResource = cleanResource;
this.createTimeSlotOnlyTraffic = createTimeSlotOnlyTraffic;
runScheduleJob();
}
public FlowStat(CircuitBreakManager circuitBreakManager) {
this.circuitBreakManager = circuitBreakManager;
runScheduleJob();
@@ -588,7 +598,7 @@ public class FlowStat {
lastSlotId = slotId;
// log.debug("housekeeping done");
if (cleanResource) {
long currentTimeSlot = stat.currentTimeSlotId();
long startTimeSlot = currentTimeSlot - n;
for (Entry<String, ResourceStat> entry : stat.resourceStats.entrySet()) {
@@ -599,7 +609,7 @@ public class FlowStat {
ResourceStat resourceStat = entry.getValue();
boolean noTraffic = true;
long timeSlot = startTimeSlot;
for ( ; timeSlot < currentTimeSlot; timeSlot += FlowStat.INTERVAL) {
for (; timeSlot < currentTimeSlot; timeSlot += FlowStat.INTERVAL) {
int reqCnt = resourceStat.getTimeSlot(timeSlot).getCounter();
if (reqCnt > 0) {
noTraffic = false;
@@ -611,6 +621,7 @@ public class FlowStat {
log.info("HousekeepJob remove {}", resource);
}
}
}
try {
@@ -644,7 +655,9 @@ public class FlowStat {
// curTimeSlotId);
ResourceStat resourceStat = entry.getValue();
if (resourceStat.getConcurrentRequests().get() > 0) {
if (createTimeSlotOnlyTraffic && resourceStat.getConcurrentRequests().get() > 0) {
resourceStat.getTimeSlot(curTimeSlotId);
} else {
resourceStat.getTimeSlot(curTimeSlotId);
}

View File

@@ -319,13 +319,13 @@ public class CircuitBreaker {
public boolean transit(State current, State target, long currentTimeWindow, FlowStat flowStat) {
if (stateRef.compareAndSet(current, target)) {
stateStartTime = currentTimeWindow;
ResourceStat resourceStat = flowStat.getResourceStat(resource);
/*AtomicLong circuitBreakNum = resourceStat.getTimeSlot(currentTimeWindow).getCircuitBreakNum();
circuitBreakNum.set(0);*/
resourceStat.getTimeSlot(currentTimeWindow).setCircuitBreakNum(0);
resourceStat.updateCircuitBreakState(currentTimeWindow, current, target);
LOGGER.debug("transit {} current time window {} from {} which start at {} to {}", resource, currentTimeWindow, current, stateStartTime, target);
stateStartTime = currentTimeWindow;
return true;
}
return false;

View File

@@ -39,7 +39,7 @@ import we.util.JacksonUtils;
*/
public class FlowStatTests {
private FlowStat stat = new FlowStat();
private FlowStat stat = new FlowStat(false, false);
class FlowRuleCase {
public int threads = 3;

View File

@@ -68,6 +68,8 @@ public class CircuitBreakManagerTests {
@Test
void permitTest() {
FlowStat flowStat = new FlowStat(circuitBreakManager);
flowStat.cleanResource = false;
flowStat.createTimeSlotOnlyTraffic = false;
long currentTimeWindow = flowStat.currentTimeSlotId();
MockServerHttpRequest mockServerHttpRequest = MockServerHttpRequest.get("/xxx").build();

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>fizz-gateway-community</artifactId>
<groupId>com.fizzgate</groupId>
<version>2.6.2-beta1</version>
<version>2.6.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>fizz-gateway-community</artifactId>
<groupId>com.fizzgate</groupId>
<version>2.6.2-beta1</version>
<version>2.6.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -37,7 +37,7 @@
<artifactId>fizz-gateway-community</artifactId>
<name>${project.artifactId}</name>
<description>fizz gateway community</description>
<version>2.6.2-beta1</version>
<version>2.6.2</version>
<packaging>pom</packaging>
<modules>
<module>fizz-common</module>