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

Fix #205 Use both DataMember and JsonPropertyName attributes on ECS types #208

Merged
merged 4 commits into from
Sep 1, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using System.Text.Json.Serialization;
using BenchmarkDotNet.Mathematics;
using Perfolizer.Mathematics.Common;

Expand All @@ -20,22 +21,22 @@ public BenchmarkConfidence(ConfidenceInterval interval)
StandardError = interval.StandardError;
}

[DataMember(Name = "level")]
[JsonPropertyName("level"), DataMember(Name = "level")]
public ConfidenceLevel Level { get; set; }

[DataMember(Name = "lower")]
[JsonPropertyName("lower"), DataMember(Name = "lower")]
public double Lower { get; set; }

[DataMember(Name = "margin")]
[JsonPropertyName("margin"), DataMember(Name = "margin")]
public double Margin { get; set; }

[DataMember(Name = "mean")]
[JsonPropertyName("mean"), DataMember(Name = "mean")]
public double Mean { get; set; }

[DataMember(Name = "n")]
[JsonPropertyName("n"), DataMember(Name = "n")]
public int N { get; set; }

[DataMember(Name = "standard_error")]
[JsonPropertyName("standard_error"), DataMember(Name = "standard_error")]
public double StandardError { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
{
Expand All @@ -12,7 +13,7 @@ namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
/// </summary>
public class BenchmarkDocument : EcsDocument
{
[DataMember(Name = "benchmark")]
[JsonPropertyName("benchmark"), DataMember(Name = "benchmark")]
public BenchmarkData Benchmark { get; set; }

protected override bool TryRead(string propertyName, out Type type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@

using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
{
public class BenchmarkEvent : Event
{
[DataMember(Name = "description")]
[JsonPropertyName("description"), DataMember(Name = "description")]
public string Description { get; set; }

[DataMember(Name = "parameters")]
[JsonPropertyName("parameters"), DataMember(Name = "parameters")]
public string Parameters { get; set; }

[DataMember(Name = "method")]
[JsonPropertyName("method"), DataMember(Name = "method")]
public string Method { get; set; }

[DataMember(Name = "measurement_stages")]
[JsonPropertyName("measurement_stages"), DataMember(Name = "measurement_stages")]
public IEnumerable<BenchmarkMeasurementStage> MeasurementStages { get; set; }

[DataMember(Name = "repetitions")]
[JsonPropertyName("repetitions"), DataMember(Name = "repetitions")]
public BenchmarkSimplifiedWorkloadCounts Repetitions { get; set; }

[DataMember(Name = "job_config")]
[JsonPropertyName("job_config"), DataMember(Name = "job_config")]
public BenchmarkJobConfig JobConfig { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
{
public class BenchmarkGcInfo
{
[DataMember(Name = "force")]
[JsonPropertyName("force"), DataMember(Name = "force")]
public bool Force { get; set; }

[DataMember(Name = "server")]
[JsonPropertyName("server"), DataMember(Name = "server")]
public bool Server { get; set; }

[DataMember(Name = "concurrent")]
[JsonPropertyName("concurrent"), DataMember(Name = "concurrent")]
public bool Concurrent { get; set; }

[DataMember(Name = "retain_vm")]
[JsonPropertyName("retain_vm"), DataMember(Name = "retain_vm")]
public bool RetainVm { get; set; }

[DataMember(Name = "cpu_groups")]
[JsonPropertyName("cpu_groups"), DataMember(Name = "cpu_groups")]
public bool CpuGroups { get; set; }

[DataMember(Name = "heap_count")]
[JsonPropertyName("heap_count"), DataMember(Name = "heap_count")]
public int HeapCount { get; set; }

[DataMember(Name = "no_affinitize")]
[JsonPropertyName("no_affinitize"), DataMember(Name = "no_affinitize")]
public bool NoAffinitize { get; set; }

[DataMember(Name = "heap_affinitize")]
[JsonPropertyName("heap_affinitize"), DataMember(Name = "heap_affinitize")]
public int HeapAffinitizeMask { get; set; }

[DataMember(Name = "allow_very_large_objects")]
[JsonPropertyName("allow_very_large_objects"), DataMember(Name = "allow_very_large_objects")]
public bool AllowVeryLargeObjects { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using System.Text.Json.Serialization;
using BenchmarkDotNet.Engines;
using BenchmarkDotNet.Running;

Expand All @@ -19,19 +20,19 @@ public BenchmarkGcStats(GcStats statistics, BenchmarkCase benchmarkCase)
BytesAllocatedPerOperation = statistics.GetBytesAllocatedPerOperation(benchmarkCase);
}

[DataMember(Name = "bytes_allocated_per_operation")]
[JsonPropertyName("bytes_allocated_per_operation"), DataMember(Name = "bytes_allocated_per_operation")]
public long BytesAllocatedPerOperation { get; set; }

[DataMember(Name = "total_operations")]
[JsonPropertyName("total_operations"), DataMember(Name = "total_operations")]
public long TotalOperations { get; set; }

[DataMember(Name = "gen2_collections")]
[JsonPropertyName("gen2_collections"), DataMember(Name = "gen2_collections")]
public int Gen2Collections { get; set; }

[DataMember(Name = "gen1_collections")]
[JsonPropertyName("gen1_collections"), DataMember(Name = "gen1_collections")]
public int Gen1Collections { get; set; }

[DataMember(Name = "gen0_collections")]
[JsonPropertyName("gen0_collections"), DataMember(Name = "gen0_collections")]
public int Gen0Collections { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
{
public class BenchmarkGit
{
[DataMember(Name = "branch")]
[JsonPropertyName("branch"), DataMember(Name = "branch")]
public string BranchName { get; set; }

[DataMember(Name = "sha")]
[JsonPropertyName("sha"), DataMember(Name = "sha")]
public string Sha { get; set; }

[DataMember(Name = "commit_message")]
[JsonPropertyName("commit_message"), DataMember(Name = "commit_message")]
public string CommitMessage { get; set; }

[DataMember(Name = "repository")]
[JsonPropertyName("repository"), DataMember(Name = "repository")]
public string Repository { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
{
public class BenchmarkHost : Host
{
[DataMember(Name = "processor_name")]
[JsonPropertyName("processor_name"), DataMember(Name = "processor_name")]
public string ProcessorName { get; set; }

[DataMember(Name = "physical_processor_count")]
[JsonPropertyName("physical_processor_count"), DataMember(Name = "physical_processor_count")]
public int? PhysicalProcessorCount { get; set; }

[DataMember(Name = "physical_core_count")]
[JsonPropertyName("physical_core_count"), DataMember(Name = "physical_core_count")]
public int? PhysicalCoreCount { get; set; }

[DataMember(Name = "logical_core_count")]
[JsonPropertyName("logical_core_count"), DataMember(Name = "logical_core_count")]
public int? LogicalCoreCount { get; set; }

[DataMember(Name = "has_attached_debugger")]
[JsonPropertyName("has_attached_debugger"), DataMember(Name = "has_attached_debugger")]
public bool HasAttachedDebugger { get; set; }

[DataMember(Name = "hardware_timer_kind")]
[JsonPropertyName("hardware_timer_kind"), DataMember(Name = "hardware_timer_kind")]
public string HardwareTimerKind { get; set; }

[DataMember(Name = "chronometer_frequency_hertz")]
[JsonPropertyName("chronometer_frequency_hertz"), DataMember(Name = "chronometer_frequency_hertz")]
public double ChronometerFrequencyHertz { get; set; }

[DataMember(Name = "vm_hypervisor")]
[JsonPropertyName("vm_hypervisor"), DataMember(Name = "vm_hypervisor")]
public string VirtualMachineHypervisor { get; set; }

[DataMember(Name = "in_docker")]
[JsonPropertyName("in_docker"), DataMember(Name = "in_docker")]
public bool InDocker { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
{
public class BenchmarkJobConfig
{
[DataMember(Name = "platform")]
[JsonPropertyName("platform"), DataMember(Name = "platform")]
public string Platform { get; set; }

[DataMember(Name = "runtime")]
[JsonPropertyName("runtime"), DataMember(Name = "runtime")]
public string RunTime { get; set; }

[DataMember(Name = "jit")]
[JsonPropertyName("jit"), DataMember(Name = "jit")]
public string Jit { get; set; }

[DataMember(Name = "gc")]
[JsonPropertyName("gc"), DataMember(Name = "gc")]
public BenchmarkGcInfo Gc { get; set; }

[DataMember(Name = "id")]
[JsonPropertyName("id"), DataMember(Name = "id")]
public string Id { get; set; }

[DataMember(Name = "launch")]
[JsonPropertyName("launch"), DataMember(Name = "launch")]
public BenchmarkLaunchInformation Launch { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,34 @@
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
{
public class BenchmarkLanguage
{
[DataMember(Name = "version")]
[JsonPropertyName("version"), DataMember(Name = "version")]
public string Version { get; set; }

[DataMember(Name = "dotnet_sdk_version")]
[JsonPropertyName("dotnet_sdk_version"), DataMember(Name = "dotnet_sdk_version")]
public string DotNetSdkVersion { get; set; }

[DataMember(Name = "has_ryu_jit")]
[JsonPropertyName("has_ryu_jit"), DataMember(Name = "has_ryu_jit")]
public bool HasRyuJit { get; set; }

[DataMember(Name = "jit_modules")]
[JsonPropertyName("jit_modules"), DataMember(Name = "jit_modules")]
public string JitModules { get; set; }

[DataMember(Name = "build_configuration")]
[JsonPropertyName("build_configuration"), DataMember(Name = "build_configuration")]
public string BuildConfiguration { get; set; }

[DataMember(Name = "benchmarkdotnet_version")]
[JsonPropertyName("benchmarkdotnet_version"), DataMember(Name = "benchmarkdotnet_version")]
public string BenchmarkDotNetVersion { get; set; }

[DataMember(Name = "benchmarkdotnet_caption")]
[JsonPropertyName("benchmarkdotnet_caption"), DataMember(Name = "benchmarkdotnet_caption")]
public string BenchmarkDotNetCaption { get; set; }

[DataMember(Name = "jit_info")]
[JsonPropertyName("jit_info"), DataMember(Name = "jit_info")]
public string JitInfo { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,43 @@
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
{
public class BenchmarkLaunchInformation
{
[DataMember(Name = "run_strategy")]
[JsonPropertyName("run_strategy"), DataMember(Name = "run_strategy")]
public string RunStrategy { get; set; }

[DataMember(Name = "launch_count")]
[JsonPropertyName("launch_count"), DataMember(Name = "launch_count")]
public int LaunchCount { get; set; }

[DataMember(Name = "warm_count")]
[JsonPropertyName("warm_count"), DataMember(Name = "warm_count")]
public int WarmCount { get; set; }

[DataMember(Name = "unroll_factor")]
[JsonPropertyName("unroll_factor"), DataMember(Name = "unroll_factor")]
public int UnrollFactor { get; set; }

[DataMember(Name = "iteration_count")]
[JsonPropertyName("iteration_count"), DataMember(Name = "iteration_count")]
public int IterationCount { get; set; }

[DataMember(Name = "invocation_count")]
[JsonPropertyName("invocation_count"), DataMember(Name = "invocation_count")]
public int InvocationCount { get; set; }

[DataMember(Name = "max_iteration_count")]
[JsonPropertyName("max_iteration_count"), DataMember(Name = "max_iteration_count")]
public int MaxIterationCount { get; set; }

[DataMember(Name = "min_iteration_count")]
[JsonPropertyName("min_iteration_count"), DataMember(Name = "min_iteration_count")]
public int MinIterationCount { get; set; }

[DataMember(Name = "max_warmup_iteration_count")]
[JsonPropertyName("max_warmup_iteration_count"), DataMember(Name = "max_warmup_iteration_count")]
public int MaxWarmupIterationCount { get; set; }

[DataMember(Name = "min_warmup_iteration_count")]
[JsonPropertyName("min_warmup_iteration_count"), DataMember(Name = "min_warmup_iteration_count")]
public int MinWarmupIterationCount { get; set; }

[DataMember(Name = "iteration_time_in_ms")]
[JsonPropertyName("iteration_time_in_ms"), DataMember(Name = "iteration_time_in_ms")]
public double IterationTimeInMilliseconds { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Elastic.CommonSchema.BenchmarkDotNetExporter.Domain
{
public class BenchmarkMeasurementStage
{
[DataMember(Name = "iteration_mode")]
[JsonPropertyName("iteration_mode"), DataMember(Name = "iteration_mode")]
public string IterationMode { get; set; }

[DataMember(Name = "iteration_stage")]
[JsonPropertyName("iteration_stage"), DataMember(Name = "iteration_stage")]
public string IterationStage { get; set; }

[DataMember(Name = "operations")]
[JsonPropertyName("operations"), DataMember(Name = "operations")]
public long Operations { get; set; }
}
}
Loading