Skip to content

Commit

Permalink
Inc version to 0.3; Saving query perf times on growing table.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwdii committed Aug 3, 2016
1 parent 78e1910 commit 781d90d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Garuda.Data.Test/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="QueryRowsPerfFile" value="C:\Code\DotNet\GarudaUtil\Garuda.Data.Test\QueryRowsPerfFile.csv" />
</appSettings>
</configuration>
4 changes: 4 additions & 0 deletions Garuda.Data.Test/Garuda.Data.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Data" />
</ItemGroup>
<Choose>
Expand All @@ -61,6 +62,9 @@
<Name>Garuda.Data</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
Expand Down
19 changes: 18 additions & 1 deletion Garuda.Data.Test/PhoenixUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;

namespace Garuda.Data.Test
{
Expand Down Expand Up @@ -302,15 +304,19 @@ public void ExecuteNonQueryUpsert1KBigTable()
[TestMethod]
public void ExecuteQueryBigTable()
{
Stopwatch sw = new Stopwatch();
using (IDbConnection c = new PhoenixConnection())
{
c.ConnectionString = this.ConnectionString();
c.Open();

CreateBigTestTableIfNotExists(c, false);

// Query the table
// Query the table and measure performance
sw.Start();
long rows = QueryAllRows(c, "bigtable", 10);
sw.Stop();
WriteQueryRowsPerf(rows, sw.ElapsedMilliseconds);

// How many rows did we get back?
this.TestContext.WriteLine("Queried Rows: {0}", rows);
Expand All @@ -320,6 +326,17 @@ public void ExecuteQueryBigTable()
}
}

private void WriteQueryRowsPerf(long rows, long milliseconds)
{
string file = System.Configuration.ConfigurationManager.AppSettings["QueryRowsPerfFile"];
if(!File.Exists(file))
{
File.AppendAllText(file, "Timestamp,Rows,Duration(ms)\r\n");
}

File.AppendAllText(file, string.Format("{0},{1},{2}\r\n", DateTime.Now.ToString(), rows, milliseconds));
}

private void PreparedCmdParameterTest(int rowsToInsert, string sql, List<Func<object>> pFunc, bool assertTotalRows = true)
{
using (IDbConnection c = new PhoenixConnection())
Expand Down
2 changes: 1 addition & 1 deletion Garuda.Data.Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// 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.1.*")]
[assembly: AssemblyVersion("0.3.*")]
1 change: 1 addition & 0 deletions Garuda.Data/Garuda.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>false</RunCodeAnalysis>
<DocumentationFile>bin\Release\Garuda.Data.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Apache.Phoenix, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion Garuda.Data/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// 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.2.*")]
[assembly: AssemblyVersion("0.3.*")]
2 changes: 1 addition & 1 deletion GarudaUtil/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// 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.2.*")]
[assembly: AssemblyVersion("0.3.*")]

0 comments on commit 781d90d

Please sign in to comment.