lith il y a 4 ans
Parent
commit
4dd67b7598

+ 18 - 0
dotnet/Doc/Publish/echo qps.md

@@ -0,0 +1,18 @@
+#发送获取qps请求
+curl -H "Cookie: user=admin_123456" http://192.168.56.1:4580/_gover_/serviceCenter/statistics
+
+
+#显示qps
+curl -s -H "Cookie: user=admin_123456" http://192.168.56.1:4580/_gover_/serviceCenter/statistics | grep -Eo '[0-9|\.]+'
+
+
+#每秒显示一次qps
+for i in {1..10}   
+do  
+curl -s -H "Cookie: user=admin_123456" http://192.168.56.1:4580/_gover_/serviceCenter/statistics | grep -Eo '[0-9|\.]+'
+sleep 1
+done  
+ 
+
+ 
+ 

+ 1 - 1
dotnet/ServiceCenter/App.ServiceCenter/appsettings.json

@@ -187,7 +187,7 @@
     "LocalApiService": {
 
       /* 后台服务的线程个数(单位个,默认0,代表不开启服务)*/
-      "workThreadCount": 1,
+      "workThreadCount": 4,
 
       /* 超时时间,若不指定则后台任务永不超时。(主动关闭超过此时间的任务,实际任务强制关闭的时间会在1倍超时时间到2倍超时时间内)。单位:ms。*/
       //"timeout_ms": 300000,

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

@@ -1,41 +0,0 @@
-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;
-        }
-
-    }
-}

+ 1 - 1
dotnet/ServiceStation/Demo/StressTest/App.Robot.Station/appsettings.json

@@ -148,7 +148,7 @@
     "LocalApiService": {
 
       /* 后台服务的线程个数(单位个,默认0,代表不开启服务) */
-      "workThreadCount": 1,
+      "workThreadCount": 4,
 
       /* 静态文件映射器。映射站点静态文件,可多个,可不指定 */
       "staticFiles": [

+ 8 - 3
dotnet/ServiceStation/Demo/StressTest/App.Robot.Station/wwwroot/_robot_/TaskMng.html

@@ -54,10 +54,15 @@
 
 
         saveToCache:<br />
-                    <textarea rows="10" cols="100">{ "name": "saveToCache","apiRoute": "/_robot_/taskMng/saveToCache", "apiArg": null, "threadCount": 1,"interval": 5000, "autoStart": true,"loopCountPerThread": 1000000000,"logError": true }</textarea><br />
-        _robot_ :<br />
-        <textarea rows="10" cols="100">{ "name": "robot[1-100]","apiRoute": "/_robot_/task/getAll", "apiArg": null, "threadCount": 1,"interval": 100, "autoStart": false,"loopCountPerThread": 1000000000 }</textarea>
+        <textarea rows="5" cols="100">{ "name": "saveToCache","apiRoute": "/_robot_/taskMng/saveToCache", "apiArg": null, "threadCount": 1,"interval": 5000, "autoStart": true,"loopCountPerThread": 1000000000,"logError": true }</textarea>
+        <br />
+        <br />
 
+        _robot_ :
+        <br />
+        <textarea rows="5" cols="100">{ "name": "robot[1-100]","apiRoute": "/_robot_/task/getAll", "apiArg": null, "threadCount": 1,"interval": 100, "autoStart": false,"loopCountPerThread": 1000000000 }</textarea>
+        <br />
+        <br />
 
     </div>
     <script>