Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] Change manual instrumentation approach to not use reverse duck-typing #5214

Merged
merged 21 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4de7a6a
Fix null ref in `GetManagedTracerVersion()`
andrewlock Feb 16, 2024
dcfd28c
Add benchmark for manual instrumentation
andrewlock Feb 16, 2024
5514a9d
Try alternative ducktyping approach
andrewlock Feb 19, 2024
8207160
Fix OpenTracing helpers
andrewlock Feb 19, 2024
e6eb70d
Revert the changes to benchmark stat types
andrewlock Feb 19, 2024
3fb9429
Update manual Ci Visibility to not rely on reverse duck-typing
andrewlock Feb 19, 2024
4327791
Revert the snapshots to match the existing public API
andrewlock Feb 19, 2024
6332e28
Use instrumentation of DuckType.DuckCast<T> in Datadog.Trace.Manual.c…
andrewlock Feb 19, 2024
605b79a
Skip the duck typing tests that won't work and add some others
andrewlock Feb 19, 2024
5a1ff03
Simplify the implementation
andrewlock Feb 23, 2024
c754cb9
Redesign approach with CI Visibility
andrewlock Feb 27, 2024
67d650b
Update generated code
andrewlock Feb 27, 2024
798d6fa
Apply suggestions from code review
andrewlock Feb 29, 2024
9f2f6eb
PR feedback
andrewlock Feb 29, 2024
aac31c9
Add unit tests for the mapping between tracersettings and public API …
andrewlock Mar 1, 2024
d69e59b
PR Feedback - add helper class for serialization of integration settings
andrewlock Mar 1, 2024
41d7f6e
PR feedback - include initial value in OverrideValue<T> helper
andrewlock Mar 1, 2024
399dd55
PR feedback - too many braces
andrewlock Mar 1, 2024
21ac0f7
Fix bug introduced
andrewlock Mar 1, 2024
6a89e3c
Use defaults for null test suite
andrewlock Mar 1, 2024
850bf8f
Fix merge conflict
andrewlock Mar 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 0 additions & 160 deletions tracer/src/Datadog.Trace.Manual/Ci/BenchmarkDiscreteStats.cs

This file was deleted.

62 changes: 0 additions & 62 deletions tracer/src/Datadog.Trace.Manual/Ci/BenchmarkHostInfo.cs

This file was deleted.

37 changes: 0 additions & 37 deletions tracer/src/Datadog.Trace.Manual/Ci/BenchmarkJobInfo.cs

This file was deleted.

21 changes: 0 additions & 21 deletions tracer/src/Datadog.Trace.Manual/Ci/ITest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,6 @@ public interface ITest
/// <param name="traits">Traits dictionary</param>
void SetTraits(Dictionary<string, List<string>> traits);

/// <summary>
/// Set Test parameters
/// </summary>
/// <param name="parameters">TestParameters instance</param>
void SetParameters(TestParameters parameters);

/// <summary>
/// Set benchmark metadata
/// </summary>
/// <param name="hostInfo">Host info</param>
/// <param name="jobInfo">Job info</param>
void SetBenchmarkMetadata(BenchmarkHostInfo hostInfo, BenchmarkJobInfo jobInfo);

/// <summary>
/// Add benchmark data
/// </summary>
/// <param name="measureType">Measure type</param>
/// <param name="info">Measure info</param>
/// <param name="statistics">Statistics values</param>
void AddBenchmarkData(BenchmarkMeasureType measureType, string info, BenchmarkDiscreteStats statistics);

/// <summary>
/// Close test
/// </summary>
Expand Down
26 changes: 10 additions & 16 deletions tracer/src/Datadog.Trace.Manual/Ci/Stubs/NullTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@

namespace Datadog.Trace.Ci.Stubs;

internal class NullTest(ITestSuite testSuite, string name, DateTimeOffset? startDate) : ITest
internal class NullTest : ITest
{
public string? Name { get; } = name;
public static readonly NullTest Instance = new();

public DateTimeOffset StartTime { get; } = startDate ?? DateTimeOffset.UtcNow;
private NullTest()
{
}

public string? Name => "Undefined";

public DateTimeOffset StartTime => default;

public ITestSuite Suite { get; } = testSuite;
public ITestSuite Suite => NullTestSuite.Instance;

public void SetTag(string key, string? value)
{
Expand All @@ -41,18 +47,6 @@ public void SetTraits(Dictionary<string, List<string>> traits)
{
}

public void SetParameters(TestParameters parameters)
{
}

public void SetBenchmarkMetadata(BenchmarkHostInfo hostInfo, BenchmarkJobInfo jobInfo)
{
}

public void AddBenchmarkData(BenchmarkMeasureType measureType, string info, BenchmarkDiscreteStats statistics)
{
}

public void Close(TestStatus status)
{
}
Expand Down
20 changes: 12 additions & 8 deletions tracer/src/Datadog.Trace.Manual/Ci/Stubs/NullTestModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@

namespace Datadog.Trace.Ci.Stubs;

internal class NullTestModule(string name, string? framework, DateTimeOffset? startDate) : ITestModule
internal class NullTestModule : ITestModule
{
public string Name { get; } = name;
public static readonly NullTestModule Instance = new();

public DateTimeOffset StartTime { get; } = startDate ?? DateTimeOffset.UtcNow;
private NullTestModule()
{
}

public string Name => "Undefined";

public DateTimeOffset StartTime => default;

public string? Framework { get; } = framework;
public string? Framework => null;

public void SetTag(string key, string? value)
{
Expand Down Expand Up @@ -41,9 +47,7 @@ public void Close(TimeSpan? duration)

public Task CloseAsync(TimeSpan? duration) => Task.CompletedTask;

public ITestSuite GetOrCreateSuite(string name)
=> new NullTestSuite(this, name, null);
public ITestSuite GetOrCreateSuite(string name) => NullTestSuite.Instance;

public ITestSuite GetOrCreateSuite(string name, DateTimeOffset? startDate)
=> new NullTestSuite(this, name, startDate);
public ITestSuite GetOrCreateSuite(string name, DateTimeOffset? startDate) => NullTestSuite.Instance;
}
Loading
Loading