├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── NewRelic.Platform.Sdk.FunctionalTests
├── App.config
├── ContextTest.cs
├── NewRelic.Platform.Sdk.FunctionalTests.csproj
├── Properties
│ └── AssemblyInfo.cs
├── RunnerTest.cs
├── TestAgent.cs
├── TestAgentFactory.cs
└── config
│ ├── newrelic.json
│ └── plugin.json
├── NewRelic.Platform.Sdk.UnitTests
├── AgentTest.cs
├── App.config
├── Binding
│ ├── ComponentDataTest.cs
│ ├── ContextTest.cs
│ ├── MetricDataTest.cs
│ └── RequestDataTest.cs
├── MockContext.cs
├── NewRelic.Platform.Sdk.UnitTests.csproj
├── Processors
│ └── EpochProcessorTest.cs
├── Properties
│ └── AssemblyInfo.cs
├── RunnerTest.cs
├── TestAgent.cs
├── TestConfig.cs
├── TestSerializationHelper.cs
├── Utils
│ └── LoggerTests.cs
└── config
│ ├── newrelic.json
│ └── plugin.json
├── NewRelic.Platform.Sdk.sln
├── NewRelic.Platform.Sdk
├── Agent.cs
├── AgentFactory.cs
├── App.config
├── Binding
│ ├── AgentData.cs
│ ├── ComponentData.cs
│ ├── Context.cs
│ ├── IContext.cs
│ ├── MetricData.cs
│ └── RequestData.cs
├── Configuration
│ ├── INewRelicConfig.cs
│ ├── LogLevel.cs
│ └── NewRelicConfig.cs
├── Extensions
│ └── ExtensionsForAssembly.cs
├── Externals
│ ├── NLog v2.1.0
│ │ ├── NLog.dll
│ │ └── NLog.xml
│ └── Newtonsoft.Json v5.8
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
├── NewRelic.Platform.Sdk.csproj
├── Processors
│ ├── EpochProcessor.cs
│ └── IProcessor.cs
├── Properties
│ └── AssemblyInfo.cs
├── Runner.cs
├── Utils
│ ├── Constants.cs
│ ├── JsonHelper.cs
│ ├── Logger.cs
│ ├── NewRelicServiceException.cs
│ └── StringExtensions.cs
└── config
│ └── newrelic.template.json
├── README.md
└── dist
├── newrelic_platform_dotnet_sdk_v1.0.0.0.zip
└── newrelic_platform_dotnet_sdk_v1.0.0.1.zip
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2 | [Bb]in/
3 | [Oo]bj/
4 | [Bb]uild/
5 |
6 | # mstest test results
7 | TestResults
8 |
9 | ## Ignore Visual Studio temporary files, build results, and
10 | ## files generated by popular Visual Studio add-ons.
11 |
12 | # Ignore generated assembly version info file
13 | AssemblyInfoVersion.cs
14 |
15 | # User-specific files
16 | *.suo
17 | *.user
18 | *.sln.docstates
19 |
20 | # Build results
21 | [Dd]ebug/
22 | [Rr]elease/
23 | x64/
24 | *_i.c
25 | *_p.c
26 | *.ilk
27 | *.meta
28 | *.obj
29 | *.pch
30 | *.pdb
31 | *.pgc
32 | *.pgd
33 | *.rsp
34 | *.sbr
35 | *.tlb
36 | *.tli
37 | *.tlh
38 | *.tmp
39 | *.log
40 | *.vspscc
41 | *.vssscc
42 | .builds
43 |
44 | # Visual C++ cache files
45 | ipch/
46 | *.aps
47 | *.ncb
48 | *.opensdf
49 | *.sdf
50 |
51 | # Visual Studio profiler
52 | *.psess
53 | *.vsp
54 | *.vspx
55 |
56 | # Guidance Automation Toolkit
57 | *.gpState
58 |
59 | # ReSharper is a .NET coding add-in
60 | _ReSharper*
61 |
62 | # NCrunch
63 | *.ncrunch*
64 | .*crunch*.local.xml
65 |
66 | # Installshield output folder
67 | [Ee]xpress
68 |
69 | # DocProject is a documentation generator add-in
70 | DocProject/buildhelp/
71 | DocProject/Help/*.HxT
72 | DocProject/Help/*.HxC
73 | DocProject/Help/*.hhc
74 | DocProject/Help/*.hhk
75 | DocProject/Help/*.hhp
76 | DocProject/Help/Html2
77 | DocProject/Help/html
78 |
79 | # Click-Once directory
80 | publish
81 |
82 | # Publish Web Output
83 | *.Publish.xml
84 |
85 | # NuGet Packages Directory
86 | packages
87 |
88 | # Windows Azure Build Output
89 | csx
90 | *.build.csdef
91 |
92 | # Windows Store app package directory
93 | AppPackages/
94 |
95 | # Others
96 | [Bb]in
97 | [Oo]bj
98 | sql
99 | TestResults
100 | [Tt]est[Rr]esult*
101 | *.Cache
102 | ClientBin
103 | [Ss]tyle[Cc]op.*
104 | ~$*
105 | *.dbmdl
106 | Generated_Code #added for RIA/Silverlight projects
107 |
108 | # Backup & report files from converting an old project file to a newer
109 | # Visual Studio version. Backup files are not needed, because we have git ;-)
110 | _UpgradeReport_Files/
111 | Backup*/
112 | UpgradeLog*.XML
113 |
114 | newrelic.json
115 | *.orig
116 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## New Relic Platform .NET SDK Change Log
2 |
3 | ### v1.0.0.1 - 2/8/2015
4 |
5 | * Fixed a bug where failures communicating with New Relic would crash a plugin.
6 |
7 | ### v1.0.0.0 - 8/29/2014
8 |
9 | * Initial release
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2013 New Relic, Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/NewRelic.Platform.Sdk.FunctionalTests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/NewRelic.Platform.Sdk.FunctionalTests/ContextTest.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using NewRelic.Platform.Sdk.Binding;
4 | using System.Net;
5 | using NewRelic.Platform.Sdk.Utils;
6 |
7 | namespace NewRelic.Platform.Sdk.FunctionalTests
8 | {
9 | [TestClass]
10 | [DeploymentItem(@"config/newrelic.json", "config")]
11 | [DeploymentItem(@"config/plugin.json", "config")]
12 | public class ContextTest
13 | {
14 | [TestMethod]
15 | public void TestSendMetricsToServiceSucceeds()
16 | {
17 | var context = new Context() { Version = "1.0.0" };
18 |
19 | context.ReportMetric("com.newrelic.sdkfunctest", "FunctionalTest1", "TestMetric", "unit", 2);
20 | context.ReportMetric("com.newrelic.sdkfunctest", "FunctionalTest1", "TestMetric", "unit", 3);
21 | context.ReportMetric("com.newrelic.sdkfunctest", "FunctionalTest1", "TestMetric", "unit", 4);
22 |
23 | context.ReportMetric("com.newrelic.sdkfunctest", "FunctionalTest2", "TestMetric", "unit", 5);
24 |
25 | context.ReportMetric("com.newrelic.sdkfunctest", "FunctionalTest3", "TestMetric", "unit", 6);
26 | context.ReportMetric("com.newrelic.sdkfunctest", "FunctionalTest3", "TestMetric", "unit", 7);
27 |
28 | var requestData = context.RequestData;
29 | Assert.IsTrue(requestData.HasComponents(), "Request data should have components before send");
30 | Assert.AreEqual(3, ((List