Skip to content

Commit

Permalink
Merge pull request #103 from lightstep/prep012release
Browse files Browse the repository at this point in the history
prepare for 0.12 release; add perf test
  • Loading branch information
austinlparker authored Dec 10, 2020
2 parents a66163e + f2fe3db commit 3f310f5
Show file tree
Hide file tree
Showing 12 changed files with 273 additions and 145 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Changelog
_v0.12.0_
*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.
- The `Tracer` now implements `IDisposable`. This is intended to be used by implementors to add an "off" switch that can stop span recording.
- The version of certain Protobuf libraries required has been relaxed to it's pre-0.11 state.
- We no longer make a copy of the span buffer to count how many spans are in it in certain cases, improving performance.

_v0.11.0_
*Note* This release changes the public API surface. It should not impact you, but it might if you're manging span contexts manually.
- 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.
Expand Down
13 changes: 10 additions & 3 deletions LightStep.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2016
# Visual Studio Version 16
VisualStudioVersion = 16.0.30517.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LightStep", "src\LightStep\LightStep.csproj", "{E5F75D2A-B882-46BB-A173-0F77E46498E2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BE409569-9FA2-4741-8ABF-327D56E6598E}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
CHANGELOG.md = CHANGELOG.md
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1359ACF9-43F2-4E09-94FD-32EB2C6239BA}"
Expand All @@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightStep.CSharpAspectTestA
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightStep.CSharpDITestApp", "examples\LightStep.CSharpDITestApp\LightStep.CSharpDITestApp.csproj", "{358E688A-D19E-4149-85CD-E804738C0C3F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LightStep.TracerPerf.Tests", "test\LightStep.TracerPerf.Tests\LightStep.TracerPerf.Tests.csproj", "{B54D212A-812F-4102-9852-15D4F084434D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -49,6 +51,10 @@ Global
{358E688A-D19E-4149-85CD-E804738C0C3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{358E688A-D19E-4149-85CD-E804738C0C3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{358E688A-D19E-4149-85CD-E804738C0C3F}.Release|Any CPU.Build.0 = Release|Any CPU
{B54D212A-812F-4102-9852-15D4F084434D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B54D212A-812F-4102-9852-15D4F084434D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B54D212A-812F-4102-9852-15D4F084434D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B54D212A-812F-4102-9852-15D4F084434D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -59,6 +65,7 @@ Global
{65A11CA6-E7E9-43B6-A36D-6B54EA9BD758} = {113EDBB5-081F-4581-B687-9293B4D74312}
{1B83F7CF-E2AA-4A81-9C0B-2DA716D5C982} = {113EDBB5-081F-4581-B687-9293B4D74312}
{358E688A-D19E-4149-85CD-E804738C0C3F} = {113EDBB5-081F-4581-B687-9293B4D74312}
{B54D212A-812F-4102-9852-15D4F084434D} = {1359ACF9-43F2-4E09-94FD-32EB2C6239BA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0890664C-9CE4-4960-90A4-AD6565C970E3}
Expand Down
15 changes: 7 additions & 8 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var buildDir = Directory("./build");
var distDir = Directory("./dist");
var solution = "./LightStep.sln";
var library = "./src/LightStep/LightStep.csproj";
var testLib = "./test/LightStep.Tests/LightStep.Tests.csproj";
var lightStepAssemblyInfoFile = "./src/LightStep/Properties/AssemblyInfo.cs";
var version = EnvironmentVariable("CIRCLE_TAG") ?? "v0.0.0";
version = version.TrimStart('v');
Expand Down Expand Up @@ -35,7 +36,8 @@ Task("Restore")
.IsDependentOn("Clean")
.Does( ()=>
{
DotNetCoreRestore(solution);
DotNetCoreRestore(library);
DotNetCoreRestore(testLib);
});

Task("Build")
Expand Down Expand Up @@ -65,20 +67,17 @@ Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var projects = GetFiles("./test/**/*.csproj");
var unitProject = "./test/LightStep.Tests/LightStep.Tests.csproj";
var coverletSettings = new CoverletSettings {
CollectCoverage = true,
CoverletOutputFormat = CoverletOutputFormat.opencover,
CoverletOutputDirectory = Directory("./build"),
CoverletOutputName = $"coverage.xml",
ExcludeByFile = { "../../src/LightStep/Collector/Collector.cs", "../../src/LightStep/LightStep.cs" }
};
foreach(var project in projects)
{
DotNetCoreTest(project.FullPath, new DotNetCoreTestSettings {
Logger = "xunit;LogFilePath=../../build/test_results.xml"
}, coverletSettings);
}
DotNetCoreTest(unitProject, new DotNetCoreTestSettings {
Logger = "xunit;LogFilePath=../../build/test_results.xml"
}, coverletSettings);
});

Task("Publish")
Expand Down
1 change: 0 additions & 1 deletion src/LightStep/LightStepSpanRecorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public IEnumerable<SpanData> GetSpans()

public int GetSpanCount()
{

return Spans.Count;
}
}
Expand Down
10 changes: 10 additions & 0 deletions test/LightStep.Tests/TracerLogTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace LightStep.Tests
{
class TracerLogTest
{
}
}
133 changes: 0 additions & 133 deletions test/LightStep.Tests/TracerTests.cs

This file was deleted.

29 changes: 29 additions & 0 deletions test/LightStep.TracerPerf.Tests/LightStep.TracerPerf.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>LightStep.TracerPerf.Tests</RootNamespace>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<WarningsAsErrors />
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<WarningsAsErrors />
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.0.0" />
<PackageReference Include="FakeItEasy" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.4" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\LightStep\LightStep.csproj" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions test/LightStep.TracerPerf.Tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# tracer-tests
For benchmarking tracers of distributed tracing that implements OpenTracing

To collect data in terms of memory, network, and log usages, bring in tracer dependencies and run the NUnit tests.
26 changes: 26 additions & 0 deletions test/LightStep.TracerPerf.Tests/TracerLogTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using NUnit.Framework;
using Serilog;

namespace LightStep.TracerPerf.Tests
{
public class TracerLogTest : TracerTestBase
{
[SetUp]
public void SetUp()
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.Console()
.CreateLogger();

Log.Information("Log is setup!");
}

[Test]
public void TestExecute([Values("NoFinishNoDispose", "ExplicitFinish", "FinishOnDispose", "DisposeNoFinish")]
string tracingMethod)
{
Execute(TracingMethods[tracingMethod]);
}
}
}
60 changes: 60 additions & 0 deletions test/LightStep.TracerPerf.Tests/TracerMemoryTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using NUnit.Framework;

namespace LightStep.TracerPerf.Tests
{
[SingleThreaded]
public class TracerMemoryTest : TracerTestBase
{
[SetUp]
public void SetUp()
{
Iter = 100;
Chunk = 10000;
}

[Test]
public void TestExecute_NoFinishNoDispose()
{
Console.WriteLine(nameof(NoFinishNoDispose));
var heapInfo = Execute(NoFinishNoDispose);
foreach (var num in heapInfo)
{
Console.WriteLine(num);
}
}

[Test]
public void TestExecute_ExplicitFinish()
{
Console.WriteLine(nameof(ExplicitFinish));
var heapInfo = Execute(ExplicitFinish);
foreach (var num in heapInfo)
{
Console.WriteLine(num);
}
}

[Test]
public void TestExecute_FinishOnDispose()
{
Console.WriteLine(nameof(FinishOnDispose));
var heapInfo = Execute(FinishOnDispose);
foreach (var num in heapInfo)
{
Console.WriteLine(num);
}
}

[Test]
public void TestExecute_DisposeNoFinish()
{
Console.WriteLine(nameof(DisposeNoFinish));
var heapInfo = Execute(DisposeNoFinish);
foreach (var num in heapInfo)
{
Console.WriteLine(num);
}
}
}
}
Loading

0 comments on commit 3f310f5

Please sign in to comment.