From 2bc131f1a8a5c82969813ce0dc57dbfb0aae779b Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 1 Feb 2024 14:42:33 +0100 Subject: [PATCH] move ProcessInformation to API and implement a ToString() --- src/Elastic.Apm/{Model => Api}/ProcessInformation.cs | 8 +++++++- test/Elastic.Apm.Tests.MockApmServer/MetadataDto.cs | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) rename src/Elastic.Apm/{Model => Api}/ProcessInformation.cs (71%) diff --git a/src/Elastic.Apm/Model/ProcessInformation.cs b/src/Elastic.Apm/Api/ProcessInformation.cs similarity index 71% rename from src/Elastic.Apm/Model/ProcessInformation.cs rename to src/Elastic.Apm/Api/ProcessInformation.cs index d1f916e94..0b1666193 100644 --- a/src/Elastic.Apm/Model/ProcessInformation.cs +++ b/src/Elastic.Apm/Api/ProcessInformation.cs @@ -4,8 +4,9 @@ // See the LICENSE file in the project root for more information using System.Diagnostics; +using Elastic.Apm.Helpers; -namespace Elastic.Apm.Model; +namespace Elastic.Apm.Api; internal class ProcessInformation { @@ -19,4 +20,9 @@ public static ProcessInformation Create() return new ProcessInformation { Pid = p.Id, Title = p.ProcessName }; } + public override string ToString() => new ToStringBuilder(nameof(Service)) + { + { nameof(Pid), Pid }, + { nameof(Title), Title } + }.ToString(); } diff --git a/test/Elastic.Apm.Tests.MockApmServer/MetadataDto.cs b/test/Elastic.Apm.Tests.MockApmServer/MetadataDto.cs index 490ba8c1b..93b992bb3 100644 --- a/test/Elastic.Apm.Tests.MockApmServer/MetadataDto.cs +++ b/test/Elastic.Apm.Tests.MockApmServer/MetadataDto.cs @@ -27,6 +27,7 @@ public override string ToString() => new ToStringBuilder(nameof(MetadataDto)) { { nameof(Service), Service }, + { nameof(Process), Process }, { nameof(System), System }, { nameof(Labels), AbstractConfigurationReader.ToLogString(Labels) }, { nameof(Cloud), Cloud },