From 5d9b906cd5e362bcd76eb54b6b59dd15230f5cb7 Mon Sep 17 00:00:00 2001 From: routersys Date: Sun, 6 Sep 2026 11:19:00 +0900 Subject: [PATCH] =?UTF-8?q?=E6=A4=9C=E8=A8=BC=E5=8F=B0=E7=94=A8=E3=81=AB?= =?UTF-8?q?=E5=90=8C=E3=81=98=E3=82=BD=E3=83=BC=E3=82=B9=E3=82=92=E5=8F=96?= =?UTF-8?q?=E3=82=8A=E8=BE=BC=E3=82=80=E4=BA=8C=E3=81=A4=E3=81=AE=E3=83=97?= =?UTF-8?q?=E3=83=A9=E3=82=B0=E3=82=A4=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Telemetry.Harness.Plugin/Probe.cs | 51 +++++++++++++++++++ .../Telemetry.Harness.PluginA.csproj | 24 +++++++++ .../Telemetry.Harness.PluginB.csproj | 24 +++++++++ 3 files changed, 99 insertions(+) create mode 100644 Telemetry.Harness.Plugin/Probe.cs create mode 100644 Telemetry.Harness.PluginA/Telemetry.Harness.PluginA.csproj create mode 100644 Telemetry.Harness.PluginB/Telemetry.Harness.PluginB.csproj diff --git a/Telemetry.Harness.Plugin/Probe.cs b/Telemetry.Harness.Plugin/Probe.cs new file mode 100644 index 0000000..47d780b --- /dev/null +++ b/Telemetry.Harness.Plugin/Probe.cs @@ -0,0 +1,51 @@ +using System.Globalization; +using Telemetry; + +namespace Telemetry.Harness.Plugin; + +public static class Probe +{ + public static string AssemblyName => typeof(Probe).Assembly.GetName().Name ?? "unknown"; + + public static string PluginName => PluginIdentity.Name; + + public static string SessionId => TelemetrySession.Id; + + public static string ReserveBudget(string fingerprint) => + TelemetryBudget.TryReserve(fingerprint).ToString(); + + public static string PrepareReport() + { + try + { + throw new InvalidOperationException("検証台からの報告です。"); + } + catch (Exception exception) + { + return TelemetryReporter.Prepare(exception, TelemetrySpool.Default).Decision.ToString(); + } + } + + public static string BuildEnvelope() + { + try + { + throw new InvalidOperationException("検証台からの報告です。"); + } + catch (Exception exception) + { + var captured = ExceptionCapture.Capture(exception, PluginIdentity.Assembly); + var envelope = SentryEnvelope.Build( + Guid.NewGuid().ToString("N"), + captured, + "error", + DateTimeOffset.UtcNow); + + return System.Text.Encoding.UTF8.GetString(envelope); + } + } + + public static string Describe() => string.Create( + CultureInfo.InvariantCulture, + $"{AssemblyName} plugin={PluginName} session={SessionId}"); +} diff --git a/Telemetry.Harness.PluginA/Telemetry.Harness.PluginA.csproj b/Telemetry.Harness.PluginA/Telemetry.Harness.PluginA.csproj new file mode 100644 index 0000000..bf4847c --- /dev/null +++ b/Telemetry.Harness.PluginA/Telemetry.Harness.PluginA.csproj @@ -0,0 +1,24 @@ + + + + + + net10.0-windows10.0.19041.0 + true + enable + enable + false + + + + + + + + + $(YMM4DirPath)YukkuriMovieMaker.Plugin.dll + false + + + + diff --git a/Telemetry.Harness.PluginB/Telemetry.Harness.PluginB.csproj b/Telemetry.Harness.PluginB/Telemetry.Harness.PluginB.csproj new file mode 100644 index 0000000..bf4847c --- /dev/null +++ b/Telemetry.Harness.PluginB/Telemetry.Harness.PluginB.csproj @@ -0,0 +1,24 @@ + + + + + + net10.0-windows10.0.19041.0 + true + enable + enable + false + + + + + + + + + $(YMM4DirPath)YukkuriMovieMaker.Plugin.dll + false + + + +