@nsshunt/stsappframework 3.1.213 → 3.1.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonTypes.js.map +1 -1
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/dist/masterprocessbase.js +33 -46
- package/dist/masterprocessbase.js.map +1 -1
- package/dist/processbase.js +29 -0
- package/dist/processbase.js.map +1 -1
- package/dist/serverprocessbase.js +51 -66
- package/dist/serverprocessbase.js.map +1 -1
- package/dist/stscontrollerbase.js.map +1 -1
- package/dist/{server.js → stsexpressserver.js} +1 -1
- package/dist/stsexpressserver.js.map +1 -0
- package/dist/stslatencycontroller.js.map +1 -1
- package/dist/stslatencyroute.js.map +1 -1
- package/dist/stsrouterbase.js.map +1 -1
- package/dist/vitesttesting/appSingleWSS.js +2 -1
- package/dist/vitesttesting/appSingleWSS.js.map +1 -1
- package/dist/workerprocessbase.js.map +1 -1
- package/package.json +5 -6
- package/src/commonTypes.ts +2 -0
- package/src/index.ts +1 -7
- package/src/masterprocessbase.ts +42 -55
- package/src/processbase.ts +32 -1
- package/src/serverprocessbase.ts +55 -72
- package/src/{socketIoServerHelper.ts → socketIoServerHelper.ts_bak} +1 -2
- package/src/stscontrollerbase.ts +1 -2
- package/src/{server.ts → stsexpressserver.ts} +1 -2
- package/src/stslatencycontroller.ts +1 -2
- package/src/stslatencyroute.ts +1 -2
- package/src/stsrouterbase.ts +1 -2
- package/src/vitesttesting/appSingleWSS.ts +2 -1
- package/src/workerprocessbase.ts +1 -2
- package/types/commonTypes.d.ts +0 -15
- package/types/commonTypes.d.ts.map +1 -1
- package/types/index.d.ts +0 -7
- package/types/index.d.ts.map +1 -1
- package/types/masterprocessbase.d.ts.map +1 -1
- package/types/processbase.d.ts +3 -0
- package/types/processbase.d.ts.map +1 -1
- package/types/serverprocessbase.d.ts +3 -1
- package/types/serverprocessbase.d.ts.map +1 -1
- package/types/stscontrollerbase.d.ts.map +1 -1
- package/types/{server.d.ts → stsexpressserver.d.ts} +1 -1
- package/types/stsexpressserver.d.ts.map +1 -0
- package/types/stslatencycontroller.d.ts.map +1 -1
- package/types/stslatencyroute.d.ts.map +1 -1
- package/types/stsrouterbase.d.ts.map +1 -1
- package/types/vitesttesting/appSingleWSS.d.ts.map +1 -1
- package/types/workerprocessbase.d.ts.map +1 -1
- package/dist/authDefs.js +0 -33
- package/dist/authDefs.js.map +0 -1
- package/dist/gRPC/ststest/protos/auth_sample.js +0 -3
- package/dist/gRPC/ststest/protos/auth_sample.js.map +0 -1
- package/dist/gRPC/ststest/protos/echo.js +0 -3
- package/dist/gRPC/ststest/protos/echo.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/examples/echo/Echo.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/examples/echo/Echo.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/testing/Request.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/testing/Request.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/testing/Response.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/testing/Response.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/testing/TestService.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/testing/TestService.js.map +0 -1
- package/dist/gRPC/ststest/protos/hellostreamingworld/HelloReply.js +0 -4
- package/dist/gRPC/ststest/protos/hellostreamingworld/HelloReply.js.map +0 -1
- package/dist/gRPC/ststest/protos/hellostreamingworld/HelloRequest.js +0 -4
- package/dist/gRPC/ststest/protos/hellostreamingworld/HelloRequest.js.map +0 -1
- package/dist/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.js +0 -4
- package/dist/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.js.map +0 -1
- package/dist/gRPC/ststest/protos/hellostreamingworld.js +0 -3
- package/dist/gRPC/ststest/protos/hellostreamingworld.js.map +0 -1
- package/dist/gRPC/ststest/protos/helloworld/Greeter.js +0 -4
- package/dist/gRPC/ststest/protos/helloworld/Greeter.js.map +0 -1
- package/dist/gRPC/ststest/protos/helloworld/HelloReply.js +0 -4
- package/dist/gRPC/ststest/protos/helloworld/HelloReply.js.map +0 -1
- package/dist/gRPC/ststest/protos/helloworld/HelloRequest.js +0 -4
- package/dist/gRPC/ststest/protos/helloworld/HelloRequest.js.map +0 -1
- package/dist/gRPC/ststest/protos/helloworld.js +0 -3
- package/dist/gRPC/ststest/protos/helloworld.js.map +0 -1
- package/dist/gRPC/ststest/protos/keyvaluestore/KeyValueStore.js +0 -4
- package/dist/gRPC/ststest/protos/keyvaluestore/KeyValueStore.js.map +0 -1
- package/dist/gRPC/ststest/protos/keyvaluestore/Request.js +0 -4
- package/dist/gRPC/ststest/protos/keyvaluestore/Request.js.map +0 -1
- package/dist/gRPC/ststest/protos/keyvaluestore/Response.js +0 -4
- package/dist/gRPC/ststest/protos/keyvaluestore/Response.js.map +0 -1
- package/dist/gRPC/ststest/protos/keyvaluestore.js +0 -3
- package/dist/gRPC/ststest/protos/keyvaluestore.js.map +0 -1
- package/dist/gRPC/ststest/protos/route_guide.js +0 -3
- package/dist/gRPC/ststest/protos/route_guide.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/Feature.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/Feature.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/Point.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/Point.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/Rectangle.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/Rectangle.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/RouteGuide.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/RouteGuide.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/RouteNote.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/RouteNote.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/RouteSummary.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/RouteSummary.js.map +0 -1
- package/dist/gRPC/ststest/src/commonTypes.js +0 -3
- package/dist/gRPC/ststest/src/commonTypes.js.map +0 -1
- package/dist/gRPC/ststest/src/greeter_client.js +0 -67
- package/dist/gRPC/ststest/src/greeter_client.js.map +0 -1
- package/dist/gRPC/ststest/src/greeter_server.js +0 -78
- package/dist/gRPC/ststest/src/greeter_server.js.map +0 -1
- package/dist/gRPC/ststest/src/route_guide_client.js +0 -258
- package/dist/gRPC/ststest/src/route_guide_client.js.map +0 -1
- package/dist/gRPC/ststest/src/route_guide_server.js +0 -237
- package/dist/gRPC/ststest/src/route_guide_server.js.map +0 -1
- package/dist/gRPC/ststest/src/route_guide_server2.js +0 -205
- package/dist/gRPC/ststest/src/route_guide_server2.js.map +0 -1
- package/dist/influxdb/influxDBManager.js +0 -304
- package/dist/influxdb/influxDBManager.js.map +0 -1
- package/dist/influxdb/influxDBManagerAgent.js +0 -14
- package/dist/influxdb/influxDBManagerAgent.js.map +0 -1
- package/dist/influxdb/influxDBManagerBase.js +0 -100
- package/dist/influxdb/influxDBManagerBase.js.map +0 -1
- package/dist/influxdb/influxDBManagerLambda.js +0 -17
- package/dist/influxdb/influxDBManagerLambda.js.map +0 -1
- package/dist/influxdb/influxDBManagerService.js +0 -14
- package/dist/influxdb/influxDBManagerService.js.map +0 -1
- package/dist/publishInstrumentsWebWorker.js +0 -159
- package/dist/publishInstrumentsWebWorker.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/socketIoServerHelper.js +0 -125
- package/dist/socketIoServerHelper.js.map +0 -1
- package/dist/tcpclient/app.js +0 -23
- package/dist/tcpclient/app.js.map +0 -1
- package/dist/tcpclient/app2.js +0 -57
- package/dist/tcpclient/app2.js.map +0 -1
- package/dist/tcpserver/app.js +0 -16
- package/dist/tcpserver/app.js.map +0 -1
- package/dist/tcpserver/appConfig.js +0 -83
- package/dist/tcpserver/appConfig.js.map +0 -1
- package/dist/tcpserver/appmaster.js +0 -446
- package/dist/tcpserver/appmaster.js.map +0 -1
- package/dist/testertesting/app.js +0 -284
- package/dist/testertesting/app.js.map +0 -1
- package/dist/testertesting/commonTypes.js +0 -47
- package/dist/testertesting/commonTypes.js.map +0 -1
- package/dist/testertesting/telemetryProcessor.js +0 -111
- package/dist/testertesting/telemetryProcessor.js.map +0 -1
- package/dist/testertesting/testCase01.js +0 -169
- package/dist/testertesting/testCase01.js.map +0 -1
- package/dist/testertesting/workerInstance.js +0 -263
- package/dist/testertesting/workerInstance.js.map +0 -1
- package/dist/testertesting/workerManager.js +0 -450
- package/dist/testertesting/workerManager.js.map +0 -1
- package/dist/testertesting/workerWorkerTestRunner01.js +0 -35
- package/dist/testertesting/workerWorkerTestRunner01.js.map +0 -1
- package/dist/testing/app.js +0 -18
- package/dist/testing/app.js.map +0 -1
- package/dist/testing/appConfig.js +0 -93
- package/dist/testing/appConfig.js.map +0 -1
- package/dist/testing/appTinyEmitter.js +0 -37
- package/dist/testing/appTinyEmitter.js.map +0 -1
- package/dist/testing/appWorkerWSS.js +0 -151
- package/dist/testing/appWorkerWSS.js.map +0 -1
- package/dist/testing/appredistest.js +0 -239
- package/dist/testing/appredistest.js.map +0 -1
- package/dist/testing/appsolo.js +0 -67
- package/dist/testing/appsolo.js.map +0 -1
- package/dist/testing/promiseTesting.js +0 -77
- package/dist/testing/promiseTesting.js.map +0 -1
- package/dist/testing/server.js +0 -15
- package/dist/testing/server.js.map +0 -1
- package/dist/testing/wsevents.js +0 -3
- package/dist/testing/wsevents.js.map +0 -1
- package/dist/webworkertesting/app.js +0 -44
- package/dist/webworkertesting/app.js.map +0 -1
- package/dist/webworkertesting/worker.js +0 -21
- package/dist/webworkertesting/worker.js.map +0 -1
- package/src/authDefs.ts +0 -37
- package/src/gRPC/ststest/protos/BUILD +0 -82
- package/src/gRPC/ststest/protos/README.md +0 -8
- package/src/gRPC/ststest/protos/auth_sample.proto +0 -42
- package/src/gRPC/ststest/protos/auth_sample.ts +0 -20
- package/src/gRPC/ststest/protos/echo.proto +0 -45
- package/src/gRPC/ststest/protos/echo.ts +0 -22
- package/src/gRPC/ststest/protos/grpc/examples/echo/Echo.ts +0 -55
- package/src/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.ts +0 -10
- package/src/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.ts +0 -10
- package/src/gRPC/ststest/protos/grpc/testing/Request.ts +0 -12
- package/src/gRPC/ststest/protos/grpc/testing/Response.ts +0 -12
- package/src/gRPC/ststest/protos/grpc/testing/TestService.ts +0 -27
- package/src/gRPC/ststest/protos/hellostreamingworld/HelloReply.ts +0 -10
- package/src/gRPC/ststest/protos/hellostreamingworld/HelloRequest.ts +0 -12
- package/src/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.ts +0 -23
- package/src/gRPC/ststest/protos/hellostreamingworld.proto +0 -39
- package/src/gRPC/ststest/protos/hellostreamingworld.ts +0 -18
- package/src/gRPC/ststest/protos/helloworld/Greeter.ts +0 -35
- package/src/gRPC/ststest/protos/helloworld/HelloReply.ts +0 -10
- package/src/gRPC/ststest/protos/helloworld/HelloRequest.ts +0 -10
- package/src/gRPC/ststest/protos/helloworld.proto +0 -40
- package/src/gRPC/ststest/protos/helloworld.ts +0 -18
- package/src/gRPC/ststest/protos/keyvaluestore/KeyValueStore.ts +0 -23
- package/src/gRPC/ststest/protos/keyvaluestore/Request.ts +0 -10
- package/src/gRPC/ststest/protos/keyvaluestore/Response.ts +0 -10
- package/src/gRPC/ststest/protos/keyvaluestore.proto +0 -33
- package/src/gRPC/ststest/protos/keyvaluestore.ts +0 -18
- package/src/gRPC/ststest/protos/route_guide.proto +0 -111
- package/src/gRPC/ststest/protos/route_guide.ts +0 -21
- package/src/gRPC/ststest/protos/routeguide/Feature.ts +0 -13
- package/src/gRPC/ststest/protos/routeguide/Point.ts +0 -12
- package/src/gRPC/ststest/protos/routeguide/Rectangle.ts +0 -13
- package/src/gRPC/ststest/protos/routeguide/RouteGuide.ts +0 -58
- package/src/gRPC/ststest/protos/routeguide/RouteNote.ts +0 -13
- package/src/gRPC/ststest/protos/routeguide/RouteSummary.ts +0 -16
- package/src/gRPC/ststest/src/commonTypes.ts +0 -27
- package/src/gRPC/ststest/src/greeter_client.ts +0 -52
- package/src/gRPC/ststest/src/greeter_server.ts +0 -62
- package/src/gRPC/ststest/src/route_guide_client.ts +0 -266
- package/src/gRPC/ststest/src/route_guide_server.ts +0 -234
- package/src/gRPC/ststest/src/route_guide_server2.ts +0 -211
- package/src/influxdb/influxDBManager.ts +0 -334
- package/src/influxdb/influxDBManagerAgent.ts +0 -14
- package/src/influxdb/influxDBManagerBase.ts +0 -108
- package/src/influxdb/influxDBManagerLambda.ts +0 -17
- package/src/influxdb/influxDBManagerService.ts +0 -14
- package/src/publishInstrumentsWebWorker.ts +0 -157
- package/src/tcpclient/app.ts +0 -21
- package/src/tcpclient/app2.ts +0 -58
- package/src/tcpserver/app.ts +0 -11
- package/src/tcpserver/appConfig.ts +0 -99
- package/src/tcpserver/appmaster.ts +0 -503
- package/src/testertesting/app.ts +0 -349
- package/src/testertesting/commonTypes.ts +0 -236
- package/src/testertesting/telemetryProcessor.ts +0 -125
- package/src/testertesting/testCase01.ts +0 -207
- package/src/testertesting/workerInstance.ts +0 -297
- package/src/testertesting/workerManager.ts +0 -511
- package/src/testertesting/workerWorkerTestRunner01.ts +0 -34
- package/src/testing/app.ts +0 -14
- package/src/testing/appConfig.ts +0 -110
- package/src/testing/appTinyEmitter.ts +0 -57
- package/src/testing/appWorkerWSS.ts +0 -174
- package/src/testing/appredistest.ts +0 -304
- package/src/testing/appsolo.ts +0 -96
- package/src/testing/docker-compose.yml +0 -20
- package/src/testing/promiseTesting.ts +0 -86
- package/src/testing/server.ts +0 -17
- package/src/testing/wsevents.ts +0 -33
- package/src/webworkertesting/app.ts +0 -56
- package/src/webworkertesting/worker.ts +0 -24
- package/types/authDefs.d.ts +0 -29
- package/types/authDefs.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/auth_sample.d.ts +0 -19
- package/types/gRPC/ststest/protos/auth_sample.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/echo.d.ts +0 -21
- package/types/gRPC/ststest/protos/echo.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/examples/echo/Echo.d.ts +0 -43
- package/types/gRPC/ststest/protos/grpc/examples/echo/Echo.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.d.ts +0 -7
- package/types/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.d.ts +0 -7
- package/types/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/testing/Request.d.ts +0 -9
- package/types/gRPC/ststest/protos/grpc/testing/Request.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/testing/Response.d.ts +0 -9
- package/types/gRPC/ststest/protos/grpc/testing/Response.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/testing/TestService.d.ts +0 -21
- package/types/gRPC/ststest/protos/grpc/testing/TestService.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/hellostreamingworld/HelloReply.d.ts +0 -7
- package/types/gRPC/ststest/protos/hellostreamingworld/HelloReply.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/hellostreamingworld/HelloRequest.d.ts +0 -9
- package/types/gRPC/ststest/protos/hellostreamingworld/HelloRequest.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.d.ts +0 -17
- package/types/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/hellostreamingworld.d.ts +0 -17
- package/types/gRPC/ststest/protos/hellostreamingworld.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/helloworld/Greeter.d.ts +0 -27
- package/types/gRPC/ststest/protos/helloworld/Greeter.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/helloworld/HelloReply.d.ts +0 -7
- package/types/gRPC/ststest/protos/helloworld/HelloReply.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/helloworld/HelloRequest.d.ts +0 -7
- package/types/gRPC/ststest/protos/helloworld/HelloRequest.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/helloworld.d.ts +0 -17
- package/types/gRPC/ststest/protos/helloworld.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/keyvaluestore/KeyValueStore.d.ts +0 -17
- package/types/gRPC/ststest/protos/keyvaluestore/KeyValueStore.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/keyvaluestore/Request.d.ts +0 -7
- package/types/gRPC/ststest/protos/keyvaluestore/Request.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/keyvaluestore/Response.d.ts +0 -7
- package/types/gRPC/ststest/protos/keyvaluestore/Response.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/keyvaluestore.d.ts +0 -17
- package/types/gRPC/ststest/protos/keyvaluestore.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/route_guide.d.ts +0 -20
- package/types/gRPC/ststest/protos/route_guide.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/Feature.d.ts +0 -10
- package/types/gRPC/ststest/protos/routeguide/Feature.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/Point.d.ts +0 -9
- package/types/gRPC/ststest/protos/routeguide/Point.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/Rectangle.d.ts +0 -10
- package/types/gRPC/ststest/protos/routeguide/Rectangle.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/RouteGuide.d.ts +0 -46
- package/types/gRPC/ststest/protos/routeguide/RouteGuide.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/RouteNote.d.ts +0 -10
- package/types/gRPC/ststest/protos/routeguide/RouteNote.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/RouteSummary.d.ts +0 -13
- package/types/gRPC/ststest/protos/routeguide/RouteSummary.d.ts.map +0 -1
- package/types/gRPC/ststest/src/commonTypes.d.ts +0 -23
- package/types/gRPC/ststest/src/commonTypes.d.ts.map +0 -1
- package/types/gRPC/ststest/src/greeter_client.d.ts +0 -3
- package/types/gRPC/ststest/src/greeter_client.d.ts.map +0 -1
- package/types/gRPC/ststest/src/greeter_server.d.ts +0 -3
- package/types/gRPC/ststest/src/greeter_server.d.ts.map +0 -1
- package/types/gRPC/ststest/src/route_guide_client.d.ts +0 -3
- package/types/gRPC/ststest/src/route_guide_client.d.ts.map +0 -1
- package/types/gRPC/ststest/src/route_guide_server.d.ts +0 -3
- package/types/gRPC/ststest/src/route_guide_server.d.ts.map +0 -1
- package/types/gRPC/ststest/src/route_guide_server2.d.ts +0 -3
- package/types/gRPC/ststest/src/route_guide_server2.d.ts.map +0 -1
- package/types/influxdb/influxDBManager.d.ts +0 -21
- package/types/influxdb/influxDBManager.d.ts.map +0 -1
- package/types/influxdb/influxDBManagerAgent.d.ts +0 -8
- package/types/influxdb/influxDBManagerAgent.d.ts.map +0 -1
- package/types/influxdb/influxDBManagerBase.d.ts +0 -14
- package/types/influxdb/influxDBManagerBase.d.ts.map +0 -1
- package/types/influxdb/influxDBManagerLambda.d.ts +0 -11
- package/types/influxdb/influxDBManagerLambda.d.ts.map +0 -1
- package/types/influxdb/influxDBManagerService.d.ts +0 -8
- package/types/influxdb/influxDBManagerService.d.ts.map +0 -1
- package/types/publishInstrumentsWebWorker.d.ts +0 -1
- package/types/publishInstrumentsWebWorker.d.ts.map +0 -1
- package/types/server.d.ts.map +0 -1
- package/types/socketIoServerHelper.d.ts +0 -20
- package/types/socketIoServerHelper.d.ts.map +0 -1
- package/types/tcpclient/app.d.ts +0 -2
- package/types/tcpclient/app.d.ts.map +0 -1
- package/types/tcpclient/app2.d.ts +0 -2
- package/types/tcpclient/app2.d.ts.map +0 -1
- package/types/tcpserver/app.d.ts +0 -2
- package/types/tcpserver/app.d.ts.map +0 -1
- package/types/tcpserver/appConfig.d.ts +0 -3
- package/types/tcpserver/appConfig.d.ts.map +0 -1
- package/types/tcpserver/appmaster.d.ts +0 -24
- package/types/tcpserver/appmaster.d.ts.map +0 -1
- package/types/testertesting/app.d.ts +0 -2
- package/types/testertesting/app.d.ts.map +0 -1
- package/types/testertesting/commonTypes.d.ts +0 -215
- package/types/testertesting/commonTypes.d.ts.map +0 -1
- package/types/testertesting/telemetryProcessor.d.ts +0 -6
- package/types/testertesting/telemetryProcessor.d.ts.map +0 -1
- package/types/testertesting/testCase01.d.ts +0 -20
- package/types/testertesting/testCase01.d.ts.map +0 -1
- package/types/testertesting/workerInstance.d.ts +0 -23
- package/types/testertesting/workerInstance.d.ts.map +0 -1
- package/types/testertesting/workerManager.d.ts +0 -16
- package/types/testertesting/workerManager.d.ts.map +0 -1
- package/types/testertesting/workerWorkerTestRunner01.d.ts +0 -7
- package/types/testertesting/workerWorkerTestRunner01.d.ts.map +0 -1
- package/types/testing/app.d.ts +0 -2
- package/types/testing/app.d.ts.map +0 -1
- package/types/testing/appConfig.d.ts +0 -3
- package/types/testing/appConfig.d.ts.map +0 -1
- package/types/testing/appTinyEmitter.d.ts +0 -2
- package/types/testing/appTinyEmitter.d.ts.map +0 -1
- package/types/testing/appWorkerWSS.d.ts +0 -26
- package/types/testing/appWorkerWSS.d.ts.map +0 -1
- package/types/testing/appredistest.d.ts +0 -4
- package/types/testing/appredistest.d.ts.map +0 -1
- package/types/testing/appsolo.d.ts +0 -3
- package/types/testing/appsolo.d.ts.map +0 -1
- package/types/testing/promiseTesting.d.ts +0 -4
- package/types/testing/promiseTesting.d.ts.map +0 -1
- package/types/testing/server.d.ts +0 -6
- package/types/testing/server.d.ts.map +0 -1
- package/types/testing/wsevents.d.ts +0 -18
- package/types/testing/wsevents.d.ts.map +0 -1
- package/types/webworkertesting/app.d.ts +0 -2
- package/types/webworkertesting/app.d.ts.map +0 -1
- package/types/webworkertesting/worker.d.ts +0 -2
- package/types/webworkertesting/worker.d.ts.map +0 -1
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-explicit-any: 0 */ // --> OFF
|
|
2
|
-
/* eslint @typescript-eslint/no-unused-vars: 0 */ // --> OFF
|
|
3
|
-
import { TinyEmitter } from "tiny-emitter";
|
|
4
|
-
|
|
5
|
-
class aaa extends TinyEmitter {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const x = new TinyEmitter();
|
|
12
|
-
|
|
13
|
-
const OutputString = (str: string) => {
|
|
14
|
-
console.log(`[${str}]`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
x.on('event1', () => {
|
|
18
|
-
console.log('event1');
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
x.on('event2', (str: string) => {
|
|
22
|
-
console.log(`event2 [${str}]`);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
x.on('event3', OutputString);
|
|
26
|
-
|
|
27
|
-
x.emit('event1');
|
|
28
|
-
x.emit('event2', 'Hello 2 World 2');
|
|
29
|
-
x.emit('event3', 'Hello 3 World 3');
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
x.off('event1', (a: string, b: number, c: number) => {
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
x.off('event2', (str: string) => {
|
|
37
|
-
console.log(`event2 [${str}]`);
|
|
38
|
-
});
|
|
39
|
-
x.off('event3', OutputString);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
x.emit('event1');
|
|
45
|
-
x.emit('event2', 'Hello 2 World 2');
|
|
46
|
-
x.emit('event3', 'Hello 3 World 3');
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
x.off('event1');
|
|
51
|
-
x.off('event2');
|
|
52
|
-
x.off('event3');
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
x.emit('event1');
|
|
56
|
-
x.emit('event2', 'Hello 2 World 2');
|
|
57
|
-
x.emit('event3', 'Hello 3 World 3');
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-explicit-any: 0 */ // --> OFF
|
|
2
|
-
import cluster from 'node:cluster';
|
|
3
|
-
|
|
4
|
-
import chalk from 'chalk';
|
|
5
|
-
|
|
6
|
-
import { WorkerProcessBase, STSNamespace, STSRoom, SocketIoServerHelper, STSSocketIONamespace, ProcessOptions } from './../index'
|
|
7
|
-
|
|
8
|
-
//import { Socket, Namespace } from "socket.io";
|
|
9
|
-
import { Socket } from "socket.io";
|
|
10
|
-
|
|
11
|
-
import { InterServerEvents } from './../commonTypes'
|
|
12
|
-
|
|
13
|
-
import { ClientToServerEvents, ServerToClientEvents } from './wsevents'
|
|
14
|
-
|
|
15
|
-
export enum InstrumentManagerEventName {
|
|
16
|
-
CONNECT = 'connect', //@@ should come from socketiohelper
|
|
17
|
-
|
|
18
|
-
SUBSCRIBE = 'stsInstrumentManager-Subscribe',
|
|
19
|
-
UNSUBSCRIBE = 'stsInstrumentManager-Unsubscribe',
|
|
20
|
-
SUBSCRIBE_KEEP_ALIVE = 'stsInstrumentManager-Subscribe-KeepAlive'
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface IIPCSocketMessage {
|
|
24
|
-
socketId: string
|
|
25
|
-
workerId: number
|
|
26
|
-
|
|
27
|
-
data: any
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export enum InstrumentManagerSubCommand {
|
|
31
|
-
OUTPUT_SUBSCRIPTION = 'stsInstrumentManager-OutputSubscriptions'
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export enum IPCCommands {
|
|
35
|
-
PUBLISH_INSTRUMENT_DATA = 'PUBLISH_INSTRUMENT_DATA'
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export class WorkerProcess extends WorkerProcessBase
|
|
39
|
-
{
|
|
40
|
-
constructor(options: ProcessOptions)
|
|
41
|
-
{
|
|
42
|
-
super(options);
|
|
43
|
-
|
|
44
|
-
//this.socketIoHelper = new SocketIoHelper(this as IProcessBase);
|
|
45
|
-
|
|
46
|
-
// Use ClientToServerEvents<true> when the client will pass a request to server with a call back expected with a timeout
|
|
47
|
-
//@@this.socketIoServerHelper = new SocketIoServerHelper<ClientToServerEvents<true>, ServerToClientEvents>({
|
|
48
|
-
this.socketIoServerHelper = new SocketIoServerHelper<ClientToServerEvents, ServerToClientEvents>({
|
|
49
|
-
logger: this.options.logger
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
#LogErrorMessage(message: any) {
|
|
54
|
-
this.options.logger.error(message);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
#LogInfoMessage(message: any) {
|
|
58
|
-
this.options.logger.info(message);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
ReceivedMessageFromMaster = async (messageData: any) => {
|
|
63
|
-
// Only response to these message types (note should be part of generic pub/sub pattern in framework)
|
|
64
|
-
if (messageData.subCommand) {
|
|
65
|
-
if (messageData.subCommand.localeCompare(InstrumentManagerSubCommand.OUTPUT_SUBSCRIPTION) === 0) {
|
|
66
|
-
//this.#LogInfoMessage(chalk.gray(`WorkerProcess.ReceivedMessageFromMaster: messageData: [${JSON.stringify(messageData)}]`));
|
|
67
|
-
this.#LogInfoMessage(chalk.gray(`WorkerProcess.ReceivedMessageFromMaster`));
|
|
68
|
-
const { socketId, workerId } = messageData; //@@ type
|
|
69
|
-
|
|
70
|
-
if (cluster.worker && cluster.worker.id !== workerId) {
|
|
71
|
-
// Invalid data - this workerId must match
|
|
72
|
-
this.#LogInfoMessage(chalk.red(`WorkerProcess.ReceivedMessageFromMaster: Invalid workerId: [${workerId}]. Should have been: [${cluster.worker.id}].`));
|
|
73
|
-
} else {
|
|
74
|
-
const workerProcess: WorkerProcess = this as WorkerProcess;
|
|
75
|
-
if (workerProcess.stsMonitorNamespace !== null) {
|
|
76
|
-
const stsMonitorNamespace = workerProcess.stsMonitorNamespace.socketionamespace;
|
|
77
|
-
const sockets = await stsMonitorNamespace.fetchSockets();
|
|
78
|
-
for (const socket of sockets) {
|
|
79
|
-
if (socket.id.localeCompare(socketId) === 0) {
|
|
80
|
-
this.#LogInfoMessage(chalk.green(`WorkerProcess.ReceivedMessageFromMaster: Sending payload to subscribed client.`));
|
|
81
|
-
|
|
82
|
-
//socket.emit(STSEvent.STSSubInstrumentData as any, model);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
this.#LogInfoMessage(chalk.red(`WorkerProcess.ReceivedMessageFromMaster: Invalid socketId. Expecting socket to existing in socket namespace collection.`));
|
|
87
|
-
// Invalid - could not find matching socketid to send to
|
|
88
|
-
} else {
|
|
89
|
-
this.#LogInfoMessage(chalk.red(`WorkerProcess.ReceivedMessageFromMaster: Invalid workerProcess.stsMonitorNamespace is null. Expecting non-null value.`));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
#SendIPCMessageToMaster(socket: Socket, eventName: any, data: any): void {
|
|
97
|
-
try {
|
|
98
|
-
if (cluster.worker) {
|
|
99
|
-
this.#LogInfoMessage(chalk.gray(`WorkerProcess.#SendIPCMessageToMaster: eventName: [${eventName}]`));
|
|
100
|
-
const payload: IIPCSocketMessage = {
|
|
101
|
-
socketId: socket.id,
|
|
102
|
-
workerId: cluster.worker.id,
|
|
103
|
-
data: data
|
|
104
|
-
}
|
|
105
|
-
//this.#LogInfoMessage(chalk.gray(`WorkerProcess.#SendIPCMessageToMaster: payload: [${JSON.stringify(payload)}]`));
|
|
106
|
-
this.#LogInfoMessage(chalk.gray(`WorkerProcess.#SendIPCMessageToMaster`));
|
|
107
|
-
(process as any).send( { command: eventName, payload }, null, { swallowErrors: true }, (error: any) => {
|
|
108
|
-
if (error) {
|
|
109
|
-
this.#LogErrorMessage(chalk.red(`Error with WorkerProcess:SendIPCMessageToMaster(1): [${error}]`));
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
} catch (error) {
|
|
114
|
-
this.#LogErrorMessage(chalk.red(`Error with WorkerProcess:SendIPCMessageToMaster(2): [${error}]`));
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
WorkerStarted(): any
|
|
119
|
-
{
|
|
120
|
-
//let socketIoNamespace: Namespace<ClientToServerEvents, ServerToClientEvents, InterServerEvents> | null = null;
|
|
121
|
-
if (this.socketIoServerHelper) {
|
|
122
|
-
//socketIoNamespace = this.socketIoServerHelper.SetupNamespace(this.io as any, STSNamespace.STSMonitor,
|
|
123
|
-
this.socketIoServerHelper.SetupNamespace(this.io as any, STSNamespace.STSMonitor,
|
|
124
|
-
// Auto joinn room list
|
|
125
|
-
[
|
|
126
|
-
STSRoom.STSInstrumentDataRoom,
|
|
127
|
-
STSRoom.STSRunnerRoom,
|
|
128
|
-
'room3'
|
|
129
|
-
],
|
|
130
|
-
true, // Make any connecting client automatically join the room list above
|
|
131
|
-
|
|
132
|
-
// Connect call back when a client connects
|
|
133
|
-
(socket: Socket<ClientToServerEvents, ServerToClientEvents, InterServerEvents>) => {
|
|
134
|
-
this.#LogInfoMessage(chalk.gray(`WorkerProcess.#SendIPCMessageToMaster: Id: [${socket.id}] eventName: [${InstrumentManagerEventName.CONNECT}]`));
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
// Custom client to server events
|
|
138
|
-
(socket: Socket<ClientToServerEvents, ServerToClientEvents, InterServerEvents>) => {
|
|
139
|
-
socket.on('subscribe', (data: any) => {
|
|
140
|
-
this.#SendIPCMessageToMaster(socket, 'subscribe', data)
|
|
141
|
-
socket.emit('subscribeAck', data);
|
|
142
|
-
});
|
|
143
|
-
socket.on('unsubscribe', (data: any) => {
|
|
144
|
-
this.#SendIPCMessageToMaster(socket, 'unsubscribe', data)
|
|
145
|
-
socket.emit('unsubscribeAck', data);
|
|
146
|
-
});
|
|
147
|
-
socket.on('subscribeKeepAlive', (data: any) => {
|
|
148
|
-
this.#SendIPCMessageToMaster(socket, 'subscribeKeepAlive', data)
|
|
149
|
-
socket.emit('subscribeKeepAliveAck', data);
|
|
150
|
-
});
|
|
151
|
-
socket.on('done', () => {
|
|
152
|
-
this.#SendIPCMessageToMaster(socket, 'done', {})
|
|
153
|
-
socket.emit('doneAck');
|
|
154
|
-
});
|
|
155
|
-
socket.on('compute', (arg: number, cb) => {
|
|
156
|
-
const res = arg * 2;
|
|
157
|
-
cb(res.toString());
|
|
158
|
-
});
|
|
159
|
-
socket.on('compute2', (arg, cb) => {
|
|
160
|
-
cb({data: arg*2});
|
|
161
|
-
});
|
|
162
|
-
})
|
|
163
|
-
} else {
|
|
164
|
-
throw new Error('WorkerProcess:WorkerStarted(): this.socketIoHelper is null')
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
get stsMonitorNamespace(): STSSocketIONamespace | null {
|
|
169
|
-
if (this.socketIoServerHelper !== null) {
|
|
170
|
-
return this.socketIoServerHelper.GetSTSSocketIONamespace(STSNamespace.STSMonitor);
|
|
171
|
-
}
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-explicit-any: 0 */ // --> OFF
|
|
2
|
-
/* eslint @typescript-eslint/no-unused-vars: 0 */ // --> OFF
|
|
3
|
-
|
|
4
|
-
// Start stack server w/out persistence
|
|
5
|
-
//
|
|
6
|
-
// docker stop redis-stack-server
|
|
7
|
-
// docker rm redis-stack-server
|
|
8
|
-
// docker run -d --restart unless-stopped --name redis-stack-server -p 6379:6379 -e REDIS_ARGS="--save \"\"" -e REDIS_ARGS="--appendonly no" redis/redis-stack-server:latest
|
|
9
|
-
// docker run -d --restart unless-stopped --name redis-stack-server -p 6379:6379 -e REDIS_ARGS="--save \"\" --appendonly no" redis/redis-stack-server:latest
|
|
10
|
-
//
|
|
11
|
-
// docker stop redis-stack-server; docker rm redis-stack-server; docker run -d --restart unless-stopped --name redis-stack-server -v `pwd`/local-redis-stack.conf:/redis-stack.conf -p 6379:6379 redis/redis-stack-server:latest
|
|
12
|
-
|
|
13
|
-
// get the config
|
|
14
|
-
|
|
15
|
-
// FT.SEARCH idx3 "@eventtime:[-inf 18288]" SORTBY eventtime LIMIT 0 3
|
|
16
|
-
// FT.AGGREGATE idx:rawDataHash "@duration:[-inf 10]" GROUPBY 1 @level2 REDUCE COUNT 0 AS 'B10'
|
|
17
|
-
// FT.AGGREGATE idx:rawDataHash "@duration:[-inf 10]" GROUPBY 1 @level4 REDUCE COUNT 0 AS 'B10' SORTBY 1 @level4 LIMIT 0 50
|
|
18
|
-
// For the normal counts and averages
|
|
19
|
-
// FT.AGGREGATE idx:rawDataHash2 "*" GROUPBY 1 @level2 REDUCE SUM 1 @coreCount REDUCE SUM 1 @duration REDUCE SUM 1 @latency REDUCE SUM 1 @cpu
|
|
20
|
-
// FT.AGGREGATE idx:rawDataHash2 '@level2:stsauth' GROUPBY 1 @level2 REDUCE SUM 1 @coreCount REDUCE SUM 1 @duration REDUCE SUM 1 @latency REDUCE SUM 1 @cpu
|
|
21
|
-
// FT.AGGREGATE idx:lambdaIndexInstant GROUPBY 1 @level2 REDUCE SUM 1 @coreCount REDUCE SUM 1 @duration REDUCE SUM 1 @latency REDUCE SUM 1 @cpu
|
|
22
|
-
// FT.SEARCH idx:lambdaIndexInstant LIMIT 0 3
|
|
23
|
-
|
|
24
|
-
// FT.SEARCH redistestindex01 "*"
|
|
25
|
-
// FT.AGGREGATE redistestindex01 "*" GROUPBY 0 REDUCE SUM 1 @count AS 'The_Count'
|
|
26
|
-
// FT.AGGREGATE redistestindex01 "*" GROUPBY 2 @month @week REDUCE SUM 1 @count AS 'The_Count' SORTBY 4 @month ASC @week ASC
|
|
27
|
-
// FT.SEARCH redistestindex01 "*"
|
|
28
|
-
// FT.AGGREGATE redistestindex01 "*" GROUPBY 3 @field1 @field2 @field3 REDUCE COUNT 0 AS 'The_Count' SORTBY 6 @field1 ASC @field2 ASC @field3 ASC
|
|
29
|
-
|
|
30
|
-
// FT.SEARCH redistestindex01 "@field1:1 @field2:1 @field3:1 @field4:1 @field5:1" LIMIT 1 1
|
|
31
|
-
// FT.AGGREGATE redistestindex01 "@field1:1" GROUPBY 3 @field1 @field2 @field3 REDUCE COUNT 0 AS 'The_Count' SORTBY 6 @field1 ASC @field2 ASC @field3 ASC
|
|
32
|
-
// FT.AGGREGATE redistestindex01 "@field1:1 @field2:1 @field3:1" GROUPBY 3 @field1 @field2 @field3 REDUCE COUNT 0 AS 'The_Count' SORTBY 6 @field1 ASC @field2 ASC @field3 ASC
|
|
33
|
-
|
|
34
|
-
// Settings
|
|
35
|
-
// --------
|
|
36
|
-
// Below appears to fix slow queries
|
|
37
|
-
// FT.CONFIG SET TIMEOUT 0
|
|
38
|
-
//
|
|
39
|
-
// FT.CONFIG SET MAXSEARCHRESULTS 1000000
|
|
40
|
-
// FT.CONFIG SET MAXAGGREGATERESULTS 1000000
|
|
41
|
-
|
|
42
|
-
import { } from 'redis';
|
|
43
|
-
import { SchemaFieldTypes, createClient, RedisClientType, AggregateSteps, AggregateGroupByReducers } from 'redis';
|
|
44
|
-
import crypto from 'crypto';
|
|
45
|
-
|
|
46
|
-
import chalk from 'chalk';
|
|
47
|
-
import { JSONObject } from '@nsshunt/stsutils';
|
|
48
|
-
|
|
49
|
-
const indexName = `redistestindex01`;
|
|
50
|
-
const maxPromArrayRecords = 500;
|
|
51
|
-
const maxQueryLoops = 10000;
|
|
52
|
-
|
|
53
|
-
let minRecords = 0;
|
|
54
|
-
let maxRecords = 1000;
|
|
55
|
-
let mode = 0;
|
|
56
|
-
|
|
57
|
-
function getRandomNumber(max: number) {
|
|
58
|
-
const array = new Uint32Array(1);
|
|
59
|
-
crypto.webcrypto.getRandomValues(array);
|
|
60
|
-
return array[0] % max; // The % operator ensures the value is between 0 and 1000
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function getRandomString(min: number, max: number) {
|
|
64
|
-
const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
65
|
-
let result = '';
|
|
66
|
-
const length = min + getRandomNumber(max-min);
|
|
67
|
-
const values = new Uint32Array(length);
|
|
68
|
-
crypto.webcrypto.getRandomValues(values);
|
|
69
|
-
for (let i = 0; i < length; i++) {
|
|
70
|
-
result += charset[values[i] % charset.length];
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const CreateIndex = async (redis: RedisClientType) => {
|
|
76
|
-
try {
|
|
77
|
-
const retVal = await redis.ft.dropIndex(indexName);
|
|
78
|
-
console.log(retVal);
|
|
79
|
-
} catch (error) {
|
|
80
|
-
console.log(chalk.red(error))
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
try {
|
|
84
|
-
const retVal = await redis.ft.create(indexName, { // serviceIndexInstant
|
|
85
|
-
'orderno': { type: SchemaFieldTypes.NUMERIC, SORTABLE: true },
|
|
86
|
-
//'orderdate': { type: SchemaFieldTypes.NUMERIC , SORTABLE: true },
|
|
87
|
-
//'notes': { type: SchemaFieldTypes.TEXT, NOINDEX: true },
|
|
88
|
-
'notes': { type: SchemaFieldTypes.TEXT },
|
|
89
|
-
'field1': { type: SchemaFieldTypes.TEXT }, // The fields need to be sortable to be used in group by aggregations
|
|
90
|
-
'field2': { type: SchemaFieldTypes.TEXT },
|
|
91
|
-
'field3': { type: SchemaFieldTypes.TEXT },
|
|
92
|
-
'field4': { type: SchemaFieldTypes.TEXT },
|
|
93
|
-
'field5': { type: SchemaFieldTypes.TEXT },
|
|
94
|
-
'aggfield': { type: SchemaFieldTypes.TEXT },
|
|
95
|
-
'field1num': { type: SchemaFieldTypes.NUMERIC }, // The fields need to be sortable to be used in group by aggregations
|
|
96
|
-
'field2num': { type: SchemaFieldTypes.NUMERIC },
|
|
97
|
-
'field3num': { type: SchemaFieldTypes.NUMERIC },
|
|
98
|
-
'field4num': { type: SchemaFieldTypes.NUMERIC },
|
|
99
|
-
'field5num': { type: SchemaFieldTypes.NUMERIC },
|
|
100
|
-
'day': { type: SchemaFieldTypes.NUMERIC, SORTABLE: true },
|
|
101
|
-
'week': { type: SchemaFieldTypes.NUMERIC, SORTABLE: true },
|
|
102
|
-
'month': { type: SchemaFieldTypes.NUMERIC, SORTABLE: true },
|
|
103
|
-
'count': { type: SchemaFieldTypes.NUMERIC, NOINDEX: true }
|
|
104
|
-
}, {
|
|
105
|
-
ON: 'HASH',
|
|
106
|
-
PREFIX: 'orders:'
|
|
107
|
-
});
|
|
108
|
-
console.log(retVal);
|
|
109
|
-
} catch (error) {
|
|
110
|
-
console.log(chalk.red(error))
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const BuildData = async (redis: RedisClientType) => {
|
|
115
|
-
|
|
116
|
-
let promArray: Promise<any>[] = [ ];
|
|
117
|
-
|
|
118
|
-
for (let i=minRecords; i < maxRecords; i++) {
|
|
119
|
-
|
|
120
|
-
const record = {
|
|
121
|
-
orderno: i,
|
|
122
|
-
orderdate: new Date().getTime(),
|
|
123
|
-
notes: `Notes for index ${i}`,
|
|
124
|
-
rndtextsmall: `${getRandomString(5, 20)}`,
|
|
125
|
-
rndtextmedium: `${getRandomString(20, 40)}`,
|
|
126
|
-
rndtextlarge: `${getRandomString(40, 80)}`,
|
|
127
|
-
field1: `${i % 10}`,
|
|
128
|
-
field2: `${i % 100}`,
|
|
129
|
-
field3: `${i % 1000}`,
|
|
130
|
-
field4: `${i % 10000}`,
|
|
131
|
-
field5: `${i % 100000}`,
|
|
132
|
-
aggfield: `${i % 10}_${i % 100}_${i % 1000}_${i % 10000}_${i % 100000}`,
|
|
133
|
-
field1num: i % 10,
|
|
134
|
-
field2num: i % 100,
|
|
135
|
-
field3num: i % 1000,
|
|
136
|
-
field4num: i % 10000,
|
|
137
|
-
field5num: i % 100000,
|
|
138
|
-
count: i,
|
|
139
|
-
day: (i % 365),
|
|
140
|
-
month: (i % 12),
|
|
141
|
-
week: (i % 52)
|
|
142
|
-
} as any;
|
|
143
|
-
|
|
144
|
-
promArray.push(redis.HSET(`orders:${i}`, record));
|
|
145
|
-
|
|
146
|
-
if (promArray.length === maxPromArrayRecords) {
|
|
147
|
-
await Promise.all(promArray);
|
|
148
|
-
promArray = [ ];
|
|
149
|
-
console.log(i);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (promArray.length > 0) {
|
|
154
|
-
await Promise.all(promArray);
|
|
155
|
-
promArray = [ ];
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const SearchBy = async (redis: RedisClientType, iterations: number, query: (index: number) => string, sort?: () => JSONObject) => {
|
|
160
|
-
let getrandomstart;
|
|
161
|
-
let getrandomend;
|
|
162
|
-
let getrandomtotal = 0;
|
|
163
|
-
|
|
164
|
-
console.log(chalk.magenta(`Search By: [${query(0)}]`));
|
|
165
|
-
|
|
166
|
-
const start = performance.now();
|
|
167
|
-
for (let i=0; i < iterations; i++) {
|
|
168
|
-
|
|
169
|
-
getrandomstart = performance.now();
|
|
170
|
-
const randomIndex = minRecords + getRandomNumber(maxRecords - minRecords);
|
|
171
|
-
getrandomend = performance.now();
|
|
172
|
-
getrandomtotal += (getrandomend - getrandomstart);
|
|
173
|
-
|
|
174
|
-
const queryOptions = {
|
|
175
|
-
RETURN: [ 'orderno', 'orderdate', 'notes', 'field1', 'field2', 'field3', 'field4', 'field5', 'aggfield' ],
|
|
176
|
-
LIMIT: {
|
|
177
|
-
from: 0,
|
|
178
|
-
size: 100
|
|
179
|
-
}
|
|
180
|
-
} as any;
|
|
181
|
-
|
|
182
|
-
if (sort) {
|
|
183
|
-
queryOptions.SORTBY = sort();
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const retVal = await redis.ft.search(indexName, `${query(randomIndex)}`, queryOptions);
|
|
187
|
-
|
|
188
|
-
if (i % 1000 === 0) {
|
|
189
|
-
console.log(JSON.stringify(retVal));
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
const end = performance.now();
|
|
193
|
-
const diff = end - start;
|
|
194
|
-
console.log(chalk.green(`Total time to query: [${iterations}] times with [${maxRecords}] records total = [${diff}ms]`));
|
|
195
|
-
console.log(chalk.yellow(`Total time to generate random numbers: [${getrandomtotal}]`));
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const Query = async (redis: RedisClientType) => {
|
|
199
|
-
/*
|
|
200
|
-
await SearchBy(redis, maxQueryLoops, index => `@notes:index ${index}`);
|
|
201
|
-
|
|
202
|
-
await SearchBy(redis, maxQueryLoops, index => `@orderno:[${index} ${index + 5}]`, () => {
|
|
203
|
-
return {
|
|
204
|
-
BY: 'orderno',
|
|
205
|
-
DIRECTION: 'DESC'
|
|
206
|
-
}});
|
|
207
|
-
|
|
208
|
-
await SearchBy(redis, 1, index => `@notes:index 1900000*`, () => {
|
|
209
|
-
return {
|
|
210
|
-
BY: 'orderno',
|
|
211
|
-
DIRECTION: 'DESC'
|
|
212
|
-
}});
|
|
213
|
-
|
|
214
|
-
await SearchBy(redis, maxQueryLoops, index => `@field1:1 @field2:41 @field3:941 @field4:9941 @field5:19941 @orderno:[919941 919941]`);
|
|
215
|
-
//await SearchBy(redis, maxQueryLoops, index => `@orderno:919941`);
|
|
216
|
-
|
|
217
|
-
await SearchBy(redis, maxQueryLoops, index => `@aggfield:1_41_941_9941_19941 @orderno:[919941 919941]`);
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
/*
|
|
224
|
-
for (let i=0; i < fieldList.length; i++) {
|
|
225
|
-
if (fieldList[i].dataType.localeCompare('JSON') === 0) {
|
|
226
|
-
aggregateList.push({ type: AggregateGroupByReducers.FIRST_VALUE, property: `@${fieldList[i].fieldName}`, AS: fieldList[i].fieldName });
|
|
227
|
-
} else {
|
|
228
|
-
aggregateList.push({ type: AggregateGroupByReducers.SUM, property: `@${fieldList[i].fieldName}`, AS: fieldList[i].fieldName });
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
*/
|
|
232
|
-
|
|
233
|
-
const retVal = await redis.ft.aggregate(indexName, "*", {
|
|
234
|
-
STEPS: [
|
|
235
|
-
{
|
|
236
|
-
type: AggregateSteps.GROUPBY,
|
|
237
|
-
properties: [`@field1num`, `@field2num`],
|
|
238
|
-
REDUCE: [
|
|
239
|
-
{
|
|
240
|
-
type: AggregateGroupByReducers.COUNT_DISTINCT,
|
|
241
|
-
property: '@count',
|
|
242
|
-
AS: 'My_Count'
|
|
243
|
-
},
|
|
244
|
-
]
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
type: AggregateSteps.SORTBY,
|
|
248
|
-
BY: [
|
|
249
|
-
{
|
|
250
|
-
BY: '@field1num',
|
|
251
|
-
DIRECTION: 'ASC'
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
BY: '@field2num',
|
|
255
|
-
DIRECTION: 'ASC'
|
|
256
|
-
}
|
|
257
|
-
]
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
type: AggregateSteps.LIMIT,
|
|
261
|
-
from: 0,
|
|
262
|
-
size: 5
|
|
263
|
-
}
|
|
264
|
-
]
|
|
265
|
-
});
|
|
266
|
-
console.log(retVal);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const RunThis = async () => {
|
|
270
|
-
|
|
271
|
-
//const redis = await createClient({url: goptions.imRedisMessageProcessorUrl })
|
|
272
|
-
const redis: RedisClientType = await createClient()
|
|
273
|
-
.on('error', error => console.log(chalk.red(error)))
|
|
274
|
-
.connect() as any
|
|
275
|
-
|
|
276
|
-
switch (mode) {
|
|
277
|
-
case 0 :
|
|
278
|
-
await CreateIndex(redis);
|
|
279
|
-
break;
|
|
280
|
-
case 1 :
|
|
281
|
-
await BuildData(redis);
|
|
282
|
-
break;
|
|
283
|
-
case 2 :
|
|
284
|
-
await Query(redis);
|
|
285
|
-
break;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
//redis.quit();
|
|
289
|
-
redis.disconnect();
|
|
290
|
-
|
|
291
|
-
console.log(`Done....`);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
const args = process.argv.slice(2);
|
|
295
|
-
|
|
296
|
-
if (args.length !== 3) {
|
|
297
|
-
console.log('needs mode, min and max on command line. mode = 0 - create new index, 1 - build entries, 2 - query only')
|
|
298
|
-
console.log(args);
|
|
299
|
-
} else {
|
|
300
|
-
mode = parseInt(args[0]);
|
|
301
|
-
minRecords = parseInt(args[1]);
|
|
302
|
-
maxRecords = parseInt(args[2]);
|
|
303
|
-
RunThis();
|
|
304
|
-
}
|
package/src/testing/appsolo.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-explicit-any: 0, @typescript-eslint/no-unused-vars: 0 */ // --> OFF
|
|
2
|
-
|
|
3
|
-
import fs from 'node:fs'
|
|
4
|
-
import chalk from 'chalk';
|
|
5
|
-
|
|
6
|
-
const oldResTx: number[] = []
|
|
7
|
-
const oldResRx: number[] = []
|
|
8
|
-
|
|
9
|
-
const newResRx: number[] = []
|
|
10
|
-
const newResTx: number[] = []
|
|
11
|
-
|
|
12
|
-
const LogInfoMessage = (message: any) => console.log(message)
|
|
13
|
-
const LogErrorMessage = (message: any) => console.error(message)
|
|
14
|
-
|
|
15
|
-
function getNetworkUsage(pidArray: number[]) {
|
|
16
|
-
try {
|
|
17
|
-
|
|
18
|
-
LogInfoMessage(chalk.white.bgCyan.bold('Hello World'));
|
|
19
|
-
|
|
20
|
-
for (let i=0; i < pidArray.length; i++) {
|
|
21
|
-
|
|
22
|
-
const pid = pidArray[i];
|
|
23
|
-
|
|
24
|
-
const filePath = `/proc/${pid}/net/dev`;
|
|
25
|
-
//const filePath = `/proc/${pid}/net/netstat`;
|
|
26
|
-
|
|
27
|
-
// Read the contents of the /proc/[pid]/net/dev file
|
|
28
|
-
const content = fs.readFileSync(filePath, 'utf8');
|
|
29
|
-
|
|
30
|
-
// Process the content to extract relevant information
|
|
31
|
-
const lines = content.trim().split('\n');
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
//this.#LogInfoMessage(lines[3]);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const headers1 = lines[0].split('|').map(header => header.trim());
|
|
38
|
-
const headers2 = lines[1].split('|').map(header => header.trim());
|
|
39
|
-
const data1 = lines[2].split('|').map(value => value.trim());
|
|
40
|
-
const data2 = lines[3].split(':').map(value => value.trim());
|
|
41
|
-
|
|
42
|
-
const uint8Array = Buffer.from(data2[1], 'utf-8');
|
|
43
|
-
|
|
44
|
-
const mystr = data2[1];
|
|
45
|
-
|
|
46
|
-
const result = mystr.replace(/\s+/g, ' ').trim().split(' ');
|
|
47
|
-
|
|
48
|
-
//this.#LogInfoMessage(`${result}`);
|
|
49
|
-
|
|
50
|
-
newResRx[i] = parseFloat(result[0]);
|
|
51
|
-
newResTx[i] = parseFloat(result[8]);
|
|
52
|
-
|
|
53
|
-
LogInfoMessage(`${pid} ${i}: ${newResRx[i]} ${newResTx[i]} : ${(newResRx[i] - oldResRx[i])/1000000.0} ${(newResTx[i] - oldResTx[i])/1000000.0}`);
|
|
54
|
-
|
|
55
|
-
oldResTx[i] = newResTx[i];
|
|
56
|
-
oldResRx[i] = newResRx[i];
|
|
57
|
-
|
|
58
|
-
//this.#LogInfoMessage(uint8Array);
|
|
59
|
-
|
|
60
|
-
//this.#LogInfoMessage(data2[1].split('\t'));
|
|
61
|
-
|
|
62
|
-
// Find the index of the relevant network statistics (e.g., bytes received and transmitted)
|
|
63
|
-
//const rxIndex = headers.indexOf('Receive');
|
|
64
|
-
//const txIndex = headers.indexOf('Transmit');
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// Display network usage information
|
|
68
|
-
/*
|
|
69
|
-
this.#LogInfoMessage(`Network Usage for Process ${pid}:`);
|
|
70
|
-
this.#LogInfoMessage(` Incoming: ${data[rxIndex]} bytes`);
|
|
71
|
-
this.#LogInfoMessage(` Outgoing: ${data[txIndex]} bytes`);
|
|
72
|
-
*/
|
|
73
|
-
}
|
|
74
|
-
} catch (error) {
|
|
75
|
-
LogErrorMessage(`Error reading file: [${error}]`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
setInterval(function() {
|
|
80
|
-
/*
|
|
81
|
-
si.networkStats().then(data => {
|
|
82
|
-
this.#LogInfoMessage(data);
|
|
83
|
-
});
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
getNetworkUsage([ 523493, 523552, 523553, 523554]);
|
|
87
|
-
|
|
88
|
-
//this.#LogInfoMessage(process.pid)
|
|
89
|
-
|
|
90
|
-
//getNetworkUsage()
|
|
91
|
-
|
|
92
|
-
}, 1000)
|
|
93
|
-
|
|
94
|
-
export {
|
|
95
|
-
|
|
96
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
version: '2'
|
|
2
|
-
services:
|
|
3
|
-
zookeeper:
|
|
4
|
-
image: wurstmeister/zookeeper
|
|
5
|
-
ports:
|
|
6
|
-
- "2181:2181"
|
|
7
|
-
restart: unless-stopped
|
|
8
|
-
|
|
9
|
-
kafka:
|
|
10
|
-
image: wurstmeister/kafka
|
|
11
|
-
ports:
|
|
12
|
-
- "9092:9092"
|
|
13
|
-
environment:
|
|
14
|
-
DOCKER_API_VERSION: 1.22
|
|
15
|
-
KAFKA_ADVERTISED_HOST_NAME: 192.168.14.92
|
|
16
|
-
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
|
17
|
-
KAFKA_CREATE_TOPICS: "topic-name2:3:1"
|
|
18
|
-
volumes:
|
|
19
|
-
- /var/run/docker.sock:/var/run/docker.sock
|
|
20
|
-
restart: unless-stopped
|