Skip to content

Commit

Permalink
Move IMeterFactory to System.Diagnostics.DiagnosticSource (#88302)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekgh authored Jul 5, 2023
1 parent f22ad38 commit 51d3517
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 172 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33801.468
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{B6663ACE-6FE4-4BB4-8B35-AB98EF62EAAE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bcl.AsyncInterfaces", "..\Microsoft.Bcl.AsyncInterfaces\ref\Microsoft.Bcl.AsyncInterfaces.csproj", "{E7A3B914-598D-4ABC-B973-6CC444DAFE52}"
Expand All @@ -13,10 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Depend
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.DependencyInjection", "..\Microsoft.Extensions.DependencyInjection\src\Microsoft.Extensions.DependencyInjection.csproj", "{1D851FA7-2F3C-4E3C-8F22-AF5E13D9BEE6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Diagnostics.Abstractions", "..\Microsoft.Extensions.Diagnostics.Abstractions\ref\Microsoft.Extensions.Diagnostics.Abstractions.csproj", "{8FFCB2D9-807B-431B-ABDF-02DCA01FBC97}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Diagnostics.Abstractions", "..\Microsoft.Extensions.Diagnostics.Abstractions\src\Microsoft.Extensions.Diagnostics.Abstractions.csproj", "{B90251F2-D40B-4753-AE69-05EF0F8E0CE1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Diagnostics", "ref\Microsoft.Extensions.Diagnostics.csproj", "{EF75497C-6CB7-4471-980A-619EA1AB8CF6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Diagnostics", "src\Microsoft.Extensions.Diagnostics.csproj", "{09E28D94-B771-48EB-800C-5A80C2C0055C}"
Expand Down Expand Up @@ -77,14 +77,6 @@ Global
{1D851FA7-2F3C-4E3C-8F22-AF5E13D9BEE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D851FA7-2F3C-4E3C-8F22-AF5E13D9BEE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D851FA7-2F3C-4E3C-8F22-AF5E13D9BEE6}.Release|Any CPU.Build.0 = Release|Any CPU
{8FFCB2D9-807B-431B-ABDF-02DCA01FBC97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8FFCB2D9-807B-431B-ABDF-02DCA01FBC97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FFCB2D9-807B-431B-ABDF-02DCA01FBC97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FFCB2D9-807B-431B-ABDF-02DCA01FBC97}.Release|Any CPU.Build.0 = Release|Any CPU
{B90251F2-D40B-4753-AE69-05EF0F8E0CE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B90251F2-D40B-4753-AE69-05EF0F8E0CE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B90251F2-D40B-4753-AE69-05EF0F8E0CE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B90251F2-D40B-4753-AE69-05EF0F8E0CE1}.Release|Any CPU.Build.0 = Release|Any CPU
{EF75497C-6CB7-4471-980A-619EA1AB8CF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF75497C-6CB7-4471-980A-619EA1AB8CF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF75497C-6CB7-4471-980A-619EA1AB8CF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -127,23 +119,21 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{B6663ACE-6FE4-4BB4-8B35-AB98EF62EAAE} = {76DC9C4C-EE53-47E6-B6BF-7B135EA8CAF3}
{43DBAD84-A865-4F5F-AB76-7F3EB6784E99} = {76DC9C4C-EE53-47E6-B6BF-7B135EA8CAF3}
{E7A3B914-598D-4ABC-B973-6CC444DAFE52} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{CE53C256-EE31-4E4A-8A05-70350840448F} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{C175A982-E0E0-4E22-8A3B-0A9C00EE7730} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{8FFCB2D9-807B-431B-ABDF-02DCA01FBC97} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{EF75497C-6CB7-4471-980A-619EA1AB8CF6} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{F452AA57-7BEC-4E64-BAB5-166078865EC4} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{3D040E9F-C39B-49C6-8C87-68D427AECA8F} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{280FDDEA-50B1-4BD3-83B1-475B15829538} = {A447D0CB-601B-479E-A2B2-76E48F5D4D61}
{CE53C256-EE31-4E4A-8A05-70350840448F} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{3B8833A4-2E9E-47BD-93DE-65934DCEB9A6} = {A447D0CB-601B-479E-A2B2-76E48F5D4D61}
{C175A982-E0E0-4E22-8A3B-0A9C00EE7730} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{1D851FA7-2F3C-4E3C-8F22-AF5E13D9BEE6} = {A447D0CB-601B-479E-A2B2-76E48F5D4D61}
{B90251F2-D40B-4753-AE69-05EF0F8E0CE1} = {A447D0CB-601B-479E-A2B2-76E48F5D4D61}
{EF75497C-6CB7-4471-980A-619EA1AB8CF6} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{09E28D94-B771-48EB-800C-5A80C2C0055C} = {A447D0CB-601B-479E-A2B2-76E48F5D4D61}
{43DBAD84-A865-4F5F-AB76-7F3EB6784E99} = {76DC9C4C-EE53-47E6-B6BF-7B135EA8CAF3}
{F452AA57-7BEC-4E64-BAB5-166078865EC4} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
{AE5566CE-EC5E-47B0-B5A3-89E90B3893F0} = {A447D0CB-601B-479E-A2B2-76E48F5D4D61}
{ED105ED3-0060-4035-AD5E-1F857F94C2DF} = {66953A8A-9E31-486F-AF8E-7310F6707E4F}
{0A0D7CB1-3864-478F-98FC-5AA53C6A72C2} = {66953A8A-9E31-486F-AF8E-7310F6707E4F}
{3FEA305D-0B5F-46A6-8E18-587387FCBFBF} = {66953A8A-9E31-486F-AF8E-7310F6707E4F}
{3D040E9F-C39B-49C6-8C87-68D427AECA8F} = {9BF048D0-411D-4C2A-8C32-3A3255501D27}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7D279EE5-E38F-4125-AE82-6ADE52D72F26}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\ref\System.Diagnostics.DiagnosticSource.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Diagnostics.Abstractions\ref\Microsoft.Extensions.Diagnostics.Abstractions.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Abstractions\ref\Microsoft.Extensions.DependencyInjection.Abstractions.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Diagnostics.Metrics;
using System;
using System.Diagnostics.Metrics;

namespace Microsoft.Extensions.DependencyInjection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\src\System.Diagnostics.DiagnosticSource.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Diagnostics.Abstractions\src\Microsoft.Extensions.Diagnostics.Abstractions.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Abstractions\src\Microsoft.Extensions.DependencyInjection.Abstractions.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<ItemGroup>
<ProjectReference Include="..\src\Microsoft.Extensions.Diagnostics.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\src\System.Diagnostics.DiagnosticSource.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Diagnostics.Abstractions\src\Microsoft.Extensions.Diagnostics.Abstractions.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection\src\Microsoft.Extensions.DependencyInjection.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Abstractions\src\Microsoft.Extensions.DependencyInjection.Abstractions.csproj" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/libraries/NetCoreAppLibrary.props
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@
Microsoft.Extensions.DependencyInjection;
Microsoft.Extensions.DependencyInjection.Abstractions;
Microsoft.Extensions.Diagnostics;
Microsoft.Extensions.Diagnostics.Abstractions;
Microsoft.Extensions.FileProviders.Abstractions;
Microsoft.Extensions.FileProviders.Composite;
Microsoft.Extensions.FileProviders.Physical;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ public sealed class Histogram<T> : Instrument<T> where T : struct
public void Record(T value, ReadOnlySpan<System.Collections.Generic.KeyValuePair<string, object?>> tags) { throw null; }
public void Record(T value, params System.Collections.Generic.KeyValuePair<string, object?>[] tags) { throw null; }
}
public interface IMeterFactory : System.IDisposable
{
System.Diagnostics.Metrics.Meter Create(System.Diagnostics.Metrics.MeterOptions options);
}
public abstract class Instrument
{
public string? Description { get {throw null;} }
Expand Down Expand Up @@ -517,6 +521,10 @@ public ObservableGauge<T> CreateObservableGauge<T>(
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object?>>? Tags { get { throw null; } }
public object? Scope { get { throw null; } }
}
public static class MeterFactoryExtensions
{
public static System.Diagnostics.Metrics.Meter Create(this System.Diagnostics.Metrics.IMeterFactory meterFactory, string name, string? version = null, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object?>>? tags = null) { return null!; }
}
public sealed class MeterListener : IDisposable
{
public object? DisableMeasurementEvents(Instrument instrument) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ System.Diagnostics.DiagnosticSource</PackageDescription>
<Compile Include="System\Diagnostics\Metrics\Counter.cs" />
<Compile Include="System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs" />
<Compile Include="System\Diagnostics\Metrics\Histogram.cs" />
<Compile Include="System\Diagnostics\Metrics\IMeterFactory.cs" />
<Compile Include="System\Diagnostics\Metrics\Instrument.cs" />
<Compile Include="System\Diagnostics\Metrics\Instrument.common.cs" />
<Compile Include="System\Diagnostics\Metrics\InstrumentState.cs" />
<Compile Include="System\Diagnostics\Metrics\LastValueAggregator.cs" />
<Compile Include="System\Diagnostics\Metrics\Measurement.cs" />
<Compile Include="System\Diagnostics\Metrics\Meter.cs" />
<Compile Include="System\Diagnostics\Metrics\MeterFactoryExtensions.cs" />
<Compile Include="System\Diagnostics\Metrics\MeterListener.cs" />
<Compile Include="System\Diagnostics\Metrics\MetricsEventSource.cs" />
<Compile Include="System\Diagnostics\Metrics\MeterOptions.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Diagnostics.Metrics;

namespace Microsoft.Extensions.Diagnostics.Metrics
namespace System.Diagnostics.Metrics
{
/// <summary>
/// A factory for creating <see cref="Meter"/> instances.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;

namespace Microsoft.Extensions.Diagnostics.Metrics
namespace System.Diagnostics.Metrics
{
/// <summary>
/// Extension methods for <see cref="Meter" /> and <see cref="IMeterFactory" />.
Expand Down

0 comments on commit 51d3517

Please sign in to comment.