lith il y a 4 ans
Parent
commit
7b9d7ec016
54 fichiers modifiés avec 357 ajouts et 53 suppressions
  1. 2 1
      dotnet/Library/Sers/Sers.Core/Sers.Core/CL/CommunicationManage/CommunicationManageClient.cs
  2. 2 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/CL/MessageOrganize/DefaultOrganize/Extensions/IOrganizeConnectionExtensions.cs
  3. 5 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/CL/MessageOrganize/DefaultOrganize/RequestAdaptor.cs
  4. 9 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiDesc/Extensions/SsApiDescExtensions.cs
  5. 1 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/AccountInCookie/AccountInCookie.cs
  6. 3 1
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/Bearer/Bearer.cs
  7. 2 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/Bearer/Extensions/RpcContextDataExtensions.cs
  8. 2 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/LocalApi/ApiTrace/ApiScope_Log.cs
  9. 2 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/LocalApi/ApiTrace/ApiTraceLog.cs
  10. 2 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/LocalApi/StaticFileTransmit/FileExtensionContentTypeProvider.cs
  11. 7 3
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/LocalApi/StaticFileTransmit/StaticFileMap.cs
  12. 3 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/RouteMap/GenericRouteMap.cs
  13. 1 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Counter/Counter.cs
  14. 2 1
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Env/UsageReporter.cs
  15. 2 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/RpcContext.cs
  16. 1 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/RpcContextData.cs
  17. 4 2
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Valid/Sers1/RpcVerify1.cs
  18. 1 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Valid/Sers2/RpcVerify2.cs
  19. 2 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/SersLoader/ApiLoader.cs
  20. 4 2
      dotnet/Library/Sers/Sers.Core/Sers.Core/Util/StreamSecurity/Security/SampleSecurity.cs
  21. 3 1
      dotnet/Library/Sers/Sers.Core/Sers.Core/Util/StreamSecurity/SecurityManager.cs
  22. 1 0
      dotnet/Library/Sers/Sers.Gateway/Sers.Gateway/Extensions/HttpRequestExtensions.cs
  23. 6 4
      dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/ExceptionFilter/ExceptionFilter.cs
  24. 10 0
      dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/SerslotServer.cs
  25. 1 7
      dotnet/Library/Vit/Vit.Core/Vit.Core/Extensions/byte/Base64StringExtensions.cs
  26. 16 1
      dotnet/Library/Vit/Vit.Core/Vit.Core/Module/Log/LogMng.cs
  27. 8 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Module/Log/Logger.cs
  28. 2 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Common/CommonHelp.cs
  29. 7 1
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ComponentModel/Data/ApiReturn.cs
  30. 14 2
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ComponentModel/SsError/Extensions/ExceptionExtensions.cs
  31. 1 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ComponentModel/SsError/Extensions/SsErrorExtensions.cs
  32. 3 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ComponentModel/SsError/SsError.cs
  33. 2 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ConfigurationManager/ConfigurationManager.cs
  34. 9 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ConfigurationManager/JsonFile.cs
  35. 1 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Disposable.cs
  36. 4 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Extensible/Extensible.cs
  37. 4 1
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Guid/Snowflake.cs
  38. 5 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Net/HttpClient.cs
  39. 27 2
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Net/HttpUtil.cs
  40. 2 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Net/NetHelp.cs
  41. 3 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/SsExp/SsExpCalculator.cs
  42. 4 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/AsyncCacheHelper.cs
  43. 2 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/LongTaskHelp_TimeLimit.cs
  44. 1 0
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/TaskQueue.cs
  45. 15 3
      dotnet/ServiceCenter/Sers.ServiceCenter/Apm/Sers.Gover.Apm.Zipkin/AppEvent.cs
  46. 1 0
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/ApiLoadBalancingMng.cs
  47. 1 0
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/ApiStationMng.cs
  48. 1 0
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/Extensions/ServiceStationExtensions.cs
  49. 4 1
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/Model/ApiStationData.cs
  50. 1 0
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/ServiceStationMng.cs
  51. 89 20
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Controllers/ApiControllers/ServiceCenterController.cs
  52. 8 0
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Extensions/ServiceCenter_GoverExtensions.cs
  53. 3 0
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter/Entity/ServiceStation.cs
  54. 41 0
      dotnet/ServiceStation/Demo/StressTest/App.Robot.Station/Controllers/StatisticsController.cs

+ 2 - 1
dotnet/Library/Sers/Sers.Core/Sers.Core/CL/CommunicationManage/CommunicationManageClient.cs

@@ -44,7 +44,8 @@ namespace Sers.Core.CL.CommunicationManage
         public Action<IOrganizeConnection,ArraySegment<byte>> conn_OnGetMessage{   get; set;   }
         #endregion
 
-        #region SendMessageAsync      
+        #region SendMessageAsync    
+        
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public void SendMessageAsync(Vit.Core.Util.Pipelines.ByteData message)
         {

+ 2 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/CL/MessageOrganize/DefaultOrganize/Extensions/IOrganizeConnectionExtensions.cs

@@ -6,6 +6,8 @@ namespace Vit.Extensions
 {
     public static partial class IOrganizeConnectionExtensions
     {
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         internal static IDeliveryConnection GetDeliveryConn(this IOrganizeConnection data)
         {
             return (data as OrganizeConnection)?.deliveryConn;

+ 5 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/CL/MessageOrganize/DefaultOrganize/RequestAdaptor.cs

@@ -471,6 +471,7 @@ namespace Sers.Core.CL.MessageOrganize.DefaultOrganize
         {
             public readonly List<HeartBeatPackage> list = new List<HeartBeatPackage>();
 
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             public bool IsDisconnected(int heartBeatRetryCount)
             {
                 while (list.Count > 0 && list[0].timeouted == false)
@@ -532,6 +533,8 @@ namespace Sers.Core.CL.MessageOrganize.DefaultOrganize
         }
         Dictionary<IOrganizeConnection , HeartBeatInfo> HeartBeat_info_Before = new Dictionary<IOrganizeConnection , HeartBeatInfo>();
         Dictionary<IOrganizeConnection , HeartBeatInfo> HeartBeat_info_cur = new Dictionary<IOrganizeConnection , HeartBeatInfo>();
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         void HeartBeat_CheckIfDisconnectedAndSendHeartBeat(IOrganizeConnection conn)
         {
             if (HeartBeat_info_Before.TryGetValue(conn, out var info))
@@ -554,6 +557,7 @@ namespace Sers.Core.CL.MessageOrganize.DefaultOrganize
 
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         HeartBeatPackage HeartBeat_Send(IOrganizeConnection conn)
         {
             var p = new HeartBeatPackage() { timeoutTime = DateTime.Now.AddMilliseconds(heartBeatTimeoutMs), conn = conn };
@@ -561,6 +565,7 @@ namespace Sers.Core.CL.MessageOrganize.DefaultOrganize
             return p;
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         void HeartBeat_callback(object sender,Vit.Core.Util.Pipelines.ByteData replyData)
         {
             HeartBeatPackage package = sender as HeartBeatPackage;

+ 9 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiDesc/Extensions/SsApiDescExtensions.cs

@@ -7,6 +7,7 @@ namespace Vit.Extensions
     {
 
         #region ApiStationName     
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string ApiStationNameGet(this SsApiDesc data)
         {
             try
@@ -28,6 +29,7 @@ namespace Vit.Extensions
         /// </summary>
         /// <param name="data"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string ServiceKeyGet(this SsApiDesc data)
         {
             try
@@ -45,12 +47,14 @@ namespace Vit.Extensions
 
         #region HttpMethod
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string HttpMethodGet(this SsApiDesc data)
         {
             return data?.extendConfig?.Value<string>("httpMethod");
         }
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void HttpMethodSet(this SsApiDesc data,string httpMethod)
         {
             if (data.extendConfig == null)
@@ -64,12 +68,14 @@ namespace Vit.Extensions
 
         #region OriRoute
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string OriRouteGet(this SsApiDesc data)
         {
             return data?.extendConfig?.Value<string>("oriRoute");
         }
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void OriRouteSet(this SsApiDesc data, string oriRoute)
         {
             if (data.extendConfig == null)
@@ -83,11 +89,13 @@ namespace Vit.Extensions
 
         #region sysDesc
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string SysDescGet(this SsApiDesc data)
         {
             return data?.extendConfig?.Value<string>("sysDesc");
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void SysDescSet(this SsApiDesc data, string value)
         {
             if (data.extendConfig == null)
@@ -96,6 +104,7 @@ namespace Vit.Extensions
             data.extendConfig["sysDesc"] = value;
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string SysDescAppend(this SsApiDesc data, string value)
         {
             value = SysDescGet(data) + value;

+ 1 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/AccountInCookie/AccountInCookie.cs

@@ -57,6 +57,7 @@ namespace Sers.Core.Module.Api.ApiEvent.BeforeCallApi.AccountInCookie
         /// </summary>
         /// <param name="rpcData"></param>
         /// <param name="requestMessage"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void BeforeCallApi(RpcContextData rpcData, ApiMessage requestMessage)
         {
             try

+ 3 - 1
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/Bearer/Bearer.cs

@@ -25,6 +25,7 @@ namespace Sers.Core.Module.Api.ApiEvent.BeforeCallApi.Bearer
         string Api_verifyAt;
         string Api_httpMethod;
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         ApiReturn<Object> VerifyAt(string at)
         {
             //var arg = "{\"at\":\"" + at + "\"}";
@@ -32,13 +33,14 @@ namespace Sers.Core.Module.Api.ApiEvent.BeforeCallApi.Bearer
         }
 
 
-      
+
 
         /// <summary>
         /// Bearer。 转换at为对应的用户
         /// </summary>
         /// <param name="rpcData"></param>
         /// <param name="requestMessage"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void BeforeCallApi(RpcContextData rpcData, ApiMessage requestMessage)
         {
             try

+ 2 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/Bearer/Extensions/RpcContextDataExtensions.cs

@@ -8,6 +8,7 @@ namespace Vit.Extensions
     public static partial class RpcContextDataExtensions
     {
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string Bearer_Get(this RpcContextData rpcData)
         {
             //http.headers.Authorization = "Bearer atxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
@@ -19,6 +20,7 @@ namespace Vit.Extensions
             return bear;
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Bearer_Set(this RpcContextData rpcData, string value)
         {
             if (null == rpcData || string.IsNullOrWhiteSpace(value)) return;

+ 2 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/LocalApi/ApiTrace/ApiScope_Log.cs

@@ -8,10 +8,12 @@ namespace Sers.Core.Module.Api.LocalApi.ApiTrace
 {
     class ApiScope_Log : IApiScopeEvent
     {
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Init(JObject config)
         {       
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public IDisposable OnCreateScope()
         {
             return new ApiTraceLog();

+ 2 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/LocalApi/ApiTrace/ApiTraceLog.cs

@@ -15,6 +15,7 @@ namespace Sers.Core.Module.Api.LocalApi.ApiTrace
             beginTime = DateTime.Now;
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static void LogTrace(ApiTraceLog trace)
         {
 
@@ -65,6 +66,7 @@ namespace Sers.Core.Module.Api.LocalApi.ApiTrace
         }
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Dispose()
         {
             endTime = DateTime.Now;

+ 2 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/LocalApi/StaticFileTransmit/FileExtensionContentTypeProvider.cs

@@ -439,6 +439,7 @@ namespace Sers.Core.Module.Api.LocalApi.StaticFileTransmit
         /// <param name="subpath">A file path</param>
         /// <param name="contentType">The resulting MIME type</param>
         /// <returns>True if MIME type could be determined</returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public bool TryGetContentType(string subpath, out string contentType)
         {
             string extension = GetExtension(subpath);
@@ -450,6 +451,7 @@ namespace Sers.Core.Module.Api.LocalApi.StaticFileTransmit
             return Mappings.TryGetValue(extension, out contentType);
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         private static string GetExtension(string path)
         {
             if (string.IsNullOrWhiteSpace(path))

+ 7 - 3
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/LocalApi/StaticFileTransmit/StaticFileMap.cs

@@ -115,6 +115,7 @@ namespace Sers.Core.Module.Api.LocalApi.StaticFileTransmit
         /// <para>(若 route为"/Station1/fold1/a/*",url为"http://127.0.0.1/Station1/fold1/a/1/2.html?c=9",则 relativePath为"1/2.html")</para>
         /// </summary>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public string GetRelativePath()
         {
             return RpcContext.RpcData.http_url_RelativePath_Get();
@@ -124,6 +125,7 @@ namespace Sers.Core.Module.Api.LocalApi.StaticFileTransmit
         /// 获取当前url映射到文件系统中的绝对路径。demo:"/root/netapp/FileStorage/wwwroot/fold2/a.html"
         /// </summary>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public string GetAbsFilePath()
         {
             var relativePath = GetRelativePath();
@@ -139,14 +141,14 @@ namespace Sers.Core.Module.Api.LocalApi.StaticFileTransmit
 
         #region TransmitFile
 
-      
-
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public byte[] TransmitFile()
         {
             return TransmitFile(GetAbsFilePath());
         }
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public byte[] TransmitFile(string absFilePath)
         {
             var fileInfo = new FileInfo(absFilePath);
@@ -187,10 +189,11 @@ namespace Sers.Core.Module.Api.LocalApi.StaticFileTransmit
         #endregion
 
 
-  
 
 
 
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public byte[] DownloadFile(string absFilePath, string fileName=null)
         {
             if (string.IsNullOrEmpty(absFilePath))
@@ -207,6 +210,7 @@ namespace Sers.Core.Module.Api.LocalApi.StaticFileTransmit
         #region static DownloadFile
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static byte[] DownloadFile(string absFilePath, string contentType, string fileName = null)
         {
             var fileInfo = new FileInfo(absFilePath);

+ 3 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/RouteMap/GenericRouteMap.cs

@@ -91,6 +91,7 @@ namespace Sers.Core.Module.Api.RouteMap
                 return BuildPath(path.Split('/'), 1);
 
             }
+
             [MethodImpl(MethodImplOptions.AggressiveInlining)]
             Tree<T> BuildPath(string[] path, int index)
             {
@@ -107,6 +108,7 @@ namespace Sers.Core.Module.Api.RouteMap
                 }
                 return tree.BuildPath(path, index + 1);
             }
+
             /// <summary>
             /// path demo:  "/station1/fold2/api1/action2"
             /// </summary>
@@ -140,6 +142,7 @@ namespace Sers.Core.Module.Api.RouteMap
             {
                 return GetChildren(path.Split('/'), 1);
             }
+
             [MethodImpl(MethodImplOptions.AggressiveInlining)]
             Tree<T> GetChildren(string[] path, int index)
             {

+ 1 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Counter/Counter.cs

@@ -18,6 +18,7 @@ namespace Sers.Core.Module.Counter
         /// 计数时 向上级报告
         /// </summary>
         /// <param name="parentCounter"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void ReportTo(Counter parentCounter)
         {
             this.parentCounter = parentCounter;

+ 2 - 1
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Env/UsageReporter.cs

@@ -12,7 +12,8 @@ namespace Sers.Core.Module.Env
 
         public const string Pubsub_UsageInfoReportTitle = "Sers_Sys_UsageInfo";
 
- 
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Publish()
         { 
             try

+ 2 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/RpcContext.cs

@@ -27,6 +27,7 @@ namespace Sers.Core.Module.Rpc
 
         #region 构造函数 和 Dispose
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public RpcContext()
         {
             //lock (CurrentRpcContext_AsyncCache)
@@ -35,6 +36,7 @@ namespace Sers.Core.Module.Rpc
             //}
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual void Dispose()
         {
             //lock (CurrentRpcContext_AsyncCache)

+ 1 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/RpcContextData.cs

@@ -59,6 +59,7 @@ namespace Sers.Core.Module.Rpc
             return Serialization.SerializeToBytes(this);     
         }
 
+
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static RpcContextData FromBytes(ArraySegment<byte>data)
         {

+ 4 - 2
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Valid/Sers1/RpcVerify1.cs

@@ -22,7 +22,7 @@ namespace Sers.Core.Module.Valid.Sers1
         //    return validations;
         //}
 
-  
+
         /*
        [   
             SsRegex("^\\d{11}$", ErrorMessage = "手机号格式不正确,不是11位"),
@@ -43,6 +43,7 @@ namespace Sers.Core.Module.Valid.Sers1
          *
          */
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static bool Verify(JObject obj, List<SsValidation> validations,   out SsError ssError)
         {
             ssError = null;
@@ -60,7 +61,8 @@ namespace Sers.Core.Module.Valid.Sers1
         }
 
 
- 
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static bool Valid(JObject obj, SsValidation validation)
         {
            

+ 1 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Valid/Sers2/RpcVerify2.cs

@@ -8,6 +8,7 @@ namespace Sers.Core.Module.Valid.Sers2
 {
     public class RpcVerify2
     {
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static bool Verify(JObject rpcData, JObject ssExp, out SsError ssError)
         {
             ssError = null;

+ 2 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/SersLoader/ApiLoader.cs

@@ -149,6 +149,7 @@ namespace Sers.SersLoader
 
         #region GetStationName
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected virtual List<String> GetStationNames(ApiLoaderConfig config, Type type)
         {
             //(优先级从高到低:  apiStationName_Force 、 在代码上的SsStationNameAttribute特性指定 、 apiStationName 、 appsettings.json指定)
@@ -194,6 +195,7 @@ namespace Sers.SersLoader
 
         #region GetRoutePrefix
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected virtual List<String> GetRoutePrefixs(ApiLoaderConfig config, Type type)
         {
             //(优先级从高到低:  routePrefix_Force、在代码上的SsRoutePrefixAttribute特性指定 、 routePrefix)

+ 4 - 2
dotnet/Library/Sers/Sers.Core/Sers.Core/Util/StreamSecurity/Security/SampleSecurity.cs

@@ -58,8 +58,9 @@ namespace Sers.Core.Util.StreamSecurity.Security
 
         byte[] secretBytes;
         int secretLength;
-      
 
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Decryption(ArraySegment<byte> data)
         {
             
@@ -89,7 +90,8 @@ namespace Sers.Core.Util.StreamSecurity.Security
 
 
 
-     
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Encryption(ArraySegment<byte> data)
         {
            

+ 3 - 1
dotnet/Library/Sers/Sers.Core/Sers.Core/Util/StreamSecurity/SecurityManager.cs

@@ -49,6 +49,7 @@ namespace Sers.Core.Util.StreamSecurity
         }
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Encryption(ArraySegment<byte> data)
         {
             foreach (var security in securitys)
@@ -56,7 +57,8 @@ namespace Sers.Core.Util.StreamSecurity
                 security.Encryption(data);
             }
         }
- 
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Decryption(ArraySegment<byte> data)
         {
             for(int t= securitys.Length-1;t>=0;t--)

+ 1 - 0
dotnet/Library/Sers/Sers.Gateway/Sers.Gateway/Extensions/HttpRequestExtensions.cs

@@ -6,6 +6,7 @@ namespace Vit.Extensions
 {
     public static class HttpRequestExtensions
     {
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string GetAbsoluteUri(this HttpRequest request)
         {
             return new StringBuilder()

+ 6 - 4
dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/ExceptionFilter/ExceptionFilter.cs

@@ -20,8 +20,9 @@ namespace Sers.Serslot.ExceptionFilter
         /// <summary>
         /// 发生异常时进入
         /// </summary>
-        /// <param name="context"></param>
-        public void OnException(ExceptionContext context)
+        /// <param name="context"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+        public void OnException(ExceptionContext context)
         {
             if (context.ExceptionHandled == false)
             {
@@ -31,7 +32,7 @@ namespace Sers.Serslot.ExceptionFilter
 
                 context.Result = new ContentResult
                 {
-                    Content = apiRet.Serialize(),//这里是把异常抛出。也可以不抛出。
+                    Content = apiRet.Serialize(),//这里是把异常抛出。也可以不抛出。
                     StatusCode = StatusCodes.Status200OK,
                     ContentType = Response_ContentType_Json
                 };
@@ -46,7 +47,8 @@ namespace Sers.Serslot.ExceptionFilter
         /// 异步发生异常时进入
         /// </summary>
         /// <param name="context"></param>
-        /// <returns></returns>
+        /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public Task OnExceptionAsync(ExceptionContext context)
         {
             OnException(context);

+ 10 - 0
dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/SerslotServer.cs

@@ -38,6 +38,7 @@ namespace Sers.Serslot
 
         Action<FeatureCollection> OnProcessRequest;
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public IHttpResponseFeature ProcessRequest(HttpRequestFeature requestFeature)
         {
             if (requestFeature.Headers == null)
@@ -119,6 +120,7 @@ namespace Sers.Serslot
 
 
             #region OnStarting
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             public virtual void OnStarting(Func<object, Task> callback, object state)
             {
                 lock (this)
@@ -136,6 +138,7 @@ namespace Sers.Serslot
                 }
             }
 
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             public Task FireOnStarting()
             {
                 Stack<KeyValuePair<Func<object, Task>, object>> onStarting;
@@ -156,6 +159,8 @@ namespace Sers.Serslot
 
             }
 
+
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             private Task FireOnStartingMayAwait(Stack<KeyValuePair<Func<object, Task>, object>> onStarting)
             {
                 try
@@ -179,6 +184,7 @@ namespace Sers.Serslot
                 return Task.CompletedTask;
             }
 
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             private async Task FireOnStartingAwaited(Task currentTask, Stack<KeyValuePair<Func<object, Task>, object>> onStarting)
             {
                 try
@@ -201,6 +207,7 @@ namespace Sers.Serslot
 
 
             #region OnCompleted           
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             public virtual void OnCompleted(Func<object, Task> callback, object state)
             {
                 lock (this)
@@ -213,6 +220,8 @@ namespace Sers.Serslot
                 }
             }
             Stack<KeyValuePair<Func<object, Task>, object>> onCompleted = null;
+
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             public Task FireOnCompleted()
             {
                 Stack<KeyValuePair<Func<object, Task>, object>> onCompleted;
@@ -230,6 +239,7 @@ namespace Sers.Serslot
                 return FireOnCompletedAwaited(onCompleted);
             }
 
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             private async Task FireOnCompletedAwaited(Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
             {
                 foreach (var entry in onCompleted)

+ 1 - 7
dotnet/Library/Vit/Vit.Core/Vit.Core/Extensions/byte/Base64StringExtensions.cs

@@ -20,13 +20,7 @@ namespace Vit.Extensions
         {
             return Convert.FromBase64String(data);
         }
-        #endregion
-
-
-     
-
-
-         
+        #endregion         
 
 
     }

+ 16 - 1
dotnet/Library/Vit/Vit.Core/Vit.Core/Module/Log/LogMng.cs

@@ -14,6 +14,7 @@ namespace Vit.Core.Module.Log
         #region LogTxt
         public string NewLine = Environment.NewLine;
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void LogTxt(Level level, string message)
         {
             //加锁 以避免多线程抢占文件错误
@@ -30,6 +31,7 @@ namespace Vit.Core.Module.Log
         class LogFilePathCache
         {
 
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             public void SetBasePath(string path)
             {
                 BasePath = path;
@@ -50,6 +52,7 @@ namespace Vit.Core.Module.Log
 
             string[] paths;
 
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             public LogFilePathCache()
             {
                 Level[] vs = (Level[])Enum.GetValues(typeof(Level));
@@ -58,6 +61,7 @@ namespace Vit.Core.Module.Log
 
             }
 
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             public string GetPath(Level level)
             {
                 if (DateTime.Now.Date != directoryDate)
@@ -93,6 +97,7 @@ namespace Vit.Core.Module.Log
 
         LogFilePathCache fileCache = new LogFilePathCache();
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         private string GetLogPath(Level level)
         {
             return fileCache.GetPath(level);
@@ -111,6 +116,8 @@ namespace Vit.Core.Module.Log
         ///  例如    (level, msg)=> { Console.WriteLine("[" + level + "]" + DateTime.Now.ToString("[HH:mm:ss.ffff]") + msg);   };
         /// </summary>
         public Action<Level, string> OnLog = null;
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Log(Level level, string message)
         {
             try
@@ -128,6 +135,7 @@ namespace Vit.Core.Module.Log
         /// DEBUG (调试信息):记录系统用于调试的一切信息,内容或者是一些关键数据内容的输出
         /// </summary>
         /// <param name="message"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Debug(string message)
         {
             Log(Level.DEBUG, message);
@@ -137,7 +145,8 @@ namespace Vit.Core.Module.Log
         /// INFO(一般信息):记录系统运行中应该让用户知道的基本信息。例如,服务开始运行,功能已经开户等。
         /// </summary>
         /// <param name="message"></param>
-        public  void Info( string message)
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+        public void Info( string message)
         {
             Log(Level.INFO, message);
         }
@@ -147,6 +156,7 @@ namespace Vit.Core.Module.Log
         /// ERROR(一般错误):记录系统中出现的导致系统不稳定,部分功能出现混乱或部分功能失效一类的错误。例如,数据字段为空,数据操作不可完成,操作出现异常等。
         /// </summary>
         /// <param name="message"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Error(string message)
         {
             Log(Level.ERROR, message);
@@ -158,6 +168,7 @@ namespace Vit.Core.Module.Log
 
         #region 对外 扩展
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Info(object message)
         {
             Info(message.Serialize());
@@ -169,6 +180,7 @@ namespace Vit.Core.Module.Log
         /// ERROR(一般错误):记录系统中出现的导致系统不稳定,部分功能出现混乱或部分功能失效一类的错误。例如,数据字段为空,数据操作不可完成,操作出现异常等。
         /// </summary>
         /// <param name="ex"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Error(Exception ex)
         {
             Error(null, ex);
@@ -179,6 +191,7 @@ namespace Vit.Core.Module.Log
         /// </summary> 
         /// <param name="message"></param>
         /// <param name="ex"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Error(string message, Exception ex)
         {
             //if (string.IsNullOrWhiteSpace(message)) message = ex.Message;
@@ -200,6 +213,7 @@ namespace Vit.Core.Module.Log
         /// 
         /// </summary>
         /// <param name="ssError"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Error(SsError ssError)
         {
             Error(null, ssError);
@@ -210,6 +224,7 @@ namespace Vit.Core.Module.Log
         /// </summary>
         /// <param name="message"></param>
         /// <param name="ssError"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Error(string message, SsError ssError)
         {
             var strMsg = "";

+ 8 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Module/Log/Logger.cs

@@ -30,6 +30,7 @@ namespace Vit.Core.Module.Log
         /// DEBUG (调试信息):记录系统用于调试的一切信息,内容或者是一些关键数据内容的输出
         /// </summary>
         /// <param name="message"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Debug(string message)
         {
             log.Debug(message);
@@ -41,11 +42,13 @@ namespace Vit.Core.Module.Log
         /// INFO(一般信息):记录系统运行中应该让用户知道的基本信息。例如,服务开始运行,功能已经开户等。
         /// </summary>
         /// <param name="message"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Info(string message)
         {
             log.Info(message);
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Info(object message)
         {
             log.Info(message);
@@ -60,6 +63,7 @@ namespace Vit.Core.Module.Log
         /// ERROR(一般错误):记录系统中出现的导致系统不稳定,部分功能出现混乱或部分功能失效一类的错误。例如,数据字段为空,数据操作不可完成,操作出现异常等。
         /// </summary>
         /// <param name="message"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Error(string message)
         {
             log.Error(message);
@@ -69,6 +73,7 @@ namespace Vit.Core.Module.Log
         /// ERROR(一般错误):记录系统中出现的导致系统不稳定,部分功能出现混乱或部分功能失效一类的错误。例如,数据字段为空,数据操作不可完成,操作出现异常等。
         /// </summary>
         /// <param name="ex"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Error(Exception ex)
         {
             log.Error(null, ex);
@@ -79,6 +84,7 @@ namespace Vit.Core.Module.Log
         /// </summary> 
         /// <param name="message"></param>
         /// <param name="ex"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Error(string message, Exception ex)
         {        
             log.Error(message,ex);
@@ -88,6 +94,7 @@ namespace Vit.Core.Module.Log
         /// 
         /// </summary>
         /// <param name="ssError"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Error(SsError ssError)
         {
             log.Error(ssError);
@@ -98,6 +105,7 @@ namespace Vit.Core.Module.Log
         /// </summary>
         /// <param name="message"></param>
         /// <param name="ssError"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Error(string message, SsError ssError)
         {
             log.Error(message,ssError);

+ 2 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Common/CommonHelp.cs

@@ -19,6 +19,7 @@ namespace Vit.Core.Util.Common
         /// </summary>
         /// <param name="path"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string GetAbsPath(params string[] path)
         {
             if (path == null || path.Length == 0) return AppContext.BaseDirectory;
@@ -82,6 +83,7 @@ Debug.WriteLine(guid.ToString("X"));//{0x1f3c6041,0xc68f,0x4ab3,{0xae,0x19,0xf6,
         /// </summary>
         /// <param name="source">源字符串</param>
         /// <returns>加密后的字符串</returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string MD5(string source)
         {
             MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();

+ 7 - 1
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ComponentModel/Data/ApiReturn.cs

@@ -52,6 +52,7 @@ namespace Vit.Core.Util.ComponentModel.Data
         /// 
         /// </summary>
         /// <param name="error"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static implicit operator ApiReturn(SsError.SsError error)
         {
             return new ApiReturn() { success = false, error = error };
@@ -61,11 +62,13 @@ namespace Vit.Core.Util.ComponentModel.Data
         /// 
         /// </summary>
         /// <param name="success"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static implicit operator ApiReturn(bool success)
         {
             return new ApiReturn(success);
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static implicit operator ApiReturn(Exception ex)
         {
             return (SsError.SsError)ex;
@@ -88,7 +91,7 @@ namespace Vit.Core.Util.ComponentModel.Data
         /// </summary>
         [SsDescription("数据")]
         public T data;
-                                   
+
 
 
 
@@ -96,6 +99,7 @@ namespace Vit.Core.Util.ComponentModel.Data
         /// 隐式转换
         /// </summary>
         /// <param name="value"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static implicit operator ApiReturn<T>(T value)
         {
             return new ApiReturn<T>(value);
@@ -106,6 +110,7 @@ namespace Vit.Core.Util.ComponentModel.Data
         /// 
         /// </summary>
         /// <param name="error"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static implicit operator ApiReturn<T>(SsError.SsError error)
         {
             return new ApiReturn<T>(){ success = false, error = error };
@@ -115,6 +120,7 @@ namespace Vit.Core.Util.ComponentModel.Data
         /// 
         /// </summary>
         /// <param name="success"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static implicit operator ApiReturn<T>(bool success)
         {
             return new ApiReturn<T>() { success=success};

+ 14 - 2
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ComponentModel/SsError/Extensions/ExceptionExtensions.cs

@@ -16,6 +16,7 @@ namespace Vit.Extensions
         /// <param name="ex"></param>
         /// <param name="key"></param>
         /// <param name="data"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Data_Set<Type>(this Exception ex, string key,Type data)
         {
             if (ex == null)
@@ -33,6 +34,7 @@ namespace Vit.Extensions
         /// <param name="ex"></param>
         /// <param name="key"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static Type Data_Get<Type>(this Exception ex, string key)
         {
             if (ex == null)
@@ -52,6 +54,7 @@ namespace Vit.Extensions
         /// <param name="ex"></param>
         /// <param name="ErrorCode"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static Exception ErrorCode_Set(this Exception ex,int? ErrorCode)
         {
             ex.Data_Set("ErrorCode", ErrorCode);
@@ -63,6 +66,7 @@ namespace Vit.Extensions
         /// </summary>
         /// <param name="ex"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static int? ErrorCode_Get(this Exception ex)
         {
             return ex.Data_Get<int?>("ErrorCode");
@@ -78,12 +82,14 @@ namespace Vit.Extensions
         /// <param name="ex"></param>
         /// <param name="ErrorMessage"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static Exception ErrorMessage_Set(this Exception ex, string ErrorMessage)
         {
             ex.Data_Set("ErrorMessage", ErrorMessage);
             return ex;
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string ErrorMessage_Get(this Exception ex)
         {
             return ex.Data_Get<string>("ErrorMessage")??ex.Message;
@@ -97,6 +103,7 @@ namespace Vit.Extensions
         /// </summary>
         /// <param name="ex"></param>
         /// <param name="ErrorTag"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static Exception ErrorTag_Set(this Exception ex, string ErrorTag)
         {
             ex.Data_Set("ErrorTag", ErrorTag);
@@ -108,6 +115,7 @@ namespace Vit.Extensions
         /// </summary>
         /// <param name="ex"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string ErrorTag_Get(this Exception ex)
         {
             return ex.Data_Get<string>("ErrorTag");
@@ -121,6 +129,7 @@ namespace Vit.Extensions
         /// </summary>
         /// <param name="ex"></param>
         /// <param name="ErrorDetail"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static Exception ErrorDetail_Set(this Exception ex, JObject ErrorDetail)
         {
             ex.Data_Set("ErrorDetail", ErrorDetail);
@@ -131,6 +140,7 @@ namespace Vit.Extensions
         /// </summary>
         /// <param name="ex"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static JObject ErrorDetail_Get(this Exception ex)
         {
             return ex.Data_Get<JObject>("ErrorDetail");
@@ -144,7 +154,7 @@ namespace Vit.Extensions
         /// <param name="ex"></param>
         /// <param name="key"></param>
         /// <param name="value"></param>
-
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static Exception ErrorDetail_Set(this Exception ex, string key,object value)
         {
             var ErrorDetail = ex.ErrorDetail_Get();
@@ -163,6 +173,7 @@ namespace Vit.Extensions
         /// <param name="ex"></param>
         /// <param name="key"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static object ErrorDetail_Get(this Exception ex, string key)
         {
             return ex.ErrorDetail_Get()?[key]?.GetValue();
@@ -178,7 +189,7 @@ namespace Vit.Extensions
         /// <param name="ex"></param>
         /// <param name="ssError"></param>
         /// <returns></returns>
-
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static Exception SsError_Set(this Exception ex, SsError ssError)
         {
             ssError?.SetErrorToException(ex);
@@ -190,6 +201,7 @@ namespace Vit.Extensions
         /// </summary>
         /// <param name="ex"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static SsError ToSsError(this Exception ex)
         {
             return new SsError().LoadFromException(ex);

+ 1 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ComponentModel/SsError/Extensions/SsErrorExtensions.cs

@@ -15,6 +15,7 @@ namespace Vit.Extensions
         /// <param name="error"></param>
         /// <param name="defaultMessage"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static Exception ToException(this SsError error,string defaultMessage=null)
         {
             var ex = new Exception(error?.errorMessage ?? defaultMessage ?? "Error");

+ 3 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ComponentModel/SsError/SsError.cs

@@ -70,6 +70,7 @@ namespace Vit.Core.Util.ComponentModel.SsError
 
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual SsError LoadFromException(Exception ex)
         {
             errorCode = ex.ErrorCode_Get();
@@ -79,6 +80,7 @@ namespace Vit.Core.Util.ComponentModel.SsError
             return this;
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual Exception SetErrorToException(Exception ex)
         {
             if (null != errorCode) ex.ErrorCode_Set(errorCode);
@@ -90,6 +92,7 @@ namespace Vit.Core.Util.ComponentModel.SsError
 
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static implicit operator SsError(Exception ex)
         {
            return new SsError().LoadFromException(ex);

+ 2 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ConfigurationManager/ConfigurationManager.cs

@@ -20,6 +20,8 @@ namespace Vit.Core.Util.ConfigurationManager
 
 
         const string fileName = "appsettings.json";
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected static string GetDefaultPath()
         {
             return fileName; 

+ 9 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/ConfigurationManager/JsonFile.cs

@@ -18,6 +18,7 @@ namespace Vit.Core.Util.ConfigurationManager
         /// <param name="value">要保存的数据</param>
         /// <param name="filePath">json文件路径,例如:new []{"Data", "App.Robot.json"}</param>
         /// <param name="valueKeys">value在json文件中的json路径,可为null。例如:new []{"taskList"}</param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void SetToFile(object value,string[] filePath,string []valueKeys = null)
         {
             new JsonFile(filePath).Set(value, valueKeys);             
@@ -30,6 +31,7 @@ namespace Vit.Core.Util.ConfigurationManager
         /// <param name="filePath">json文件路径,例如:new []{"Data", "App.Robot.json"}</param>
         /// <param name="valueKeys">value在json文件中的json路径,可为null。例如:new []{"taskList"}</param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static T GetFromFile<T>(string[] filePath,string[] valueKeys = null)
         {
             try
@@ -79,6 +81,7 @@ namespace Vit.Core.Util.ConfigurationManager
         /// <summary>
         /// 手动刷新配置,修改配置后,请手动调用此方法,以便更新配置参数
         /// </summary>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual void RefreshConfiguration()
         {
             root = null;
@@ -106,6 +109,7 @@ namespace Vit.Core.Util.ConfigurationManager
         /// <summary>
         /// 保存到原始json文件
         /// </summary>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual void SaveToFile()
         {
             if (string.IsNullOrEmpty(configPath)) return;
@@ -132,6 +136,7 @@ namespace Vit.Core.Util.ConfigurationManager
 
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual string GetStringByPath(string path)
         {
             var cur = root?.SelectToken(path);
@@ -145,6 +150,7 @@ namespace Vit.Core.Util.ConfigurationManager
         /// <typeparam name="T"></typeparam>
         /// <param name="keys">value在Root中的json路径,可为null。例如:new []{"taskList",0,"name"}</param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual  T Get<T>(params object[] keys)
         {
             JToken cur = root;
@@ -163,6 +169,7 @@ namespace Vit.Core.Util.ConfigurationManager
         /// </summary>
         /// <param name="value"></param>
         /// <param name="keys">value在Root中的json路径,可为null。例如:new []{"taskList",0,"name"}</param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Set(object value, params object[] keys)
         {
             if (null == keys || keys.Length == 0)
@@ -185,6 +192,7 @@ namespace Vit.Core.Util.ConfigurationManager
         /// <typeparam name="T"></typeparam>
         /// <param name="path">value在Root中的json路径,可为null。例如:"a.b.c"</param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual T GetByPath<T>(string path)
         {
             if(string.IsNullOrEmpty(path))
@@ -199,6 +207,7 @@ namespace Vit.Core.Util.ConfigurationManager
         /// </summary>
         /// <param name="value"></param>
         /// <param name="path">value在Root中的json路径,可为null。例如:"a.b.c"</param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void SetByPath(object value, string path)
         {
             Set(value,path?.Split('.'));

+ 1 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Disposable.cs

@@ -10,6 +10,7 @@ namespace Vit.Core.Util
             this.onDispose = onDispose;
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void Dispose()
         {
             onDispose?.Invoke();

+ 4 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Extensible/Extensible.cs

@@ -23,6 +23,7 @@ namespace Vit.Core.Util.Extensible
         /// <typeparam name="T"></typeparam>
         /// <param name="key"></param>
         /// <param name="value"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void SetData<T>(string key,T value)
         {
             (extensionData ?? (extensionData = new Dictionary<string, object>()))[key] = value;
@@ -34,6 +35,7 @@ namespace Vit.Core.Util.Extensible
         /// <typeparam name="T"></typeparam>
         /// <param name="key"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public T GetData<T>(string key)
         {
             if (extensionData !=null && extensionData.TryGetValue(key,out var value))
@@ -54,6 +56,7 @@ namespace Vit.Core.Util.Extensible
         /// <typeparam name="T"></typeparam>
         /// <param name="key"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public T GetDataByConvert<T>(string key)
         {
             if (extensionData != null && extensionData.TryGetValue(key, out var value))
@@ -83,6 +86,7 @@ namespace Vit.Core.Util.Extensible
         /// <typeparam name="T"></typeparam>
         /// <param name="key"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public T GetDataBySerialize<T>(string key)
         {
             if (extensionData != null && extensionData.TryGetValue(key, out var value))

+ 4 - 1
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Guid/Snowflake.cs

@@ -100,12 +100,13 @@ namespace Vit.Core.Util.Guid
         #endregion
 
 
-       
+
 
         /// <summary>
         /// 生成当前时间戳
         /// </summary>
         /// <returns>毫秒</returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         private static long GetTimestamp()
         {
             return (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
@@ -116,6 +117,7 @@ namespace Vit.Core.Util.Guid
         /// </summary>
         /// <param name="lastTimestamp"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         private static long GetNextTimestamp(long lastTimestamp)
         {
             long timestamp = GetTimestamp();
@@ -135,6 +137,7 @@ namespace Vit.Core.Util.Guid
         /// 获取长整形的ID
         /// </summary>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static long GetId()
         {
             lock (syncRoot)

+ 5 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Net/HttpClient.cs

@@ -21,6 +21,7 @@ namespace Vit.Core.Util.Net
         /// <typeparam name="T"></typeparam>
         /// <param name="request"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public async Task<HttpResponse<T>> SendAsync<T>(HttpRequest request)
         {
             #region (x.1)构建请求            
@@ -112,6 +113,7 @@ namespace Vit.Core.Util.Net
         /// <param name="url">不可为null,demo:"http://www.a.com"、"http://www.a.com?a=1&amp;b=2"</param>
         /// <param name="parameters">可为string、IDictionary、JObject</param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string UrlAddParams(string url, Object parameters)
         {
             string urlParams = FormatUrlParams(parameters);
@@ -136,6 +138,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="param"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static String UrlEncode(String param)
         {
             if (String.IsNullOrEmpty(param))
@@ -161,6 +164,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="parameters">可为string、IDictionary、JObject,例如:"a=3&amp;b=5"</param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static String FormatUrlParams(Object parameters)
         {
 
@@ -223,6 +227,7 @@ namespace Vit.Core.Util.Net
         /// <typeparam name="ReturnType"></typeparam>
         /// <param name="request"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public HttpResponse<ReturnType> Send<ReturnType>(HttpRequest request)
         {
             return SendAsync<ReturnType>(request).Result;

+ 27 - 2
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Net/HttpUtil.cs

@@ -42,6 +42,7 @@ namespace Vit.Core.Util.Net
         /// <typeparam name="Type"></typeparam>
         /// <param name="source"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         private static Type CloneStruct<Type>(object source)
         {
             string v = JsonConvert.SerializeObject(source);
@@ -56,6 +57,7 @@ namespace Vit.Core.Util.Net
         /// 设置请求类型为Https
         /// </summary>
         /// <param name="request"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         private static void SetToHttps(HttpWebRequest request)
         {
 
@@ -109,6 +111,7 @@ namespace Vit.Core.Util.Net
         }
         #endregion
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
         {
             return true; //总是接受  
@@ -122,6 +125,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="param"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static String UrlEncode(String param)
         {
             if (String.IsNullOrEmpty(param))
@@ -145,6 +149,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="param"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static String UrlDecode(String param)
         {
             if (String.IsNullOrEmpty(param))
@@ -168,6 +173,7 @@ namespace Vit.Core.Util.Net
         /// 获取时间戳 10位
         /// </summary> 
         /// <returns></returns> 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string GetTimeStampTen()
         {
             return ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000).ToString();
@@ -183,6 +189,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="parameters">可为string、IDictionary、JObject,例如:"a=3&amp;b=5"</param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static String FormatUrlParams(Object parameters)
         {
 
@@ -230,6 +237,7 @@ namespace Vit.Core.Util.Net
         /// <param name="url">不可为null,demo:"http://www.a.com"、"http://www.a.com?a=1&amp;b=2"</param>
         /// <param name="parameters">可为string、IDictionary、JObject</param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static string UrlAddParams(string url, Object parameters)
         {
             string urlParams = FormatUrlParams(parameters);
@@ -261,6 +269,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="url"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected virtual WebRequest GetRequest(String url)
         {
             WebRequest request = WebRequest.Create(url);
@@ -307,6 +316,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="response"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected Encoding GetResponseEncoding(HttpWebResponse response)
         {
             String strEncoding = response.CharacterSet;
@@ -325,6 +335,7 @@ namespace Vit.Core.Util.Net
 
         #region SendRequestBody
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static void SendRequestBody(WebRequest request,string _contentType, byte[] _dataToWrite)
         {
             //(x.1)
@@ -352,6 +363,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="requestParam"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected virtual WebRequest GetRequest(RequestParam requestParam)
         {
             var url = UrlAddParams(requestParam.url, requestParam.urlParams);
@@ -381,6 +393,7 @@ namespace Vit.Core.Util.Net
         #endregion
 
         #region GetResponse
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected virtual HttpWebResponse GetResponse(RequestParam requestParam)
         {
             return GetRequest(requestParam).GetResponse() as HttpWebResponse;
@@ -396,6 +409,7 @@ namespace Vit.Core.Util.Net
         /// <param name="response"></param>
         /// <param name="requestParam"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual String Response_GetString(HttpWebResponse response, RequestParam requestParam)
         {
             using (System.IO.Stream respStream = response.GetResponseStream())
@@ -415,6 +429,7 @@ namespace Vit.Core.Util.Net
         /// <param name="data"></param>
         /// <param name="responseContentType">可为"json",若不指定有效值则默认为'string'</param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual Object FormatResponseData(HttpWebResponse response, String data,string responseContentType)
         {            
             if (0 <= responseContentType.IndexOf("json"))
@@ -433,6 +448,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="requestParam"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual object Ajax(RequestParam requestParam)
         {
             var response = GetResponse(requestParam);
@@ -452,6 +468,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="requestParam"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual string Ajax_String(RequestParam requestParam)
         {
             return Response_GetString(GetResponse(requestParam), requestParam);
@@ -461,6 +478,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="requestParam"></param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual T Ajax<T>(RequestParam requestParam)
         {          
             return JsonConvert.DeserializeObject<T>(Ajax_String(requestParam)); 
@@ -468,6 +486,7 @@ namespace Vit.Core.Util.Net
         #endregion
 
         #region Ajax_GetByte
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual byte[] Ajax_GetByte(RequestParam requestParam)
         {
             return Response_GetByte(GetResponse(requestParam));
@@ -480,6 +499,7 @@ namespace Vit.Core.Util.Net
         /// 从response 下载byte数据
         /// </summary>
         /// <param name="response"></param> 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected virtual byte[] Response_GetByte(HttpWebResponse response)
         {
             using (System.IO.Stream stream = response.GetResponseStream())
@@ -504,9 +524,10 @@ namespace Vit.Core.Util.Net
             }
         }
         #endregion
-        #endregion   
+        #endregion
 
         #region Ajax_DownloadFile
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual void Ajax_DownloadFile(RequestParam requestParam, String filePath)
         {
             Response_DownloadFile(GetResponse(requestParam), filePath);
@@ -520,6 +541,7 @@ namespace Vit.Core.Util.Net
         /// </summary>
         /// <param name="response"></param>
         /// <param name="filePath"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected virtual void Response_DownloadFile(HttpWebResponse response, String filePath)
         {
             using (System.IO.Stream si = response.GetResponseStream())
@@ -551,7 +573,7 @@ namespace Vit.Core.Util.Net
         /// <param name="url"></param>
         /// <param name="urlParams">放到url中的参数。可为string、IDictionary、JObject</param>
         /// <returns></returns>
-
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual object Ajax_Get(string url, Object urlParams)
         {
             return Ajax(new RequestParam() { url = url, urlParams = urlParams });
@@ -568,6 +590,7 @@ namespace Vit.Core.Util.Net
         /// <param name="getParameters">放到url中的参数。可为string、IDictionary、JObject </param>
         /// <param name="postParameters">post请求参数(消息主体)。可为string、IDictionary、JObject/JArray </param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual object Ajax_Post(string url, Object getParameters, Object postParameters)
         {
             return Ajax(new RequestParam() { url = url, Method = "POST", urlParams = getParameters, body = postParameters });
@@ -578,6 +601,7 @@ namespace Vit.Core.Util.Net
         /// <param name="url"></param>
         /// <param name="postParameters">post请求参数(消息主体)。可为string、IDictionary、JObject/JArray </param>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public virtual object Ajax_Post(string url, Object postParameters)
         {
             return Ajax(new RequestParam() { url = url, Method = "POST", body = postParameters });
@@ -821,6 +845,7 @@ BASH<method> <request-URL> <version>
         /// 获取请求Body
         /// </summary>
         /// <returns></returns>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         internal void GetRequestBodyData(out string contentType, out  byte[] dataToWrite)
         {
             contentType = null;

+ 2 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Net/NetHelp.cs

@@ -6,6 +6,7 @@ namespace Vit.Core.Util.Net
     public class NetHelp
     {
         #region ParseToIPAddress
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static IPAddress ParseToIPAddress(string host)
         {
             IPAddress ipAddress;
@@ -22,6 +23,7 @@ namespace Vit.Core.Util.Net
 
 
         #region TestIsConnectedByPoll
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public bool TestIsConnectedByPoll(Socket socket,int microSeconds = 500)
         {        
             return null != socket && socket.Connected && !(socket.Poll(microSeconds, SelectMode.SelectRead) && (socket.Available == 0));

+ 3 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/SsExp/SsExpCalculator.cs

@@ -63,6 +63,7 @@ namespace Vit.Core.Util.SsExp
             */
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static JToken Calculate(JToken baseValue, JToken ssExp)
         {       
             if (!ssExp.TypeMatch(JTokenType.Object))
@@ -364,6 +365,7 @@ namespace Vit.Core.Util.SsExp
             #endregion
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static bool  JTokenToBool(JToken value)
         {
             if (value.TryParseIgnore(out bool v)) return v;
@@ -373,6 +375,7 @@ namespace Vit.Core.Util.SsExp
         }
 
         #region GetCurValue
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static JToken GetCurValue(JToken baseValue, JObject SsExp)
         {
             var path = SsExp["path"].ConvertToString();

+ 4 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/AsyncCacheHelper.cs

@@ -14,11 +14,14 @@ namespace Vit.Core.Util.Threading
                 return _AsyncCache.Value ?? (_AsyncCache.Value = new ConcurrentDictionary<string, object>());                
             }             
         }
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static void Set(string key,Object value)
         {
             dic[key] = value;
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static Object Get(string key)
         {
             if (dic.TryGetValue(key, out var value))
@@ -28,6 +31,7 @@ namespace Vit.Core.Util.Threading
             return null;
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public static T Get<T>(string key)
         {
             try

+ 2 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/LongTaskHelp_TimeLimit.cs

@@ -83,6 +83,7 @@ namespace Vit.Core.Util.Threading
         /// <summary>
         /// 电子脉冲,在固定的时间间隔发送脉冲
         /// </summary>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void PulseMake(object obj)
         {
             if (!IsRunning) return;
@@ -225,6 +226,7 @@ namespace Vit.Core.Util.Threading
                 thread.Start();
             }
 
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             void Run()
             {
                 try

+ 1 - 0
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/TaskQueue.cs

@@ -63,6 +63,7 @@ namespace Vit.Core.Util.Threading
 
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         void InvokeTaskInQueue()
         {
             while (true)

+ 15 - 3
dotnet/ServiceCenter/Sers.ServiceCenter/Apm/Sers.Gover.Apm.Zipkin/AppEvent.cs

@@ -17,8 +17,9 @@ namespace Sers.Gover.Apm.Zipkin
 {
 
     public class AppEvent : IAppEvent
-    {        
+    {
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         Action<Object, Vit.Core.Util.Pipelines.ByteData> ApiScopeEvent(RpcContextData rpcData, ApiMessage apiRequestMessage)
         {
             //记录请求数据
@@ -262,20 +263,28 @@ namespace Sers.Gover.Apm.Zipkin
             Logger.Info("[zipkin]启动成功");
         }
 
-       
 
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void OnStart()
         { 
         }
-        
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void AfterStart()
         {         
         }
+
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void BeforeStop()
         {
             TraceManager.Stop();
            
         }
+
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void AfterStop()
         {
             
@@ -299,16 +308,19 @@ namespace Sers.Gover.Apm.Zipkin
     #region MyLogger       
     class MyLogger : ILogger
     {
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void LogError(string message)
         {
             Logger.Error("[zipkin]" + message);
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void LogInformation(string message)
         {
             Logger.Info("[zipkin]" + message);
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void LogWarning(string message)
         {
             Logger.log.Log(Level.WARN, "[zipkin]" + message);

+ 1 - 0
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/ApiLoadBalancingMng.cs

@@ -38,6 +38,7 @@ namespace Sers.Gover.Base
             return routeMap.Routing(rpcData.route, out routeType)?.GetCurApiNodeBalancing();
         }
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         protected virtual string GetApiRoute(ApiNode apiNode)
         {
             return apiNode.apiDesc.route;

+ 1 - 0
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/ApiStationMng.cs

@@ -57,6 +57,7 @@ namespace Sers.Gover.Base
 
         #region ApiStation
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public List<ApiStationData> ApiStation_GetAll()
         {
             return apiStations.Values.OrderBy(m=>m.stationName).ToList();

+ 1 - 0
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/Extensions/ServiceStationExtensions.cs

@@ -16,6 +16,7 @@ namespace Vit.Extensions
             return data?.GetDataByConvert<EServiceStationStatus?>("Status");
         }
 
+
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static void Status_Set(this ServiceStation data, EServiceStationStatus value)
         {

+ 4 - 1
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/Model/ApiStationData.cs

@@ -15,8 +15,10 @@ namespace Sers.Gover.Base.Model
     {
         [JsonProperty]
         public string stationName;
+
         [JsonProperty]
         public int apiServiceCount => apiServices.Count;
+
         [JsonProperty]
         public int apiNodeCount => apiServices.Values.Sum((apiService=>apiService.apiNodeCount));
 
@@ -47,7 +49,7 @@ namespace Sers.Gover.Base.Model
         /// <summary>
         /// route ApiService
         /// </summary>
-        [JsonProperty]
+        [JsonIgnore]
         public ConcurrentDictionary<string, ApiService> apiServices = new ConcurrentDictionary<string, ApiService>();
 
 
@@ -96,6 +98,7 @@ namespace Sers.Gover.Base.Model
             if (apiServices.TryGetValue(serviceKey, out var apiService)) return apiService;
             return null; 
         }
+
         public ApiService ApiService_GetOrAdd(SsApiDesc apiDesc)
         {
             var apiService = apiServices.GetOrAdd(apiDesc.ServiceKeyGet(), (n) => { return InitApiService(new ApiService { apiDesc = apiDesc }); });

+ 1 - 0
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Base/ServiceStationMng.cs

@@ -225,6 +225,7 @@ namespace Sers.Gover.Base
 
             SortedDictionary<KeyType, Item> map = new SortedDictionary<KeyType, Item>();
 
+            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
             public ValueType Get(KeyType key)
             {
                 if (map.TryGetValue(key, out var item))

+ 89 - 20
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Controllers/ApiControllers/ServiceCenterController.cs

@@ -1,7 +1,9 @@
 using System;
 using System.Diagnostics;
+using System.Linq;
 using Newtonsoft.Json.Linq;
 using Sers.Core.Module.Rpc;
+using Sers.Gover.Base;
 using Sers.Hardware.Usage;
 using Sers.SersLoader;
 using Sers.SersLoader.ApiDesc.Attribute.Valid;
@@ -15,55 +17,122 @@ namespace Sers.Gover.Controllers.ApiControllers
 {
     [SsStationName("_gover_")]
     public class ServerCenterController : IApiController
-    { 
+    {
+        #region HealthInfo
+
+     
 
- 
         [SsRoute("serviceCenter/healthInfo")]
         [SsCallerSource(ECallerSource.Internal)]
         //[CallFromGover]
         [SsName("获取服务中心健康数据")]
-        public ApiReturn<Object> HealthInfo()
+        public ApiReturn<HealthInfoData> HealthInfo()
         {
-            JObject healthInfo = new JObject();
+            var info = new HealthInfoData();
 
             //(x.1) usageStatus
-            healthInfo["usageStatus"] = UsageHelp.GetUsageInfo()?.ConvertBySerialize<JObject>();
+            info.usageStatus = UsageHelp.GetUsageInfo();
 
             //(x.2) Process信息
             try
             {
                 var process = Process.GetCurrentProcess();
-                var processInfo = new JObject();
-                healthInfo["Process"] = processInfo;
-                
-                //(x.x.1) threadInfo
-                processInfo["ThreadCount"] = process.Threads.Count;
-                int n = 0;
-        
+
+
+                //(x.x.1) ThreadCount
+                info.Process.ThreadCount = process.Threads.Count;
+
+                //(x.x.2) RunningThreadCount
+                int n = 0;        
                 foreach (ProcessThread th in process.Threads)
                 {             
                     if (th.ThreadState == ThreadState.Running)
                         n++;
                 }
-                processInfo["RunningThreadCount"] = n;
-                
-                //(x.x.2) memory size
-                processInfo["WorkingSet"] = (process.WorkingSet64/1024.0/1024).ToString("0.00")+" MB";
+                info.Process.RunningThreadCount = n;
+
+                //(x.x.3) WorkingSet
+                info.Process.WorkingSet = process.WorkingSet64 / 1024.0f / 1024;
 
             }
             catch (Exception ex)
             {
                 Logger.Error(ex);
+            } 
+            return info;
+        }
+
+
+        public class HealthInfoData 
+        {
+            public UsageStatus usageStatus;
+
+            public ProcessInfo Process = new ProcessInfo();
+
+
+            public class ProcessInfo 
+            {
+                /// <summary>
+                /// 总线程数
+                /// </summary>
+                public int ThreadCount;
+
+                /// <summary>
+                /// 活动的线程数
+                /// </summary>
+                public int RunningThreadCount;
+
+
+                /// <summary>
+                /// 占用总内存(单位:MB)
+                /// </summary>
+                public float WorkingSet;
             }
 
-           
-     
+        }
+
+        #endregion
+
 
-            return healthInfo;
+
+
+
+
+
+        #region Statistics
+
+        [SsRoute("serviceCenter/statistics")]
+        [SsCallerSource(ECallerSource.Internal)]
+        //[CallFromGover]
+        [SsName("获取服务中心统计信息")]
+        public ApiReturn<StatisticsInfo> Statistics()
+        {
+            var info = new StatisticsInfo();
+
+
+            //(x.1) qps
+            try
+            {
+                var qps = GoverApiCenterService.Instance.ApiStation_GetAll().Sum(m => m.qps);
+                info.qps= qps;
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+
+            return info;
         }
 
-         
+        public class StatisticsInfo 
+        {
+            /// <summary>
+            /// 总qps
+            /// </summary>
+            public float qps;
+        }
 
+        #endregion
 
     }
 }

+ 8 - 0
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Extensions/ServiceCenter_GoverExtensions.cs

@@ -33,6 +33,8 @@ namespace Vit.Extensions
         #region QpsTimer
 
         static int SaveToFile_tick = 0;
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static void QpsTimer_Calc()
         {
             //(x.1)计算ApiStation qps
@@ -77,7 +79,11 @@ namespace Vit.Extensions
             }
 
         }
+
         static SersTimer timer = null;
+
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static void QpsTimer_Start()
         {
             if (null != timer) return;
@@ -93,6 +99,8 @@ namespace Vit.Extensions
             timer.Start();           
         }
 
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static void QpsTimer_Stop()
         {
             try

+ 3 - 0
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter/Entity/ServiceStation.cs

@@ -76,6 +76,8 @@ namespace Sers.ServiceCenter.Entity
 
         private DateTime? qps_TimeLast = null;
         private int qps_SumCountLast = 0;
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public void QpsCalc()
         {
             var curSumCount = counter.sumCount;
@@ -91,6 +93,7 @@ namespace Sers.ServiceCenter.Entity
 
 
 
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         public string GetApiStationNames()
         {
             var stationNames = apiNodes.Select(m => m.apiDesc.ApiStationNameGet());

+ 41 - 0
dotnet/ServiceStation/Demo/StressTest/App.Robot.Station/Controllers/StatisticsController.cs

@@ -0,0 +1,41 @@
+using Sers.SersLoader;
+using Sers.SersLoader.ApiDesc.Attribute.Valid;
+using Sers.Core.Module.Rpc;
+using Vit.Core.Util.ComponentModel.Api;
+using Vit.Core.Util.ComponentModel.Data;
+using Sers.Core.Module.Api;
+using System;
+
+namespace App.Robot.Station.Controllers
+{
+    public class StatisticsController : IApiController
+    {
+              
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <returns></returns>
+        [SsRoute("statistics/LogQps")]
+        [SsCallerSource(ECallerSource.Internal)]
+        public ApiReturn<float> LogQps()
+        {             
+            var apiRet = ApiClient.CallRemoteApi<ApiReturn<StatisticsInfo>>("/_gover_/serviceCenter/statistics");
+
+            if (apiRet?.success!=true) return apiRet?.error;
+
+            var qps = apiRet.data.qps;
+            Console.WriteLine("服务中心当前总qps: "+ qps);
+            return qps;
+        }
+
+        public class StatisticsInfo
+        {
+            /// <summary>
+            /// 总qps
+            /// </summary>
+            public float qps;
+        }
+
+    }
+}