From 2f7a9c34aae17402c2c1e395ad1d032871f74709 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 28 Jan 2020 23:03:05 +0200 Subject: Added DataDog experiment. --- Software/Experiments/DataDogTest/DataDogTest.sln | 25 ++++++++++ .../Experiments/DataDogTest/DataDogTest/App.config | 6 +++ .../DataDogTest/DataDogTest/DataDogTest.csproj | 57 ++++++++++++++++++++++ .../Experiments/DataDogTest/DataDogTest/Program.cs | 35 +++++++++++++ .../DataDogTest/Properties/AssemblyInfo.cs | 36 ++++++++++++++ .../DataDogTest/DataDogTest/packages.config | 4 ++ 6 files changed, 163 insertions(+) create mode 100644 Software/Experiments/DataDogTest/DataDogTest.sln create mode 100644 Software/Experiments/DataDogTest/DataDogTest/App.config create mode 100644 Software/Experiments/DataDogTest/DataDogTest/DataDogTest.csproj create mode 100644 Software/Experiments/DataDogTest/DataDogTest/Program.cs create mode 100644 Software/Experiments/DataDogTest/DataDogTest/Properties/AssemblyInfo.cs create mode 100644 Software/Experiments/DataDogTest/DataDogTest/packages.config (limited to 'Software/Experiments') diff --git a/Software/Experiments/DataDogTest/DataDogTest.sln b/Software/Experiments/DataDogTest/DataDogTest.sln new file mode 100644 index 000000000..f19109441 --- /dev/null +++ b/Software/Experiments/DataDogTest/DataDogTest.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.645 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataDogTest", "DataDogTest\DataDogTest.csproj", "{C4E9E97A-212E-4310-821B-03CA96C56FD3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C4E9E97A-212E-4310-821B-03CA96C56FD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4E9E97A-212E-4310-821B-03CA96C56FD3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4E9E97A-212E-4310-821B-03CA96C56FD3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4E9E97A-212E-4310-821B-03CA96C56FD3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F8F884C2-A101-4D53-BC9A-71D300578C4D} + EndGlobalSection +EndGlobal diff --git a/Software/Experiments/DataDogTest/DataDogTest/App.config b/Software/Experiments/DataDogTest/DataDogTest/App.config new file mode 100644 index 000000000..731f6de6c --- /dev/null +++ b/Software/Experiments/DataDogTest/DataDogTest/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Software/Experiments/DataDogTest/DataDogTest/DataDogTest.csproj b/Software/Experiments/DataDogTest/DataDogTest/DataDogTest.csproj new file mode 100644 index 000000000..8dbb58e3a --- /dev/null +++ b/Software/Experiments/DataDogTest/DataDogTest/DataDogTest.csproj @@ -0,0 +1,57 @@ + + + + + Debug + AnyCPU + {C4E9E97A-212E-4310-821B-03CA96C56FD3} + Exe + DataDogTest + DataDogTest + v4.6.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\DogStatsD-CSharp-Client.4.0.0\lib\net461\StatsdClient.dll + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Experiments/DataDogTest/DataDogTest/Program.cs b/Software/Experiments/DataDogTest/DataDogTest/Program.cs new file mode 100644 index 000000000..c153bd388 --- /dev/null +++ b/Software/Experiments/DataDogTest/DataDogTest/Program.cs @@ -0,0 +1,35 @@ +using StatsdClient; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace DataDogTest +{ + class Program + { + static void Main(string[] args) + { + var dogstatsdConfig = new StatsdConfig + { + StatsdServerName = "127.0.0.1", + StatsdPort = 8125, + }; + + DogStatsd.Configure(dogstatsdConfig); + + Console.WriteLine("Started..."); + + for (int i = 0; i < 1000; i += 100) + { + Console.WriteLine($"Writing {i + 1}..."); + DogStatsd.Set("Overall Temperature", i + 1, tags: new[] { "environment:dev" }); + Thread.Sleep(1000); + } + + Console.ReadLine(); + } + } +} diff --git a/Software/Experiments/DataDogTest/DataDogTest/Properties/AssemblyInfo.cs b/Software/Experiments/DataDogTest/DataDogTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5c1b3e92d --- /dev/null +++ b/Software/Experiments/DataDogTest/DataDogTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("DataDogTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DataDogTest")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[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("c4e9e97a-212e-4310-821b-03ca96c56fd3")] + +// 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")] diff --git a/Software/Experiments/DataDogTest/DataDogTest/packages.config b/Software/Experiments/DataDogTest/DataDogTest/packages.config new file mode 100644 index 000000000..c1d4a9b26 --- /dev/null +++ b/Software/Experiments/DataDogTest/DataDogTest/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file -- cgit v1.3.1