Skip to content

Commit 5d626cb

Browse files
committed
Merge pull request #11 from AdysTech/wip
Release 0.5 version
2 parents 4996edd + 98e2518 commit 5d626cb

File tree

11 files changed

+205
-84
lines changed

11 files changed

+205
-84
lines changed

AdysTech.InfluxDB.Client.Net.Test/AdysTech.InfluxDB.Client.Net.Test.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
<AppDesignerFolder>Properties</AppDesignerFolder>
99
<RootNamespace>InfluxDB.Client.Test</RootNamespace>
1010
<AssemblyName>InfluxDB.Client.Test</AssemblyName>
11-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1414
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
1515
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
1616
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
1717
<IsCodedUITest>False</IsCodedUITest>
1818
<TestProjectType>UnitTest</TestProjectType>
19+
<TargetFrameworkProfile />
1920
</PropertyGroup>
2021
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2122
<DebugSymbols>true</DebugSymbols>
@@ -61,6 +62,11 @@
6162
<Name>AdysTech.InfluxDB.Client.Net</Name>
6263
</ProjectReference>
6364
</ItemGroup>
65+
<ItemGroup>
66+
<None Include="Tests.orderedtest">
67+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
68+
</None>
69+
</ItemGroup>
6470
<Choose>
6571
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
6672
<ItemGroup>

AdysTech.InfluxDB.Client.Net.Test/DataGen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static double RandomDouble()
4545

4646
public static string RandomString()
4747
{
48-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ,=/\\";
48+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ,=/";
4949
var stringChars = new StringBuilder (16, 16);
5050

5151
for ( int i = 0; i < stringChars.Capacity; i++ )

AdysTech.InfluxDB.Client.Net.Test/InfluxDBClientTest.cs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,6 @@ public async Task TestGetInfluxDBNamesAsync_ServiceUnavailable()
3232
var r = await client.GetInfluxDBNamesAsync();
3333
}
3434

35-
//[TestMethod]
36-
//[ExpectedException(typeof(UnauthorizedAccessException))]
37-
//public async Task TestGetInfluxDBNamesAsync_Auth()
38-
//{
39-
// var client = new InfluxDBClient(influxUrl);
40-
// var r = await client.GetInfluxDBNamesAsync();
41-
//}
42-
43-
44-
//[TestMethod]
45-
//[ExpectedException(typeof(UnauthorizedAccessException))]
46-
//public async Task TestGetInfluxDBNamesAsync_Auth2()
47-
//{
48-
// var client = new InfluxDBClient(influxUrl, invalidUName, dbpwd);
49-
// var r = await client.GetInfluxDBNamesAsync();
50-
//}
51-
52-
53-
5435
[TestMethod]
5536
public async Task TestGetInfluxDBNamesAsync()
5637
{
@@ -164,10 +145,16 @@ public async Task TestQueryAsync()
164145
}
165146

166147
[TestMethod]
167-
public async Task TestQueryAsync_MultiSeries()
148+
public async Task TestQueryMultiSeriesAsync()
168149
{
169150
var client = new InfluxDBClient(influxUrl, dbUName, dbpwd);
170-
var r = await client.QueryMultiSeriesAsync("_internal", "Show field keys");
151+
152+
Stopwatch s = new Stopwatch();
153+
s.Start();
154+
var r = await client.QueryMultiSeriesAsync("_internal", "SHOW STATS");
155+
156+
s.Stop();
157+
Debug.WriteLine("Elapsed{0}", s.ElapsedMilliseconds);
171158
Assert.IsTrue(r != null && r.Count > 0, "QueryMultiSeriesAsync retunred null or invalid data");
172159
}
173160

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<OrderedTest name="tests" storage="e:\visual studio projects\console\influxdb.client.net\adystech.influxdb.client.net.test\tests.orderedtest" id="ae8a7c43-c134-4ca0-8c92-bb18e7ee9a52" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
3+
<TestLinks>
4+
<TestLink id="57d01cf9-83ef-a005-0f85-eb5792247c78" name="TestGetInfluxDBNamesAsync_ServiceUnavailable" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
5+
<TestLink id="9058be20-12ae-1e8a-f312-8b02d9c07c05" name="TestGetInfluxDBNamesAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
6+
<TestLink id="67797d4e-b1d0-c575-40ac-6dc644dba8bc" name="TestCreateDatabaseAsync_InvalidName" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
7+
<TestLink id="532c19b5-ea6f-7493-b6d5-a1d2fa80cf18" name="TestCreateDatabaseAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
8+
<TestLink id="2c6bcc58-eaf5-7f2e-2b7b-729cbf03814d" name="TestGetRetentionPoliciesAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
9+
<TestLink id="7ea260f2-0906-a35a-2113-4c026c5612a9" name="TestCreateRetentionPolicy" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
10+
<TestLink id="5f73da07-603f-a3cd-63b0-4cd60d51017e" name="TestGetInfluxDBStructureAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
11+
<TestLink id="a07759b7-7705-cd3b-4cfc-32ec6481d258" name="TestGetInfluxDBStructureAsync_InvalidDB" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
12+
<TestLink id="1b9c2e37-956b-53ca-1d60-95e7a1ba8945" name="TestGetServerVersionAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
13+
<TestLink id="0fcf513b-dd30-6a18-48ac-393796540954" name="TestQueryAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
14+
<TestLink id="53cf4c7c-91be-9ef6-6a88-f63a16979ee9" name="TestQueryMultiSeriesAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
15+
<TestLink id="6001049c-1b46-8498-b0d8-f808d2fe3833" name="TestPostPointsAsync_PartialWrite" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
16+
<TestLink id="44e1133f-177e-5d30-ba36-52eaa5600717" name="TestPostPointsAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
17+
<TestLink id="055ba1a3-9cd7-e3ed-cb3b-bba752d90066" name="TestPostPointAsyncNonDefaultRetention" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
18+
<TestLink id="0242c815-8578-05d6-d171-01aaf80218cd" name="TestPostPointAsync_InvalidReq" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
19+
<TestLink id="8297f3de-98f5-89e1-6696-05ea3860a846" name="TestPostMixedPointAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
20+
<TestLink id="5f4cd12a-b9b1-1b27-476e-835a2aa4d1c1" name="TestPostPointsAsync_Batch" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
21+
</TestLinks>
22+
</OrderedTest>

AdysTech.InfluxDB.Client.Net/AdysTech.InfluxDB.Client.Net.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>AdysTech.InfluxDB.Client.Net</RootNamespace>
1111
<AssemblyName>AdysTech.InfluxDB.Client.Net</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
1415
</PropertyGroup>
1516
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1617
<DebugSymbols>true</DebugSymbols>
@@ -34,6 +35,7 @@
3435
<Reference Include="System.Core" />
3536
<Reference Include="System.Net.Http" />
3637
<Reference Include="System.Runtime.Serialization" />
38+
<Reference Include="System.Web.Extensions" />
3739
<Reference Include="System.Xml.Linq" />
3840
<Reference Include="System.Data.DataSetExtensions" />
3941
<Reference Include="Microsoft.CSharp" />

AdysTech.InfluxDB.Client.Net/DataContracts/InfluxJsonTypes.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,31 @@ namespace AdysTech.InfluxDB.Client.Net.DataContracts
1010
[DataContract]
1111
public class Series
1212
{
13-
[DataMember(Name="name")]
14-
public string SeriesName { get; set; }
13+
[DataMember(Name = "name")]
14+
public string Name { get; set; }
1515

1616
[DataMember(Name = "tags")]
1717
public Dictionary<string,string> Tags { get; set; }
1818

19-
[DataMember (Name = "columns")]
20-
public List<string> ColumnHeaders { get; set; }
19+
[DataMember(Name = "columns")]
20+
public List<string> Columns { get; set; }
2121

22-
[DataMember (Name = "values")]
22+
[DataMember(Name = "values")]
2323
public List<List<string>> Values { get; set; }
24+
2425
}
2526

2627
[DataContract]
2728
public class Result
2829
{
29-
[DataMember (Name = "series")]
30+
[DataMember(Name = "series")]
3031
public List<Series> Series { get; set; }
3132
}
3233

3334
[DataContract]
3435
public class InfluxResponse
3536
{
36-
[DataMember (Name = "results")]
37+
[DataMember(Name = "results")]
3738
public List<Result> Results { get; set; }
3839
}
3940
}

0 commit comments

Comments
 (0)