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

DroppedSpanStats: do not flatten duration #2178

Merged
merged 6 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 21 additions & 13 deletions src/Elastic.Apm/Model/DroppedSpanStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ public DroppedSpanStats(string serviceTargetType, string serviceTargetName, stri
double durationSumUs
)
{
DurationCount = 1;
Duration = new DroppedSpanDuration { Count = 1, Sum = new DroppedSpanDuration.DroppedSpanDurationSum { Us = durationSumUs } };
ServiceTargetType = serviceTargetType;
ServiceTargetName = serviceTargetName;
DestinationServiceResource = destinationServiceResource;
Outcome = outcome;
DurationSumUs = durationSumUs;
}

/// <summary>
Expand All @@ -46,23 +45,32 @@ double durationSumUs
public string ServiceTargetName { get; }

/// <summary>
/// Duration holds duration aggregations about the dropped span.
/// Count holds the number of times the dropped span happened.
/// Outcome of the aggregated spans.
/// </summary>
[JsonProperty("duration.count")]
public int DurationCount { get; set; }
public Outcome Outcome { get; }


/// <summary>
/// Duration holds duration aggregations about the dropped span.
/// Sum holds dimensions about the dropped span's duration.
/// </summary>
[JsonProperty("duration.sum.us")]
public double DurationSumUs { get; set; }
public DroppedSpanDuration Duration { get; set; }

/// <summary>
/// Outcome of the aggregated spans.
/// </summary>
public Outcome Outcome { get; }
internal class DroppedSpanDuration
{
/// <summary>
/// Count holds the number of times the dropped span happened.
/// </summary>
public int Count { get; set; }

/// <summary>
/// Sum holds dimensions about the dropped span's duration.
/// </summary>
public DroppedSpanDurationSum Sum { get; set; }

internal class DroppedSpanDurationSum
{
public double Us { get; set; }
}
}
}
}
Loading
Loading