Skip to content

Commit e1dda96

Browse files
committed
Initial commit for iot-connected-car sample
1 parent 5e02738 commit e1dda96

21 files changed

+5970
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
<connectionStrings>
7+
<add name="Db" connectionString="Server=tcp:YOUR_SERVER.database.windows.net,1433;Database=ConnectedCar;User ID=YOUR_USERNAME;Password=YOUR_PASSWORD;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"/>
8+
</connectionStrings>
9+
<appSettings>
10+
<add key="insertSPName" value="InsertEvent"/> <!--Stored Procedure Name-->
11+
<add key="numberOfTasks" value="5"/> <!--Number of concurrent async tasks that the Data Generator will use-->
12+
<add key="numberOfCars" value="2500"/> <!--Number of unique cars-->
13+
<add key="batchSize" value="250"/> <!--Row Batch Size that every task produces-->
14+
<add key="commandDelay" value="10"/> <!--Delay between sql commands. You can set this to 0 for max high volume workload-->
15+
<add key="commandTimeout" value="600"/> <!--SQL Command Timeout-->
16+
<add key="enableShock" value="0"/> <!--Flag that turns on/off the data shock. This should be set to 0 for max high volume workload-->
17+
<add key="rpsFrequency" value="1000"/> <!--How frequently the Data Generator Rows Per Second(RPS) is polled-->
18+
<add key="logFileName" value="log.txt"/> <!--Log File Path-->
19+
20+
<!--random number generator settings-->
21+
<add key="HighSpeedProbabilityPower" value="0.5" />
22+
<add key="LowSpeedProbabilityPower" value="0.9" />
23+
<add key="HighOilProbabilityPower" value="0.3" />
24+
<add key="LowOilProbabilityPower" value="1.2" />
25+
<add key="HighTyrePressureProbabilityPower" value="0.5" />
26+
<add key="LowTyrePressureProbabilityPower" value="1.7" />
27+
<add key="HighOutsideTempProbabilityPower" value="0.3" />
28+
<add key="LowOutsideTempProbabilityPower" value="1.2" />
29+
<add key="HighEngineTempProbabilityPower" value="0.3" />
30+
<add key="LowEngineTempProbabilityPower" value="1.2" />
31+
</appSettings>
32+
</configuration>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Threading;
2+
using System.Threading.Tasks;
3+
4+
namespace DataGenerator
5+
{
6+
internal struct CancellableTask
7+
{
8+
public CancellableTask(int id, Task task, CancellationTokenSource cancellationTokenSource)
9+
{
10+
this.Id = id;
11+
this.Task = task;
12+
this.CancellationTokenSource = cancellationTokenSource;
13+
}
14+
15+
public int Id { get; }
16+
17+
public Task Task { get; }
18+
19+
public CancellationTokenSource CancellationTokenSource { get; }
20+
}
21+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{D871B062-06A7-49E3-8BCD-8465B772FC52}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>DataGenerator</RootNamespace>
11+
<AssemblyName>DataGenerator</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
<PlatformTarget>x64</PlatformTarget>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="System" />
35+
<Reference Include="System.configuration" />
36+
<Reference Include="System.Core" />
37+
<Reference Include="System.Xml.Linq" />
38+
<Reference Include="System.Data.DataSetExtensions" />
39+
<Reference Include="Microsoft.CSharp" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Net.Http" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="CancellableTask.cs" />
46+
<Compile Include="SqlDataGeneratorException.cs" />
47+
<Compile Include="SqlDataGenerator.cs" />
48+
<Compile Include="Properties\AssemblyInfo.cs" />
49+
</ItemGroup>
50+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
51+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
52+
Other similar extension points exist, see Microsoft.Common.targets.
53+
<Target Name="BeforeBuild">
54+
</Target>
55+
<Target Name="AfterBuild">
56+
</Target>
57+
-->
58+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("DataGenerator")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("DataGenerator")]
13+
[assembly: AssemblyCopyright("Copyright © 2016")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("d871b062-06a7-49e3-8bcd-8465b772fc52")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)