diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 86c245e..ab7bcc1 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -35,8 +35,8 @@ jobs: /p:CollectCoverage=true \ /p:CoverletOutputFormat=opencover \ /p:CoverletOutput=/home/runner/work/AeroSharp/AeroSharp/ \ - - name: Publish Code Coverage - uses: codecov/codecov-action@v3 - with: - files: /home/runner/work/AeroSharp/AeroSharp/coverage.net7.0.opencover.xml,/home/runner/work/AeroSharp/AeroSharp/coverage.net6.0.opencover.xml - fail_ci_if_error: true + # - name: Publish Code Coverage + # uses: codecov/codecov-action@v3 + # with: + # files: /home/runner/work/AeroSharp/AeroSharp/coverage.net7.0.opencover.xml,/home/runner/work/AeroSharp/AeroSharp/coverage.net6.0.opencover.xml + # fail_ci_if_error: true diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 5be4d65..81457ed 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -33,8 +33,8 @@ jobs: /p:CollectCoverage=true \ /p:CoverletOutputFormat=opencover \ /p:CoverletOutput=/home/runner/work/AeroSharp/AeroSharp/ \ - - name: Publish Code Coverage - uses: codecov/codecov-action@v3 - with: - files: /home/runner/work/AeroSharp/AeroSharp/coverage.net7.0.opencover.xml,/home/runner/work/AeroSharp/AeroSharp/coverage.net6.0.opencover.xml - fail_ci_if_error: true + # - name: Publish Code Coverage + # uses: codecov/codecov-action@v3 + # with: + # files: /home/runner/work/AeroSharp/AeroSharp/coverage.net7.0.opencover.xml,/home/runner/work/AeroSharp/AeroSharp/coverage.net6.0.opencover.xml + # fail_ci_if_error: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 50c6506..178f709 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.1] - 2024-08-12 + +### Changed + +Expose MaxConnsPerNode from AeroSpike to allow easier performance tuning. + ## [1.1.0] - 2023-04-11 ### Changed diff --git a/src/AeroSharp/AeroSharp.csproj b/src/AeroSharp/AeroSharp.csproj index 894afd5..466501a 100644 --- a/src/AeroSharp/AeroSharp.csproj +++ b/src/AeroSharp/AeroSharp.csproj @@ -3,10 +3,10 @@ net6.0;net7.0 true - 1.1.0 + 1.1.1 Wayfair Wrapper around the .NET Aerospike client that provides a variety of methods for storing and retrieving data in Aerospike - Wayfair ©2023 + Wayfair ©2024 LICENSE https://github.com/wayfair-incubator/AeroSharp https://github.com/wayfair-incubator/AeroSharp diff --git a/src/AeroSharp/Connection/ClientProvider.cs b/src/AeroSharp/Connection/ClientProvider.cs index 69d91fe..e60279d 100644 --- a/src/AeroSharp/Connection/ClientProvider.cs +++ b/src/AeroSharp/Connection/ClientProvider.cs @@ -1,5 +1,5 @@ -using System.Linq; -using Aerospike.Client; +using Aerospike.Client; +using System.Linq; namespace AeroSharp.Connection { @@ -20,12 +20,13 @@ internal ClientProvider(ConnectionContext connection, Credentials credentials, C user = credentials.Username, password = credentials.Password, asyncMaxCommandAction = GetMaxCommandAction(configuration.MaxCommandAction), - asyncMaxCommands = configuration.AsyncMaxCommands + asyncMaxCommands = configuration.AsyncMaxCommands, + maxConnsPerNode = configuration.MaxConnsPerNode }; _hosts = connection.BootstrapServers.Select(s => new Host(s, connection.Port)).ToArray(); - } - + } + public ClientWrapper GetClient() { if (_client is null || !_client.Client.Connected) @@ -38,6 +39,7 @@ public ClientWrapper GetClient() } } } + return _client; } diff --git a/src/AeroSharp/Connection/ClientWrapper.cs b/src/AeroSharp/Connection/ClientWrapper.cs index a9b1cdb..1a6494b 100644 --- a/src/AeroSharp/Connection/ClientWrapper.cs +++ b/src/AeroSharp/Connection/ClientWrapper.cs @@ -1,5 +1,5 @@ -using System; -using Aerospike.Client; +using Aerospike.Client; +using System; namespace AeroSharp.Connection { @@ -17,6 +17,6 @@ public ClientWrapper(IAsyncClient client) Client = client; } - public Node[] ClientNodes => Client.Nodes; + public Node[] ClientNodes => Client.Nodes; } } diff --git a/src/AeroSharp/Connection/ConnectionConfiguration.cs b/src/AeroSharp/Connection/ConnectionConfiguration.cs index 81097fd..643a34b 100644 --- a/src/AeroSharp/Connection/ConnectionConfiguration.cs +++ b/src/AeroSharp/Connection/ConnectionConfiguration.cs @@ -1,6 +1,6 @@ -using System; +using AeroSharp.Enums; +using System; using System.Diagnostics.CodeAnalysis; -using AeroSharp.Enums; namespace AeroSharp.Connection { @@ -18,6 +18,12 @@ public ConnectionConfiguration() ConnectionTimeout = TimeSpan.FromSeconds(10); AsyncMaxCommands = 500; MaxCommandAction = MaxCommandAction.DELAY; // Recommended by Aerospike Enterprise Support (behavior when asyncMaxCommands is exceeded) + + // Leave it as default value from Aerospike Client. + // Note: Aerospike client has updated their default settings, see the change reasons from Aerospike forum: https://discuss.aerospike.com/t/client-1772-client-configurations-changes-reasons/9699 + // We will update AsyncMaxCommands to 100 when we bump up Aerospike version so we align with Aerospike settings. + // Relationship between asyncMaxConnsPerNode and MaxConnsPerNode can be found from here: https://aerospike.com/apidocs/csharp/html/f_aerospike_client_asyncclientpolicy_asyncmaxconnspernode + MaxConnsPerNode = 100; } /// @@ -34,5 +40,10 @@ public ConnectionConfiguration() /// Defines how to handle cases when the maximum number of concurrent database commands has been exceeded for the async client. /// public MaxCommandAction MaxCommandAction { get; set; } + + /// + /// The maximum sync connections per node. + /// + public int MaxConnsPerNode { get; set; } } -} \ No newline at end of file +}