add aspire for otel
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Ardalis.GuardClauses;
|
||||
using System.Diagnostics;
|
||||
using Ardalis.GuardClauses;
|
||||
using Microsoft.VisualStudio.SolutionPersistence.Model;
|
||||
using Microsoft.VisualStudio.SolutionPersistence.Serializer;
|
||||
|
||||
@@ -9,6 +10,7 @@ public static class IntermediateMapper
|
||||
internal static async Task<IntermediateSolutionModel> GetIntermediateModel(string solutionFilePath,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
using var _ = SharpIdeOtel.Source.StartActivity();
|
||||
var serializer = SolutionSerializers.GetSerializerByMoniker(solutionFilePath);
|
||||
Guard.Against.Null(serializer, nameof(serializer));
|
||||
var vsSolution = await serializer.OpenAsync(solutionFilePath, cancellationToken);
|
||||
|
||||
@@ -6,6 +6,7 @@ public static class VsPersistenceMapper
|
||||
{
|
||||
public static async Task<SharpIdeSolutionModel> GetSolutionModel(string solutionFilePath, CancellationToken cancellationToken = default)
|
||||
{
|
||||
using var _ = SharpIdeOtel.Source.StartActivity();
|
||||
var timer = Stopwatch.StartNew();
|
||||
// This intermediate model is pretty much useless, but I have left it around as we grab the project nodes with it, which we might use later.
|
||||
var intermediateModel = await IntermediateMapper.GetIntermediateModel(solutionFilePath, cancellationToken);
|
||||
|
||||
10
src/SharpIDE.Application/SharpIdeOtel.cs
Normal file
10
src/SharpIDE.Application/SharpIdeOtel.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.Metrics;
|
||||
|
||||
namespace SharpIDE.Application;
|
||||
|
||||
public static class SharpIdeOtel
|
||||
{
|
||||
public static readonly ActivitySource Source = new("SharpIde");
|
||||
public static readonly Meter Meter = new("SharpIde");
|
||||
}
|
||||
@@ -9,6 +9,8 @@ public partial class IdeDiagnosticsPanel : Control
|
||||
{
|
||||
_graphEdit = GetNode<GraphEdit>("%GraphEdit");
|
||||
//_graphEdit.ConnectionRequest += GraphEditOnConnectionRequest;
|
||||
//var graphNode = GetNode<Node>("%GraphNode");
|
||||
|
||||
}
|
||||
|
||||
// private void GraphEditOnConnectionRequest(StringName fromNode, long fromPort, StringName toNode, long toPort)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Godot;
|
||||
using Microsoft.Build.Locator;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SharpIDE.Application.Features.Analysis;
|
||||
using SharpIDE.Application.Features.SolutionDiscovery;
|
||||
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
|
||||
@@ -30,6 +31,7 @@ public partial class IdeRoot : Control
|
||||
public override void _Ready()
|
||||
{
|
||||
MSBuildLocator.RegisterDefaults();
|
||||
GodotServiceDefaults.AddServiceDefaults();
|
||||
|
||||
_openSlnButton = GetNode<Button>("%OpenSlnButton");
|
||||
_buildSlnButton = GetNode<Button>("%BuildSlnButton");
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<ImplicitUsings>true</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\tools\AspNetCoreServiceDefaults\AspNetCoreServiceDefaults.csproj" PrivateAssets="all" />
|
||||
<ProjectReference Include="..\SharpIDE.Application\SharpIDE.Application.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user