| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2bf5d96 commit c259786
13 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,6 +95,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UdsChatClient", "examples\U | |||
| 95 | 95 | EndProject | |
| 96 | 96 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UdsChatServer", "examples\UdsChatServer\UdsChatServer.csproj", "{F69349F3-47EE-4C82-B714-83E9B6E931CC}" | |
| 97 | 97 | EndProject | |
| 98 | + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UdsEchoClient", "performance\UdsEchoClient\UdsEchoClient.csproj", "{CA20DA7E-5E5E-4495-9F02-6D5D18558C77}" | ||
| 99 | + EndProject | ||
| 100 | + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UdsEchoServer", "performance\UdsEchoServer\UdsEchoServer.csproj", "{13567A7F-923D-42C0-9451-A1821E087A69}" | ||
| 101 | + EndProject | ||
| 102 | + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UdsMulticastClient", "performance\UdsMulticastClient\UdsMulticastClient.csproj", "{B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044}" | ||
| 103 | + EndProject | ||
| 104 | + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UdsMulticastServer", "performance\UdsMulticastServer\UdsMulticastServer.csproj", "{80C95510-AF12-4CF0-8852-B21241F6C1F3}" | ||
| 105 | + EndProject | ||
| 98 | 106 | Global | |
| 99 | 107 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | |
| 100 | 108 | Debug|Any CPU = Debug|Any CPU | |
@@ -455,6 +463,38 @@ Global | |||
| 455 | 463 | {F69349F3-47EE-4C82-B714-83E9B6E931CC}.Release|Any CPU.Build.0 = Release|Any CPU | |
| 456 | 464 | {F69349F3-47EE-4C82-B714-83E9B6E931CC}.Release|x64.ActiveCfg = Release|Any CPU | |
| 457 | 465 | {F69349F3-47EE-4C82-B714-83E9B6E931CC}.Release|x64.Build.0 = Release|Any CPU | |
| 466 | + {CA20DA7E-5E5E-4495-9F02-6D5D18558C77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 467 | + {CA20DA7E-5E5E-4495-9F02-6D5D18558C77}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 468 | + {CA20DA7E-5E5E-4495-9F02-6D5D18558C77}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 469 | + {CA20DA7E-5E5E-4495-9F02-6D5D18558C77}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 470 | + {CA20DA7E-5E5E-4495-9F02-6D5D18558C77}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 471 | + {CA20DA7E-5E5E-4495-9F02-6D5D18558C77}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 472 | + {CA20DA7E-5E5E-4495-9F02-6D5D18558C77}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 473 | + {CA20DA7E-5E5E-4495-9F02-6D5D18558C77}.Release|x64.Build.0 = Release|Any CPU | ||
| 474 | + {13567A7F-923D-42C0-9451-A1821E087A69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 475 | + {13567A7F-923D-42C0-9451-A1821E087A69}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 476 | + {13567A7F-923D-42C0-9451-A1821E087A69}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 477 | + {13567A7F-923D-42C0-9451-A1821E087A69}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 478 | + {13567A7F-923D-42C0-9451-A1821E087A69}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 479 | + {13567A7F-923D-42C0-9451-A1821E087A69}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 480 | + {13567A7F-923D-42C0-9451-A1821E087A69}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 481 | + {13567A7F-923D-42C0-9451-A1821E087A69}.Release|x64.Build.0 = Release|Any CPU | ||
| 482 | + {B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 483 | + {B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 484 | + {B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 485 | + {B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 486 | + {B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 487 | + {B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 488 | + {B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 489 | + {B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044}.Release|x64.Build.0 = Release|Any CPU | ||
| 490 | + {80C95510-AF12-4CF0-8852-B21241F6C1F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 491 | + {80C95510-AF12-4CF0-8852-B21241F6C1F3}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 492 | + {80C95510-AF12-4CF0-8852-B21241F6C1F3}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 493 | + {80C95510-AF12-4CF0-8852-B21241F6C1F3}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 494 | + {80C95510-AF12-4CF0-8852-B21241F6C1F3}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 495 | + {80C95510-AF12-4CF0-8852-B21241F6C1F3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 496 | + {80C95510-AF12-4CF0-8852-B21241F6C1F3}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 497 | + {80C95510-AF12-4CF0-8852-B21241F6C1F3}.Release|x64.Build.0 = Release|Any CPU | ||
| 458 | 498 | EndGlobalSection | |
| 459 | 499 | GlobalSection(SolutionProperties) = preSolution | |
| 460 | 500 | HideSolutionNode = FALSE | |
@@ -502,6 +542,10 @@ Global | |||
| 502 | 542 | {20E95322-2F84-4147-8014-E50312D86CE5} = {8965E5CD-E36E-4DC5-A36E-827AFFC642D1} | |
| 503 | 543 | {7ED276AD-8EF0-44A5-87B6-60AAA822C5FF} = {81ED94B5-0C65-432C-AEF5-67C3DFF7F2EE} | |
| 504 | 544 | {F69349F3-47EE-4C82-B714-83E9B6E931CC} = {81ED94B5-0C65-432C-AEF5-67C3DFF7F2EE} | |
| 545 | + {CA20DA7E-5E5E-4495-9F02-6D5D18558C77} = {8965E5CD-E36E-4DC5-A36E-827AFFC642D1} | ||
| 546 | + {13567A7F-923D-42C0-9451-A1821E087A69} = {8965E5CD-E36E-4DC5-A36E-827AFFC642D1} | ||
| 547 | + {B1D5EA8F-9A1E-4AD6-9C40-A6A5EFDDE044} = {8965E5CD-E36E-4DC5-A36E-827AFFC642D1} | ||
| 548 | + {80C95510-AF12-4CF0-8852-B21241F6C1F3} = {8965E5CD-E36E-4DC5-A36E-827AFFC642D1} | ||
| 505 | 549 | EndGlobalSection | |
| 506 | 550 | GlobalSection(ExtensibilityGlobals) = postSolution | |
| 507 | 551 | SolutionGuid = {64415837-63D9-474E-A25C-EE91C9CA90C5} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,12 +45,14 @@ Has integration with message protocol based on [Fast Binary Encoding](https://gi | |||
| 45 | 45 | * [TCP echo server](#tcp-echo-server) | |
| 46 | 46 | * [SSL echo server](#ssl-echo-server) | |
| 47 | 47 | * [UDP echo server](#udp-echo-server) | |
| 48 | + * [Unix Domain Socket echo server](#unix-domain-socket-echo-server) | ||
| 48 | 49 | * [WebSocket echo server](#websocket-echo-server) | |
| 49 | 50 | * [WebSocket secure echo server](#websocket-secure-echo-server) | |
| 50 | 51 | * [Benchmark: Multicast](#benchmark-multicast) | |
| 51 | 52 | * [TCP multicast server](#tcp-multicast-server) | |
| 52 | 53 | * [SSL multicast server](#ssl-multicast-server) | |
| 53 | 54 | * [UDP multicast server](#udp-multicast-server) | |
| 55 | + * [Unix Domain Socket multicast server](#unix-domain-socket-multicast-server) | ||
| 54 | 56 | * [WebSocket multicast server](#websocket-multicast-server) | |
| 55 | 57 | * [WebSocket secure multicast server](#websocket-secure-multicast-server) | |
| 56 | 58 | * [Benchmark: Web Server](#benchmark-web-server) | |
@@ -2643,6 +2645,48 @@ Message latency: 15.950 mcs | |||
| 2643 | 2645 | Message throughput: 62693 msg/s | |
| 2644 | 2646 | ``` | |
| 2645 | 2647 | ||
| 2648 | + ### Unix Domain Socket echo server | ||
| 2649 | + | ||
| 2650 | + * [UdsEchoServer](https://github.com/chronoxor/NetCoreServer/blob/master/performance/UdsEchoServer/Program.cs) | ||
| 2651 | + * [UdsEchoClient](https://github.com/chronoxor/NetCoreServer/blob/master/performance/UdsEchoClient/Program.cs) --clients 1 | ||
| 2652 | + | ||
| 2653 | + ``` | ||
| 2654 | + Server Unix Domain Socket path: C:\Users\chronoxor\AppData\Local\Temp\echo.sock | ||
| 2655 | + Working clients: 1 | ||
| 2656 | + Working messages: 1000 | ||
| 2657 | + Message size: 32 | ||
| 2658 | + Seconds to benchmarking: 10 | ||
| 2659 | + | ||
| 2660 | + Errors: 0 | ||
| 2661 | + | ||
| 2662 | + Total time: 10.016 s | ||
| 2663 | + Total data: 208.657 MiB | ||
| 2664 | + Total messages: 6836769 | ||
| 2665 | + Data throughput: 20.850 MiB/s | ||
| 2666 | + Message latency: 1.465 mcs | ||
| 2667 | + Message throughput: 682575 msg/s | ||
| 2668 | + ``` | ||
| 2669 | + | ||
| 2670 | + * [UdsEchoServer](https://github.com/chronoxor/NetCoreServer/blob/master/performance/UdsEchoServer/Program.cs) | ||
| 2671 | + * [UdsEchoClient](https://github.com/chronoxor/NetCoreServer/blob/master/performance/UdsEchoClient/Program.cs) --clients 100 | ||
| 2672 | + | ||
| 2673 | + ``` | ||
| 2674 | + Server Unix Domain Socket path: C:\Users\chronoxor\AppData\Local\Temp\echo.sock | ||
| 2675 | + Working clients: 100 | ||
| 2676 | + Working messages: 1000 | ||
| 2677 | + Message size: 32 | ||
| 2678 | + Seconds to benchmarking: 10 | ||
| 2679 | + | ||
| 2680 | + Errors: 0 | ||
| 2681 | + | ||
| 2682 | + Total time: 12.253 s | ||
| 2683 | + Total data: 602.320 MiB | ||
| 2684 | + Total messages: 19736578 | ||
| 2685 | + Data throughput: 49.157 MiB/s | ||
| 2686 | + Message latency: 620 ns | ||
| 2687 | + Message throughput: 1610666 msg/s | ||
| 2688 | + ``` | ||
| 2689 | + | ||
| 2646 | 2690 | ### WebSocket echo server | |
| 2647 | 2691 | ||
| 2648 | 2692 | * [WsEchoServer](https://github.com/chronoxor/NetCoreServer/blob/master/performance/WsEchoServer/Program.cs) | |
@@ -2866,6 +2910,46 @@ Message latency: 10.682 mcs | |||
| 2866 | 2910 | Message throughput: 93606 msg/s | |
| 2867 | 2911 | ``` | |
| 2868 | 2912 | ||
| 2913 | + ### Unix Domain Socket multicast server | ||
| 2914 | + | ||
| 2915 | + * [UdsMulticastServer](https://github.com/chronoxor/NetCoreServer/blob/master/performance/UdsMulticastServer/Program.cs) | ||
| 2916 | + * [UdsMulticastClient](https://github.com/chronoxor/NetCoreServer/blob/master/performance/UdsMulticastClient/Program.cs) --clients 1 | ||
| 2917 | + | ||
| 2918 | + ``` | ||
| 2919 | + Server Unix Domain Socket path: C:\Users\chronoxor\AppData\Local\Temp\multicast.sock | ||
| 2920 | + Working clients: 1 | ||
| 2921 | + Message size: 32 | ||
| 2922 | + Seconds to benchmarking: 10 | ||
| 2923 | + | ||
| 2924 | + Errors: 0 | ||
| 2925 | + | ||
| 2926 | + Total time: 10.015 s | ||
| 2927 | + Total data: 204.127 MiB | ||
| 2928 | + Total messages: 6688763 | ||
| 2929 | + Data throughput: 20.390 MiB/s | ||
| 2930 | + Message latency: 1.497 mcs | ||
| 2931 | + Message throughput: 667869 msg/s | ||
| 2932 | + ``` | ||
| 2933 | + | ||
| 2934 | + * [UdsMulticastServer](https://github.com/chronoxor/NetCoreServer/blob/master/performance/UdsMulticastServer/Program.cs) | ||
| 2935 | + * [UdsMulticastClient](https://github.com/chronoxor/NetCoreServer/blob/master/performance/UdsMulticastClient/Program.cs) --clients 100 | ||
| 2936 | + | ||
| 2937 | + ``` | ||
| 2938 | + Server Unix Domain Socket path: C:\Users\chronoxor\AppData\Local\Temp\multicast.sock | ||
| 2939 | + Working clients: 100 | ||
| 2940 | + Message size: 32 | ||
| 2941 | + Seconds to benchmarking: 10 | ||
| 2942 | + | ||
| 2943 | + Errors: 0 | ||
| 2944 | + | ||
| 2945 | + Total time: 10.033 s | ||
| 2946 | + Total data: 124.463 MiB | ||
| 2947 | + Total messages: 4078051 | ||
| 2948 | + Data throughput: 12.413 MiB/s | ||
| 2949 | + Message latency: 2.460 mcs | ||
| 2950 | + Message throughput: 406451 msg/s | ||
| 2951 | + ``` | ||
| 2952 | + | ||
| 2869 | 2953 | ### WebSocket multicast server | |
| 2870 | 2954 | ||
| 2871 | 2955 | * [WsMulticastServer](https://github.com/chronoxor/NetCoreServer/blob/master/performance/WsMulticastServer/Program.cs) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,7 +54,7 @@ class Program | |||
| 54 | 54 | static void Main(string[] args) | |
| 55 | 55 | { | |
| 56 | 56 | // Unix Domain Socket path | |
| 57 | - string path = Path.GetTempPath() + Path.DirectorySeparatorChar + "chat.sock"; | ||
| 57 | + string path = Path.Combine(Path.GetTempPath(), "chat.sock"); | ||
| 58 | 58 | if (args.Length > 0) | |
| 59 | 59 | path = args[0]; | |
| 60 | 60 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,7 +60,7 @@ class Program | |||
| 60 | 60 | static void Main(string[] args) | |
| 61 | 61 | { | |
| 62 | 62 | // Unix Domain Socket path | |
| 63 | - string path = Path.GetTempPath() + Path.DirectorySeparatorChar + "chat.sock"; | ||
| 63 | + string path = Path.Combine(Path.GetTempPath(), "chat.sock"); | ||
| 64 | 64 | if (args.Length > 0) | |
| 65 | 65 | path = args[0]; | |
| 66 | 66 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,170 @@ | |||
| 1 | + using System; | ||
| 2 | + using System.Collections.Generic; | ||
| 3 | + using System.IO; | ||
| 4 | + using System.Net.Sockets; | ||
| 5 | + using System.Threading; | ||
| 6 | + using NetCoreServer; | ||
| 7 | + using NDesk.Options; | ||
| 8 | + | ||
| 9 | + namespace UdsEchoClient | ||
| 10 | + { | ||
| 11 | + class EchoClient : UdsClient | ||
| 12 | + { | ||
| 13 | + public EchoClient(string path, int messages) : base(path) | ||
| 14 | + { | ||
| 15 | + _messages = messages; | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + protected override void OnConnected() | ||
| 19 | + { | ||
| 20 | + for (long i = _messages; i > 0; i--) | ||
| 21 | + SendMessage(); | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + protected override void OnSent(long sent, long pending) | ||
| 25 | + { | ||
| 26 | + _sent += sent; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + protected override void OnReceived(byte[] buffer, long offset, long size) | ||
| 30 | + { | ||
| 31 | + _received += size; | ||
| 32 | + while (_received >= Program.MessageToSend.Length) | ||
| 33 | + { | ||
| 34 | + SendMessage(); | ||
| 35 | + _received -= Program.MessageToSend.Length; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + Program.TimestampStop = DateTime.UtcNow; | ||
| 39 | + Program.TotalBytes += size; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + protected override void OnError(SocketError error) | ||
| 43 | + { | ||
| 44 | + Console.WriteLine($"Client caught an error with code {error}"); | ||
| 45 | + Program.TotalErrors++; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + private void SendMessage() | ||
| 49 | + { | ||
| 50 | + SendAsync(Program.MessageToSend); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + private long _sent; | ||
| 54 | + private long _received; | ||
| 55 | + private long _messages; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + class Program | ||
| 59 | + { | ||
| 60 | + public static byte[] MessageToSend; | ||
| 61 | + public static DateTime TimestampStart = DateTime.UtcNow; | ||
| 62 | + public static DateTime TimestampStop = DateTime.UtcNow; | ||
| 63 | + public static long TotalErrors; | ||
| 64 | + public static long TotalBytes; | ||
| 65 | + public static long TotalMessages; | ||
| 66 | + | ||
| 67 | + static void Main(string[] args) | ||
| 68 | + { | ||
| 69 | + bool help = false; | ||
| 70 | + string path = Path.Combine(Path.GetTempPath(), "echo.sock"); | ||
| 71 | + int clients = 100; | ||
| 72 | + int messages = 1000; | ||
| 73 | + int size = 32; | ||
| 74 | + int seconds = 10; | ||
| 75 | + | ||
| 76 | + var options = new OptionSet() | ||
| 77 | + { | ||
| 78 | + { "h|?|help", v => help = v != null }, | ||
| 79 | + { "p|path=", v => path = v }, | ||
| 80 | + { "c|clients=", v => clients = int.Parse(v) }, | ||
| 81 | + { "m|messages=", v => messages = int.Parse(v) }, | ||
| 82 | + { "s|size=", v => size = int.Parse(v) }, | ||
| 83 | + { "z|seconds=", v => seconds = int.Parse(v) } | ||
| 84 | + }; | ||
| 85 | + | ||
| 86 | + try | ||
| 87 | + { | ||
| 88 | + options.Parse(args); | ||
| 89 | + } | ||
| 90 | + catch (OptionException e) | ||
| 91 | + { | ||
| 92 | + Console.Write("Command line error: "); | ||
| 93 | + Console.WriteLine(e.Message); | ||
| 94 | + Console.WriteLine("Try `--help' to get usage information."); | ||
| 95 | + return; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + if (help) | ||
| 99 | + { | ||
| 100 | + Console.WriteLine("Usage:"); | ||
| 101 | + options.WriteOptionDescriptions(Console.Out); | ||
| 102 | + return; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + Console.WriteLine($"Server Unix Domain Socket path: {path}"); | ||
| 106 | + Console.WriteLine($"Working clients: {clients}"); | ||
| 107 | + Console.WriteLine($"Working messages: {messages}"); | ||
| 108 | + Console.WriteLine($"Message size: {size}"); | ||
| 109 | + Console.WriteLine($"Seconds to benchmarking: {seconds}"); | ||
| 110 | + | ||
| 111 | + Console.WriteLine(); | ||
| 112 | + | ||
| 113 | + // Prepare a message to send | ||
| 114 | + MessageToSend = new byte[size]; | ||
| 115 | + | ||
| 116 | + // Create echo clients | ||
| 117 | + var echoClients = new List<EchoClient>(); | ||
| 118 | + for (int i = 0; i < clients; i++) | ||
| 119 | + { | ||
| 120 | + var client = new EchoClient(path, messages); | ||
| 121 | + echoClients.Add(client); | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + TimestampStart = DateTime.UtcNow; | ||
| 125 | + | ||
| 126 | + // Connect clients | ||
| 127 | + Console.Write("Clients connecting..."); | ||
| 128 | + foreach (var client in echoClients) | ||
| 129 | + client.ConnectAsync(); | ||
| 130 | + Console.WriteLine("Done!"); | ||
| 131 | + foreach (var client in echoClients) | ||
| 132 | + while (!client.IsConnected) | ||
| 133 | + Thread.Yield(); | ||
| 134 | + Console.WriteLine("All clients connected!"); | ||
| 135 | + | ||
| 136 | + // Wait for benchmarking | ||
| 137 | + Console.Write("Benchmarking..."); | ||
| 138 | + Thread.Sleep(seconds * 1000); | ||
| 139 | + Console.WriteLine("Done!"); | ||
| 140 | + | ||
| 141 | + // Disconnect clients | ||
| 142 | + Console.Write("Clients disconnecting..."); | ||
| 143 | + foreach (var client in echoClients) | ||
| 144 | + client.Disconnect(); | ||
| 145 | + Console.WriteLine("Done!"); | ||
| 146 | + foreach (var client in echoClients) | ||
| 147 | + while (client.IsConnected) | ||
| 148 | + Thread.Yield(); | ||
| 149 | + Console.WriteLine("All clients disconnected!"); | ||
| 150 | + | ||
| 151 | + Console.WriteLine(); | ||
| 152 | + | ||
| 153 | + Console.WriteLine($"Errors: {TotalErrors}"); | ||
| 154 | + | ||
| 155 | + Console.WriteLine(); | ||
| 156 | + | ||
| 157 | + TotalMessages = TotalBytes / size; | ||
| 158 | + | ||
| 159 | + Console.WriteLine($"Total time: {Utilities.GenerateTimePeriod((TimestampStop - TimestampStart).TotalMilliseconds)}"); | ||
| 160 | + Console.WriteLine($"Total data: {Utilities.GenerateDataSize(TotalBytes)}"); | ||
| 161 | + Console.WriteLine($"Total messages: {TotalMessages}"); | ||
| 162 | + Console.WriteLine($"Data throughput: {Utilities.GenerateDataSize((long)(TotalBytes / (TimestampStop - TimestampStart).TotalSeconds))}/s"); | ||
| 163 | + if (TotalMessages > 0) | ||
| 164 | + { | ||
| 165 | + Console.WriteLine($"Message latency: {Utilities.GenerateTimePeriod((TimestampStop - TimestampStart).TotalMilliseconds / TotalMessages)}"); | ||
| 166 | + Console.WriteLine($"Message throughput: {(long)(TotalMessages / (TimestampStop - TimestampStart).TotalSeconds)} msg/s"); | ||
| 167 | + } | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,16 @@ | |||
| 1 | + <Project Sdk="Microsoft.NET.Sdk"> | ||
| 2 | + | ||
| 3 | + <PropertyGroup> | ||
| 4 | + <OutputType>Exe</OutputType> | ||
| 5 | + <TargetFramework>net6.0</TargetFramework> | ||
| 6 | + </PropertyGroup> | ||
| 7 | + | ||
| 8 | + <ItemGroup> | ||
| 9 | + <PackageReference Include="NDesk.Options.Core" Version="1.2.5" /> | ||
| 10 | + </ItemGroup> | ||
| 11 | + | ||
| 12 | + <ItemGroup> | ||
| 13 | + <ProjectReference Include="..\..\source\NetCoreServer\NetCoreServer.csproj" /> | ||
| 14 | + </ItemGroup> | ||
| 15 | + | ||
| 16 | + </Project> | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments