-
Notifications
You must be signed in to change notification settings - Fork 59
Basic Changes and Move to .NET Standard 2.0 / Framework 4.6.1 #52
Conversation
|
||
private async Task<LineProtocolWriteResult> SendAsync(string payload, Precision precision, CancellationToken cancellationToken = default(CancellationToken)) | ||
{ | ||
var endpoint = $"write?db={Uri.EscapeDataString(_database)}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endpoint
is constructed here but not used.
{ | ||
readonly HttpClient _httpClient; | ||
readonly string _database, _username, _password; | ||
private readonly HttpClient _httpClient; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the codebase doesn't use explicit internal
or private
@@ -3,7 +3,7 @@ | |||
<PropertyGroup> | |||
<Description>A minimal metrics collection API for InfluxDB</Description> | |||
<Authors>influxdb-csharp Contributors</Authors> | |||
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks> | |||
<TargetFrameworks>netstandard2.0</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a move to drop the old targets is probably worthwhile, given the additional maintenance/test burden of multi-targeting. We'd need to mark this as breaking
, however, and rev the package to 2.0.
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With only one active target framework, we don't need the condition.
Thanks for the PR! Looks great; a couple of comments included above. Regarding the follow-up/IoC related changes, would you mind sketching your plan out in an issue first? Might save some back-and-forth turnaround time. Best regards, |
After giving it more thought, the main thing which, i think, make DI friendlier is to return IMetricsCollector from CreateCollector(); I also suggest to split external interfaces (and data structure which used as parameters for those interfaces) The format of IMetricsCollector may be: |
Thanks for the follow-up, appreciate the detail. I don't think it's a goal of this project to create a general metrics collection API - consumers that want to switch between implementations should be able to define their own interfaces over the common subset of whatever metrics collection facilities they want to use. I'd rather not attempt an abstractions/implementation package split on those grounds. Defining .Register(c => ...CreateCollector()).As<IMetricsCollector>() This would also let us avoid the "disposable interface" pattern, which can present some further design challenges further down the line. Perhaps we keep this thread here for finalizing the current PR, and open a separate issue or PR to discuss the other changes? Keen not to take us off on too much of a tangent :-) Best regards, |
The two |
I think we should share an abstract base class between the 2 implementation of ILineProtocolClient |
remove unused code
I did the duplicate code removal (along with removal of unused code) |
Thanks @bnayae - looks good to me. Is this ready to merge? |
ready from my perspective. |
Adding support to UDP channel.
Migrating the project to .NET Standard 2.0 and .NET 4.61 ( .NET Standard 2.0 is compatible with 4.6.1).
Update NuGet dependencies.
After merging this pull request I intend to fix some performance issue and move the code into more Dependency Injection friendly api.