NetPro.Analysic 6.0.16

dotnet add package NetPro.Analysic --version 6.0.16
NuGet\Install-Package NetPro.Analysic -Version 6.0.16
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetPro.Analysic" Version="6.0.16" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetPro.Analysic --version 6.0.16
#r "nuget: NetPro.Analysic, 6.0.16"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NetPro.Analysic as a Cake Addin
#addin nuget:?package=NetPro.Analysic&version=6.0.16

// Install NetPro.Analysic as a Cake Tool
#tool nuget:?package=NetPro.Analysic&version=6.0.16

NetPro.Analysic使用

NuGet

同ip下对请求流量的精确控制,可控制1天 或者1小时内的错误数正确数

使用

appsetting.json
	"RequestAnalysisOption": {
		"Enabled": true, //是否开启流量分析
		"PolicyOption": [
			{
				"Enabled": true,
				"Path": "/api/v1/test/pay/post",
				"MaxSucceedLimit": 1000000, //当前path地址同ip一天内最大访问次数
				"MaxErrorLimit": 1000000,
				"HitDuration": "2d"  //触发限制的时间周期
				"LockDuration":"1d"//被锁定的持续时间
				"IsGlobalLock":true,
			},
			{
				"Enabled": true,
				"Path": "/api/v1/test/pay/post/account", 
				"MaxSucceedLimit": 100,
				"MaxErrorLimit": 50,
				"HitDuration": "2h"  //锁定持续2小时
			},
			{
				"Enabled": true,
				"Path": "/api/v1/test/pay/post/getname",
				"MaxSucceedLimit": 100,
				"MaxErrorLimit": 50,
				"HitDuration": "10m"  //锁定持续10分钟
			},
			{
				"Enabled": true,
				"Path": "/api/v1/test/pay/post/gatage",
				"MaxSucceedLimit": 100,
				"MaxErrorLimit": 50,
				"HitDuration": "10s"  //锁定持续10秒
			}
		]
	}

启用服务
方式一:
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
    services.AddRequestAnalysic();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseRequestAnalysis();
}
方式二:

如增加了以下环境变量配置,可省略方式一中的初始化代码,内部将自动执行以上初始化

 "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "NetPro.Startup"

TODO:


 全局接口熔断策略:
 20秒以内超过10次请求指定接口错误率超过20% 触发阈值  持续10秒熔断(指标都是可配置)
 全局接口限制策略:
 同ip1小时内错误数大于10次触发阈值(指标都是可配置)
 同ip1小时内请求数大于20次触发阈值(指标都是可配置)

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.0.16 165 7/24/2023
6.0.15 428 7/19/2022
6.0.14 419 7/10/2022
6.0.13 408 6/15/2022
6.0.12 408 6/15/2022
6.0.11 414 6/15/2022
6.0.10 434 6/11/2022
6.0.9 414 6/8/2022
6.0.8 447 5/26/2022
6.0.8-beta.3 103 5/24/2022
6.0.8-beta.2 104 5/24/2022
6.0.7 439 5/18/2022
6.0.6 436 4/28/2022
6.0.5 429 3/30/2022
6.0.5-beta.20 104 4/27/2022
6.0.5-beta.19 110 4/25/2022
6.0.5-beta.18 103 4/22/2022
6.0.5-beta.17 109 4/16/2022
6.0.5-beta.16 116 4/8/2022
6.0.5-beta.15 112 4/8/2022
6.0.5-beta.14 116 4/7/2022
6.0.5-beta.13 122 4/7/2022
6.0.5-beta.12 115 4/6/2022
6.0.5-beta.11 108 4/6/2022
6.0.5-beta.10 110 3/31/2022
6.0.5-beta.9 117 3/26/2022
6.0.5-beta.8 113 3/22/2022
6.0.5-beta.7 107 3/21/2022
6.0.5-beta.6 113 3/14/2022
6.0.5-beta.5 109 3/2/2022
6.0.5-beta.4 113 2/22/2022
6.0.5-beta.3 112 2/18/2022
6.0.5-beta.2 110 2/18/2022
6.0.5-beta.1 117 2/16/2022
6.0.4 459 2/10/2022
6.0.3 435 2/9/2022
6.0.3-beta.9 109 2/10/2022
6.0.3-beta.7 125 1/27/2022
6.0.3-beta.6 125 1/19/2022
6.0.3-beta.5 119 1/17/2022
6.0.3-beta.4 124 1/16/2022
6.0.3-beta.3 129 1/14/2022
6.0.3-beta.2 127 1/13/2022
6.0.3-beta.1 152 1/11/2022
6.0.2 321 1/6/2022
6.0.1 967 12/3/2021
3.1.0 435 9/27/2020