Skip to content

Commit 3f310f5

Browse files
Merge pull request #103 from lightstep/prep012release
prepare for 0.12 release; add perf test
2 parents a66163e + f2fe3db commit 3f310f5

File tree

12 files changed

+273
-145
lines changed

12 files changed

+273
-145
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# Changelog
2+
_v0.12.0_
3+
*Note* This release modifies the `Tracer` object to make it disposable. You may wish to check your integrations and wrappers to ensure that this doesn't break anything.
4+
- The `Tracer` now implements `IDisposable`. This is intended to be used by implementors to add an "off" switch that can stop span recording.
5+
- The version of certain Protobuf libraries required has been relaxed to it's pre-0.11 state.
6+
- We no longer make a copy of the span buffer to count how many spans are in it in certain cases, improving performance.
7+
28
_v0.11.0_
39
*Note* This release changes the public API surface. It should not impact you, but it might if you're manging span contexts manually.
410
- The `SpanContext` signature has changed and parent span ID is now a ulong as well (this continues work released in 0.8.0). Performance should be improved for serialization to proto.

LightStep.sln

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28010.2016
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30517.126
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LightStep", "src\LightStep\LightStep.csproj", "{E5F75D2A-B882-46BB-A173-0F77E46498E2}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BE409569-9FA2-4741-8ABF-327D56E6598E}"
99
ProjectSection(SolutionItems) = preProject
10-
README.md = README.md
1110
CHANGELOG.md = CHANGELOG.md
11+
README.md = README.md
1212
EndProjectSection
1313
EndProject
1414
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1359ACF9-43F2-4E09-94FD-32EB2C6239BA}"
@@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightStep.CSharpAspectTestA
2323
EndProject
2424
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightStep.CSharpDITestApp", "examples\LightStep.CSharpDITestApp\LightStep.CSharpDITestApp.csproj", "{358E688A-D19E-4149-85CD-E804738C0C3F}"
2525
EndProject
26+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LightStep.TracerPerf.Tests", "test\LightStep.TracerPerf.Tests\LightStep.TracerPerf.Tests.csproj", "{B54D212A-812F-4102-9852-15D4F084434D}"
27+
EndProject
2628
Global
2729
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2830
Debug|Any CPU = Debug|Any CPU
@@ -49,6 +51,10 @@ Global
4951
{358E688A-D19E-4149-85CD-E804738C0C3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
5052
{358E688A-D19E-4149-85CD-E804738C0C3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
5153
{358E688A-D19E-4149-85CD-E804738C0C3F}.Release|Any CPU.Build.0 = Release|Any CPU
54+
{B54D212A-812F-4102-9852-15D4F084434D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55+
{B54D212A-812F-4102-9852-15D4F084434D}.Debug|Any CPU.Build.0 = Debug|Any CPU
56+
{B54D212A-812F-4102-9852-15D4F084434D}.Release|Any CPU.ActiveCfg = Release|Any CPU
57+
{B54D212A-812F-4102-9852-15D4F084434D}.Release|Any CPU.Build.0 = Release|Any CPU
5258
EndGlobalSection
5359
GlobalSection(SolutionProperties) = preSolution
5460
HideSolutionNode = FALSE
@@ -59,6 +65,7 @@ Global
5965
{65A11CA6-E7E9-43B6-A36D-6B54EA9BD758} = {113EDBB5-081F-4581-B687-9293B4D74312}
6066
{1B83F7CF-E2AA-4A81-9C0B-2DA716D5C982} = {113EDBB5-081F-4581-B687-9293B4D74312}
6167
{358E688A-D19E-4149-85CD-E804738C0C3F} = {113EDBB5-081F-4581-B687-9293B4D74312}
68+
{B54D212A-812F-4102-9852-15D4F084434D} = {1359ACF9-43F2-4E09-94FD-32EB2C6239BA}
6269
EndGlobalSection
6370
GlobalSection(ExtensibilityGlobals) = postSolution
6471
SolutionGuid = {0890664C-9CE4-4960-90A4-AD6565C970E3}

build.cake

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var buildDir = Directory("./build");
88
var distDir = Directory("./dist");
99
var solution = "./LightStep.sln";
1010
var library = "./src/LightStep/LightStep.csproj";
11+
var testLib = "./test/LightStep.Tests/LightStep.Tests.csproj";
1112
var lightStepAssemblyInfoFile = "./src/LightStep/Properties/AssemblyInfo.cs";
1213
var version = EnvironmentVariable("CIRCLE_TAG") ?? "v0.0.0";
1314
version = version.TrimStart('v');
@@ -35,7 +36,8 @@ Task("Restore")
3536
.IsDependentOn("Clean")
3637
.Does( ()=>
3738
{
38-
DotNetCoreRestore(solution);
39+
DotNetCoreRestore(library);
40+
DotNetCoreRestore(testLib);
3941
});
4042

4143
Task("Build")
@@ -65,20 +67,17 @@ Task("Test")
6567
.IsDependentOn("Build")
6668
.Does(() =>
6769
{
68-
var projects = GetFiles("./test/**/*.csproj");
70+
var unitProject = "./test/LightStep.Tests/LightStep.Tests.csproj";
6971
var coverletSettings = new CoverletSettings {
7072
CollectCoverage = true,
7173
CoverletOutputFormat = CoverletOutputFormat.opencover,
7274
CoverletOutputDirectory = Directory("./build"),
7375
CoverletOutputName = $"coverage.xml",
7476
ExcludeByFile = { "../../src/LightStep/Collector/Collector.cs", "../../src/LightStep/LightStep.cs" }
7577
};
76-
foreach(var project in projects)
77-
{
78-
DotNetCoreTest(project.FullPath, new DotNetCoreTestSettings {
79-
Logger = "xunit;LogFilePath=../../build/test_results.xml"
80-
}, coverletSettings);
81-
}
78+
DotNetCoreTest(unitProject, new DotNetCoreTestSettings {
79+
Logger = "xunit;LogFilePath=../../build/test_results.xml"
80+
}, coverletSettings);
8281
});
8382

8483
Task("Publish")

src/LightStep/LightStepSpanRecorder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public IEnumerable<SpanData> GetSpans()
6565

6666
public int GetSpanCount()
6767
{
68-
6968
return Spans.Count;
7069
}
7170
}

test/LightStep.Tests/TracerLogTest.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace LightStep.Tests
6+
{
7+
class TracerLogTest
8+
{
9+
}
10+
}

test/LightStep.Tests/TracerTests.cs

Lines changed: 0 additions & 133 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<IsPackable>false</IsPackable>
6+
<RootNamespace>LightStep.TracerPerf.Tests</RootNamespace>
7+
</PropertyGroup>
8+
9+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
10+
<WarningsAsErrors />
11+
</PropertyGroup>
12+
13+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
14+
<WarningsAsErrors />
15+
</PropertyGroup>
16+
17+
<ItemGroup>
18+
<PackageReference Include="Serilog" Version="2.10.0" />
19+
<PackageReference Include="Serilog.Sinks.Console" Version="3.0.0" />
20+
<PackageReference Include="FakeItEasy" Version="6.0.0" />
21+
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.4" />
22+
<PackageReference Include="NUnit" Version="3.12.0" />
23+
<PackageReference Include="NUnit3TestAdapter" Version="3.16.0" />
24+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.0" />
25+
</ItemGroup>
26+
<ItemGroup>
27+
<ProjectReference Include="..\..\src\LightStep\LightStep.csproj" />
28+
</ItemGroup>
29+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# tracer-tests
2+
For benchmarking tracers of distributed tracing that implements OpenTracing
3+
4+
To collect data in terms of memory, network, and log usages, bring in tracer dependencies and run the NUnit tests.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using NUnit.Framework;
2+
using Serilog;
3+
4+
namespace LightStep.TracerPerf.Tests
5+
{
6+
public class TracerLogTest : TracerTestBase
7+
{
8+
[SetUp]
9+
public void SetUp()
10+
{
11+
Log.Logger = new LoggerConfiguration()
12+
.MinimumLevel.Verbose()
13+
.WriteTo.Console()
14+
.CreateLogger();
15+
16+
Log.Information("Log is setup!");
17+
}
18+
19+
[Test]
20+
public void TestExecute([Values("NoFinishNoDispose", "ExplicitFinish", "FinishOnDispose", "DisposeNoFinish")]
21+
string tracingMethod)
22+
{
23+
Execute(TracingMethods[tracingMethod]);
24+
}
25+
}
26+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using System;
2+
using NUnit.Framework;
3+
4+
namespace LightStep.TracerPerf.Tests
5+
{
6+
[SingleThreaded]
7+
public class TracerMemoryTest : TracerTestBase
8+
{
9+
[SetUp]
10+
public void SetUp()
11+
{
12+
Iter = 100;
13+
Chunk = 10000;
14+
}
15+
16+
[Test]
17+
public void TestExecute_NoFinishNoDispose()
18+
{
19+
Console.WriteLine(nameof(NoFinishNoDispose));
20+
var heapInfo = Execute(NoFinishNoDispose);
21+
foreach (var num in heapInfo)
22+
{
23+
Console.WriteLine(num);
24+
}
25+
}
26+
27+
[Test]
28+
public void TestExecute_ExplicitFinish()
29+
{
30+
Console.WriteLine(nameof(ExplicitFinish));
31+
var heapInfo = Execute(ExplicitFinish);
32+
foreach (var num in heapInfo)
33+
{
34+
Console.WriteLine(num);
35+
}
36+
}
37+
38+
[Test]
39+
public void TestExecute_FinishOnDispose()
40+
{
41+
Console.WriteLine(nameof(FinishOnDispose));
42+
var heapInfo = Execute(FinishOnDispose);
43+
foreach (var num in heapInfo)
44+
{
45+
Console.WriteLine(num);
46+
}
47+
}
48+
49+
[Test]
50+
public void TestExecute_DisposeNoFinish()
51+
{
52+
Console.WriteLine(nameof(DisposeNoFinish));
53+
var heapInfo = Execute(DisposeNoFinish);
54+
foreach (var num in heapInfo)
55+
{
56+
Console.WriteLine(num);
57+
}
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)