NetPro.Analysic
6.0.5-beta.7
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Core 3.1
This package targets .NET Core 3.1. The package is compatible with this framework or higher.
This is a prerelease version of NetPro.Analysic.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package NetPro.Analysic --version 6.0.5-beta.7
NuGet\Install-Package NetPro.Analysic -Version 6.0.5-beta.7
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.5-beta.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetPro.Analysic --version 6.0.5-beta.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NetPro.Analysic, 6.0.5-beta.7"
#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.5-beta.7&prerelease // Install NetPro.Analysic as a Cake Tool #tool nuget:?package=NetPro.Analysic&version=6.0.5-beta.7&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NetPro.Analysic使用
同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 | Versions 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.
-
.NETCoreApp 3.1
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- NetPro.Core (>= 6.0.5-beta.7)
- NetPro.CsRedis (>= 6.0.5-beta.7)
-
net6.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- NetPro.Core (>= 6.0.5-beta.7)
- NetPro.CsRedis (>= 6.0.5-beta.7)
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 | 200 | 7/24/2023 |
6.0.15 | 456 | 7/19/2022 |
6.0.14 | 449 | 7/10/2022 |
6.0.13 | 434 | 6/15/2022 |
6.0.12 | 434 | 6/15/2022 |
6.0.11 | 438 | 6/15/2022 |
6.0.10 | 461 | 6/11/2022 |
6.0.9 | 439 | 6/8/2022 |
6.0.8 | 475 | 5/26/2022 |
6.0.8-beta.3 | 115 | 5/24/2022 |
6.0.8-beta.2 | 115 | 5/24/2022 |
6.0.7 | 468 | 5/18/2022 |
6.0.6 | 467 | 4/28/2022 |
6.0.5 | 457 | 3/30/2022 |
6.0.5-beta.20 | 114 | 4/27/2022 |
6.0.5-beta.19 | 120 | 4/25/2022 |
6.0.5-beta.18 | 113 | 4/22/2022 |
6.0.5-beta.17 | 120 | 4/16/2022 |
6.0.5-beta.16 | 127 | 4/8/2022 |
6.0.5-beta.15 | 123 | 4/8/2022 |
6.0.5-beta.14 | 127 | 4/7/2022 |
6.0.5-beta.13 | 134 | 4/7/2022 |
6.0.5-beta.12 | 125 | 4/6/2022 |
6.0.5-beta.11 | 122 | 4/6/2022 |
6.0.5-beta.10 | 121 | 3/31/2022 |
6.0.5-beta.9 | 127 | 3/26/2022 |
6.0.5-beta.8 | 123 | 3/22/2022 |
6.0.5-beta.7 | 118 | 3/21/2022 |
6.0.5-beta.6 | 124 | 3/14/2022 |
6.0.5-beta.5 | 122 | 3/2/2022 |
6.0.5-beta.4 | 121 | 2/22/2022 |
6.0.5-beta.3 | 122 | 2/18/2022 |
6.0.5-beta.2 | 120 | 2/18/2022 |
6.0.5-beta.1 | 126 | 2/16/2022 |
6.0.4 | 487 | 2/10/2022 |
6.0.3 | 458 | 2/9/2022 |
6.0.3-beta.9 | 119 | 2/10/2022 |
6.0.3-beta.7 | 134 | 1/27/2022 |
6.0.3-beta.6 | 133 | 1/19/2022 |
6.0.3-beta.5 | 128 | 1/17/2022 |
6.0.3-beta.4 | 133 | 1/16/2022 |
6.0.3-beta.3 | 138 | 1/14/2022 |
6.0.3-beta.2 | 136 | 1/13/2022 |
6.0.3-beta.1 | 162 | 1/11/2022 |
6.0.2 | 347 | 1/6/2022 |
6.0.1 | 994 | 12/3/2021 |
3.1.0 | 465 | 9/27/2020 |