Permalink
Browse files

removed stress tests, because the implimentation was pretty poor, I l…

…ook forward to a better solution that is more robust in the future.
  • Loading branch information...
1 parent 6203be3 commit 57baf7d2df8f9045b003887ef3e42cd9c2aad451 @nberardi nberardi committed Jan 25, 2013
@@ -1,6 +1,6 @@

-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra", "src\FluentCassandra.csproj", "{EAA32600-3C2A-4B34-B9B2-5764F280FCE3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra.Sandbox", "test\FluentCassandra.Sandbox\FluentCassandra.Sandbox.csproj", "{DE6B46DE-C37A-49AF-8B9A-B9B6D4F03A55}"
@@ -18,18 +18,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{BF5D39
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1A88B962-9A09-4692-80D3-E88712A9E516}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra.StressTest", "test\FluentCassandra.StressTest\FluentCassandra.StressTest.csproj", "{AC3818E2-E260-4193-A3D1-6E3FF87383F6}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra.Tests", "test\FluentCassandra.Tests\FluentCassandra.Tests.csproj", "{9DAF7022-5820-4214-B13E-AC0A1B37691F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{AC1223D1-1638-4DEB-9CFF-8B0C43854BB0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra.LinqPad", "utility\FluentCassandra.LinqPad\FluentCassandra.LinqPad.csproj", "{CACA3463-BBEE-4C7E-AC89-49240B0D8F46}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra.UltraStressTest", "test\FluentCassandra.UltraStressTest\FluentCassandra.UltraStressTest.csproj", "{FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra.MoreTests", "test\FluentCassandra.MoreTests\FluentCassandra.MoreTests.csproj", "{05682974-C961-4A22-9F44-052859F00C15}"
-EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FluentCassandra.vsmdi
@@ -63,16 +57,6 @@ Global
{DE6B46DE-C37A-49AF-8B9A-B9B6D4F03A55}.Release|Mixed Platforms.Build.0 = Release|x86
{DE6B46DE-C37A-49AF-8B9A-B9B6D4F03A55}.Release|x86.ActiveCfg = Release|x86
{DE6B46DE-C37A-49AF-8B9A-B9B6D4F03A55}.Release|x86.Build.0 = Release|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Debug|Any CPU.ActiveCfg = Debug|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Debug|x86.ActiveCfg = Debug|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Debug|x86.Build.0 = Debug|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Release|Any CPU.ActiveCfg = Release|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Release|Mixed Platforms.Build.0 = Release|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Release|x86.ActiveCfg = Release|x86
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Release|x86.Build.0 = Release|x86
{9DAF7022-5820-4214-B13E-AC0A1B37691F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DAF7022-5820-4214-B13E-AC0A1B37691F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DAF7022-5820-4214-B13E-AC0A1B37691F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -91,35 +75,13 @@ Global
{CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Release|x86.ActiveCfg = Release|Any CPU
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Debug|Any CPU.ActiveCfg = Debug|x86
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Debug|x86.ActiveCfg = Debug|x86
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Debug|x86.Build.0 = Debug|x86
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Release|Any CPU.ActiveCfg = Release|x86
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Release|Mixed Platforms.Build.0 = Release|x86
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Release|x86.ActiveCfg = Release|x86
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5}.Release|x86.Build.0 = Release|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Debug|Any CPU.ActiveCfg = Debug|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Debug|x86.ActiveCfg = Debug|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Debug|x86.Build.0 = Debug|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Release|Any CPU.ActiveCfg = Release|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Release|Mixed Platforms.Build.0 = Release|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Release|x86.ActiveCfg = Release|x86
- {05682974-C961-4A22-9F44-052859F00C15}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {AC3818E2-E260-4193-A3D1-6E3FF87383F6} = {1A88B962-9A09-4692-80D3-E88712A9E516}
{9DAF7022-5820-4214-B13E-AC0A1B37691F} = {1A88B962-9A09-4692-80D3-E88712A9E516}
- {FA126D9D-9072-4FF0-B4EB-1B1F95BF65D5} = {1A88B962-9A09-4692-80D3-E88712A9E516}
- {05682974-C961-4A22-9F44-052859F00C15} = {1A88B962-9A09-4692-80D3-E88712A9E516}
+ {DE6B46DE-C37A-49AF-8B9A-B9B6D4F03A55} = {1A88B962-9A09-4692-80D3-E88712A9E516}
{CACA3463-BBEE-4C7E-AC89-49240B0D8F46} = {AC1223D1-1638-4DEB-9CFF-8B0C43854BB0}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{AC3818E2-E260-4193-A3D1-6E3FF87383F6}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>FluentCassandra.StressTest</RootNamespace>
- <AssemblyName>FluentCassandra.StressTest</AssemblyName>
- <FileAlignment>512</FileAlignment>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\FluentCassandra\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- <ReleaseVersion>1.0.0</ReleaseVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup>
- <StartupObject>FluentCassandra.StressTest.Program</StartupObject>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Numerics" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- <Reference Include="xunit">
- <HintPath>..\..\packages\xunit.1.9.0.1566\lib\xunit.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Main.cs" />
- <Compile Include="StressTest1.cs" />
- <Compile Include="StressTest2.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\src\FluentCassandra.csproj">
- <Project>{EAA32600-3C2A-4B34-B9B2-5764F280FCE3}</Project>
- <Name>FluentCassandra</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace FluentCassandra.StressTest
-{
- class Program1
- {
- static void Main(string[] args)
- {
- Console.Error.WriteLine("Stress Test 1");
- try
- {
- //tressTest1.Test();
- }
- catch (Exception ex)
- {
- Console.Error.WriteLine(ex.Message);
- Console.Error.WriteLine(ex.StackTrace);
- }
- Console.Error.WriteLine("");
- Console.Error.WriteLine("Stress Test 2");
- try
- {
- StressTest.StressTest2.Test();
- }
- catch (Exception ex)
- {
- Console.Error.WriteLine(ex.Message);
- Console.Error.WriteLine(ex.StackTrace);
- }
- }
- }
-}
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("FluentCassandra.StressTest")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("FluentCassandra.StressTest")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("326ca67f-6a52-4925-8d05-e5bf0af7eff3")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// 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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,119 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading.Tasks;
-using FluentCassandra.Types;
-using FluentCassandra.Connections;
-using FluentCassandra.Apache.Cassandra;
-
-namespace FluentCassandra.StressTest
-{
- internal class Program
- {
- private static int count = 10000;
- private static int dataLength = 1024;
- private static int threadCount = 8;
- private static string keyspaceName = "Blog";
- private static Server server = new Server("localhost");
-
- private static void SendDebugToConsole()
- {
- // Disable Debug traces
- Trace.Listeners.Clear();
-
- // Disable Debug assert message boxes
- using (DefaultTraceListener listener = new DefaultTraceListener())
- {
- listener.AssertUiEnabled = false;
- Trace.Listeners.Add(listener);
- }
-
- // Restore Debug traces to NUnit's Console.Out tab.
- Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
- }
-
- private static void SetupKeyspace()
- {
- using (var db = new CassandraContext(keyspace: keyspaceName, server: server))
- {
- if (!db.KeyspaceExists(keyspaceName))
- db.AddKeyspace(new KsDef {
- Name = keyspaceName,
- Replication_factor = 1,
- Strategy_class = "org.apache.cassandra.locator.SimpleStrategy",
- Cf_defs = new List<CfDef>()
- });
-
- if (!db.Keyspace.ColumnFamilyExists("Posts"))
- db.AddColumnFamily(new CfDef {
- Name = "Posts",
- Keyspace = keyspaceName,
- Column_type = "Super",
- Comparator_type = "UTF8Type",
- Subcomparator_type = "UTF8Type",
- Comment = "Used for blog posts."
- });
- }
- }
-
- private static void Main(string[] args)
- {
- SendDebugToConsole();
- SetupKeyspace();
-
- Task[] tasks = new Task[threadCount];
-
- Stopwatch watch = new Stopwatch();
- watch.Start();
-
- for (int i = 0; i < threadCount; i++)
- {
- tasks[i] = Task.Factory.StartNew(DoWork);
- }
-
- Task.WaitAll(tasks);
- watch.Stop();
-
- double rate = (count * threadCount) / watch.Elapsed.TotalSeconds;
- double throughput = rate * dataLength;
- Console.WriteLine("Total Completed: " + watch.Elapsed + "\tRate: " + rate + "\tThroughput: " + throughput);
- Console.ReadKey();
- }
-
- private static void DoWork()
- {
- using (var db = new CassandraContext(keyspace: keyspaceName, server: server))
- {
- Stopwatch watch = new Stopwatch();
- watch.Start();
-
- Random random = new Random();
- byte[] data = new byte[dataLength];
- random.NextBytes(data);
- int errors = 0;
-
- for (int i = 0; i < count; i++)
- {
- // Insert
- Guid postId = Guid.NewGuid();
- string titleName = i.ToString();
-
- var family = db.GetColumnFamily<UTF8Type, UTF8Type>("Posts");
-
- dynamic post = family.CreateRecord(postId);
- dynamic details = post.CreateSuperColumn();
-
- details.Body = data;
-
- post[DateTime.Now] = details;
- db.Attach(post);
- db.SaveChanges();
- }
-
- double rate = count / watch.Elapsed.TotalSeconds;
- double throughput = rate * data.Length;
- Console.WriteLine("Completed: " + watch.Elapsed + "\tRate: " + rate + "\tThroughput: " + throughput + "\tErrors:" + errors);
- }
- }
- }
-}
Oops, something went wrong.

0 comments on commit 57baf7d

Please sign in to comment.