Skip to content

Commit

Permalink
Framework and core version upgrade, Fix #84, #90 and #91
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadu committed Apr 3, 2020
1 parent 8ad79de commit 5f8f24e
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.suo
*.user
*.sln.docstates
.vscode

# Build results
[Dd]ebug/
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
"typescriptreact",
"yaml",
"yml"
],
"cSpell.enableFiletypes": [
"xml"
]
}
25 changes: 18 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
## v0.15.0 [04/01/2020]

### Release Notes
Migrate to .net core 3.1. I have also moved the base .Net framework to 4.6 (long overdue). If there are anyone still using 4.5.1 I am sorry, its high time you upgrade. Bug & Performance fixes.

### Bugfixes

- [#90](https://github.com/AdysTech/InfluxDB.Client.Net/issues/90): PostPointsAsync method is so slow in linux os
- [#91](https://github.com/AdysTech/InfluxDB.Client.Net/issues/91): StatusCode Forbidden not considered in GetAsync()
- [#84](https://github.com/AdysTech/InfluxDB.Client.Net/issues/84): Execute Continuous Query every seconds

## v0.11.0 [02/01/2020]

### Release Notes
Option to add a rentention policy with infinite duration - Thanks to @jasase
Option to add a retention policy with infinite duration - Thanks to @jasase
Handle truncated responses due to "max-row-limit", (flag "partial=true"). Thanks to @tbraun-hk

### Bugfixes
Expand Down Expand Up @@ -85,7 +96,7 @@ Fix escape sequence to match InfluxDB documentation

### Bugfixes

- [#42](https://github.com/AdysTech/InfluxDB.Client.Net/issues/42): Stop chnaging column header case to Camel case
- [#42](https://github.com/AdysTech/InfluxDB.Client.Net/issues/42): Stop changing column header case to Camel case
- [#48](https://github.com/AdysTech/InfluxDB.Client.Net/issues/48): Incorrect escape sequence for string values with space
- [#50](https://github.com/AdysTech/InfluxDB.Client.Net/issues/50): Missing quotes for retention policy name

Expand All @@ -107,7 +118,7 @@ Allow non ASCII passwords, escape double quotes (Thanks to [@siavelis](https://g
## v0.6.1 [6/03/2017]

### Release Notes
Allow points to be passed without explictly setting time or precision. It also fixes an issue with previopus implementation of the chunking support.
Allow points to be passed without explicitly setting time or precision. It also fixes an issue with previous implementation of the chunking support.


### Bugfixes
Expand All @@ -120,7 +131,7 @@ Allow points to be passed without explictly setting time or precision. It also f


### Breaking Change
- Library will silently drop points older than retention period. This is similar to InfluDB behavios where it will reject those points with an `{"error":"partial write: points beyond retention policy dropped=225"}`
- Library will silently drop points older than retention period. This is similar to InfluDB behavior where it will reject those points with an `{"error":"partial write: points beyond retention policy dropped=225"}`


## v0.6.1 [3/28/2017]
Expand Down Expand Up @@ -156,7 +167,7 @@ This version adds support for .Net Core.
Minor release to fix a blocking bug with data series with microsecond precision.

### Breaking Change
- `InfluxDBClient` now implements `IDispobale`, so plan to expect few warnings in your code. Similarly custom exceptions from this library are marked as `Serializable`
- `InfluxDBClient` now implements `IDisposable`, so plan to expect few warnings in your code. Similarly custom exceptions from this library are marked as `Serializable`

### Bugfixes

Expand All @@ -168,12 +179,12 @@ Minor release to fix a blocking bug with data series with microsecond precision.
### Release Notes
This version is a precursor to enable support for .Net Core. This restructures the solution folders, makes the unit tests truly independent of each other. It also supports deleting Continuous Queries. As of now it still does not support the .NBet Core as there are few open issues (e.g. [#3199](https://github.com/dotnet/cli/issues/3199), [#147](https://github.com/aspnet/Tooling/issues/147)) which are rooted in .Net Core's dependency on `xproj` model. Once they move to `csproj` these issues will be resolved, and this library will support .Net Core as well via .Net Standard (1.6+) PCL. Final goal is to have same set of source files, which gets complied as normal .Net 4.5 class library, and a PCL for the Core.

This version moves away from `JavaScriptSerializer` to [Json.NET](https://github.com/JamesNK/Newtonsoft.Json). Functionally this is a transparent chnage. But this is required as former is not supported in .Net Core.
This version moves away from `JavaScriptSerializer` to [Json.NET](https://github.com/JamesNK/Newtonsoft.Json). Functionally this is a transparent change. But this is required as former is not supported in .Net Core.

### Features

- [#16](https://github.com/AdysTech/InfluxDB.Client.Net/issues/16): Create / Delete Continuous Query
- QueryMultiSeriesAsync returns the time in a `DateTime` object if the series has one. The method also supports different epoch precisoins in query results now.
- QueryMultiSeriesAsync returns the time in a `DateTime` object if the series has one. The method also supports different epoch precisions in query results now.


### Breaking Change
Expand Down
8 changes: 3 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 0.{build}
image: Visual Studio 2017
image: Visual Studio 2019
pull_requests:
do_not_increment_build_number: true
branches:
Expand All @@ -20,11 +20,9 @@ after_test:
deploy:
- provider: NuGet
api_key:
secure: nlBDuJJE7GoAtSvHKJDjdutExvlEQErL8Q9gFqmhURY4xUgFT946cs2mLeQ2Qezi
secure: oy2j73ryetjzlcvhonwq63rd4brxqixubhi4m5vl53dr6u
on:
branch: master
artifacts:
- path: 'src\**\*.nupkg'
name: NuGet Packages
- path: 'src\**\*.snupkg'
name: NuGet Symbol Packages
name: NuGet Packages
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<Description>.Net client for InfluxDB. Supports all InfluxDB version from 0.9 onwards. Supports both .Net 4.6.1+ and .Net Core 2.0+.</Description>
<Product>AdysTech.InfluxDB.Client.Net</Product>
<Company>AdysTech</Company>
<Authors>AdysTech;mvadu</Authors>
<Version>0.11.1.0</Version>
<Version>0.15.0.0</Version>
<PackageId>AdysTech.InfluxDB.Client.Net.Core</PackageId>
<Copyright>© AdysTech 2016-2019</Copyright>
<Copyright>© AdysTech 2016-2020</Copyright>
<PackageProjectUrl>https://github.com/AdysTech/InfluxDB.Client.Net</PackageProjectUrl>
<RepositoryUrl>https://github.com/AdysTech/InfluxDB.Client.Net</RepositoryUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand All @@ -17,20 +17,20 @@
<PackageReleaseNotes>This is a feature rich .Net client for InfluxDB. All methods are exposed as Async methods, so that the calling thread will not be blocked.
It currently supports

1. Connecting using credentials
2. Querying all existing databases
3. Creating new database
4. Querying for the whole DB structure (hierarchical structure of all measurements, and fields)
5. Writing single, multiple values to db
1. Connecting using credentials
2. Querying all existing databases
3. Creating new database
4. Querying for the whole DB structure (hierarchical structure of all measurements, and fields)
5. Writing single, multiple values to db
6.  Retention policy management
7.  Post data to specific retention policies
8.  Query for all Continuous Queries
9.  Create/Drop Continuous Queries
10. Chunking Support in queries
11. Drop databases, measurements or points
12. Get series count or points count for a measurement</PackageReleaseNotes>
<AssemblyVersion>0.11.1.0</AssemblyVersion>
<FileVersion>0.11.1.0</FileVersion>
<AssemblyVersion>0.15.0.0</AssemblyVersion>
<FileVersion>0.15.0.0</FileVersion>
<PackageTags>InfluxDB Influx TSDB TimeSeries InfluxData Chunking retention RetentionPolicy</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AdysTech.InfluxDB.Client.Net</RootNamespace>
<AssemblyName>AdysTech.InfluxDB.Client.Net</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -31,9 +31,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
Expand Down Expand Up @@ -117,7 +114,11 @@
</ItemGroup>
<ItemGroup>
<None Include="AdysTech.InfluxDB.Client.Net.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
This is a feature rich .Net client for InfluxDB. All methods are exposed as Async methods, so that the calling thread will not be blocked.
It currently supports

1. Connecting using credentials
2. Querying all existing databases
3. Creating new database
4. Querying for the whole DB structure (hierarchical structure of all measurements, and fields)
5. Writing single, multiple values to db
1. Connecting using credentials
2. Querying all existing databases
3. Creating new database
4. Querying for the whole DB structure (hierarchical structure of all measurements, and fields)
5. Writing single, multiple values to db
6.  Retention policy management
7.  Post data to specific retention policies
8.  Query for all Continuous Queries
Expand Down
6 changes: 3 additions & 3 deletions src/AdysTech.InfluxDB.Client.Net/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("AdysTech")]
[assembly: AssemblyProduct("AdysTech.InfluxDB.Client.Net")]
[assembly: AssemblyCopyright("Copyright © AdysTech 2016-2019")]
[assembly: AssemblyCopyright("Copyright © AdysTech 2016-2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.11.1.0")]
[assembly: AssemblyFileVersion("0.11.1.0")]
[assembly: AssemblyVersion("0.15.0.0")]
[assembly: AssemblyFileVersion("0.15.0.0")]
4 changes: 0 additions & 4 deletions src/AdysTech.InfluxDB.Client.Net/packages.config

This file was deleted.

37 changes: 21 additions & 16 deletions src/DataStructures/InfluxContinuousQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class InfluxContinuousQuery : IInfluxContinuousQuery
/// </summary>
public bool HasResampleClause { get { return (ResampleDuration != TimeSpan.MinValue || ResampleFrequency != TimeSpan.MinValue); } }

public InfluxContinuousQuery ()
public InfluxContinuousQuery()
{
ResampleDuration = TimeSpan.MinValue;
ResampleFrequency = TimeSpan.MinValue;
Expand All @@ -57,38 +57,43 @@ public InfluxContinuousQuery ()

public bool Deleted { get; internal set; }

internal string GetCreateSyntax ()
internal string GetCreateSyntax()
{
if (!String.IsNullOrWhiteSpace (DBName) && !String.IsNullOrWhiteSpace (Name) && !String.IsNullOrWhiteSpace (Query))
if (!String.IsNullOrWhiteSpace(DBName) && !String.IsNullOrWhiteSpace(Name) && !String.IsNullOrWhiteSpace(Query))
{
if (ResampleDuration == TimeSpan.MinValue && ResampleFrequency == TimeSpan.MinValue)
return $"CREATE CONTINUOUS QUERY \"{Name}\" ON \"{DBName}\" BEGIN {Query} END";
else if (ResampleDuration != TimeSpan.MinValue && ResampleFrequency != TimeSpan.MinValue)
return $"CREATE CONTINUOUS QUERY \"{Name}\" ON \"{DBName}\" RESAMPLE EVERY {ResampleFrequency.TotalMinutes}m FOR {ResampleDuration.TotalMinutes}m BEGIN {Query} END";
else if (ResampleFrequency != TimeSpan.MinValue)
return $"CREATE CONTINUOUS QUERY \"{Name}\" ON \"{DBName}\" RESAMPLE EVERY {ResampleFrequency.TotalMinutes}m BEGIN {Query} END";
{
if (ResampleFrequency.TotalMinutes > 1)
return $"CREATE CONTINUOUS QUERY \"{Name}\" ON \"{DBName}\" RESAMPLE EVERY {(int)ResampleFrequency.TotalMinutes}m BEGIN {Query} END";
else
return $"CREATE CONTINUOUS QUERY \"{Name}\" ON \"{DBName}\" RESAMPLE EVERY {(int)ResampleFrequency.TotalSeconds}s BEGIN {Query} END";
}
else if (ResampleDuration != TimeSpan.MinValue)
return $"CREATE CONTINUOUS QUERY \"{Name}\" ON \"{DBName}\" RESAMPLE FOR {ResampleDuration.TotalMinutes}m BEGIN {Query} END";
}
else if (String.IsNullOrWhiteSpace (Query))
throw new ArgumentException ("Query part of CQ is not defined");
else if (String.IsNullOrWhiteSpace (Name))
throw new ArgumentException ("CQ Name not set");
else if (String.IsNullOrWhiteSpace (DBName))
throw new ArgumentException ("DBName for CQ is not set");
else if (String.IsNullOrWhiteSpace(Query))
throw new ArgumentException("Query part of CQ is not defined");
else if (String.IsNullOrWhiteSpace(Name))
throw new ArgumentException("CQ Name not set");
else if (String.IsNullOrWhiteSpace(DBName))
throw new ArgumentException("DBName for CQ is not set");
return null;
}

internal string GetDropSyntax ()
internal string GetDropSyntax()
{
if (!String.IsNullOrWhiteSpace (DBName) && !String.IsNullOrWhiteSpace (Name))
if (!String.IsNullOrWhiteSpace(DBName) && !String.IsNullOrWhiteSpace(Name))
{
return $"DROP CONTINUOUS QUERY \"{Name}\" ON \"{DBName}\"";
}
else if (String.IsNullOrWhiteSpace (Name))
throw new ArgumentException ("CQ Name not set");
else if (String.IsNullOrWhiteSpace (DBName))
throw new ArgumentException ("DBName for CQ is not set");
else if (String.IsNullOrWhiteSpace(Name))
throw new ArgumentException("CQ Name not set");
else if (String.IsNullOrWhiteSpace(DBName))
throw new ArgumentException("DBName for CQ is not set");
return null;
}
}
Expand Down
Loading

0 comments on commit 5f8f24e

Please sign in to comment.