1 instantiation of Counter
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\Meter.cs (1)
149=> (Counter<T>)GetOrCreateInstrument<T>(typeof(Counter<T>), name, unit, description, tags, () => new Counter<T>(this, name, unit, description, tags));
245 references to Counter
Aspire.Confluent.Kafka (10)
ConfluentKafkaMetrics.cs (8)
13public Counter<long> Tx { get; } 14public Counter<long> TxBytes { get; } 15public Counter<long> TxMessages { get; } 16public Counter<long> TxMessageBytes { get; } 17public Counter<long> Rx { get; } 18public Counter<long> RxBytes { get; } 19public Counter<long> RxMessages { get; } 20public Counter<long> RxMessageBytes { get; }
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\ConfluentKafkaCommon.cs (2)
22internal static readonly Counter<long> ReceiveMessagesCounter = Meter.CreateCounter<long>(SemanticConventions.MetricMessagingReceiveMessages); 24internal static readonly Counter<long> PublishMessagesCounter = Meter.CreateCounter<long>(SemanticConventions.MetricMessagingPublishMessages);
Microsoft.AspNetCore.Authentication.Core (4)
AuthenticationMetrics.cs (4)
17private readonly Counter<long> _challengeCount; 18private readonly Counter<long> _forbidCount; 19private readonly Counter<long> _signInCount; 20private readonly Counter<long> _signOutCount;
Microsoft.AspNetCore.Authorization (1)
AuthorizationMetrics.cs (1)
21private readonly Counter<long> _authorizedCount;
Microsoft.AspNetCore.Components (1)
ComponentsMetrics.cs (1)
23private readonly Counter<long> _navigationCount;
Microsoft.AspNetCore.Diagnostics (1)
DiagnosticsMetrics.cs (1)
18private readonly Counter<long> _handlerExceptionCounter;
Microsoft.AspNetCore.HeaderParsing (6)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Factory.g.cs (2)
22var instrument = _meter.CreateCounter<long>(@"aspnetcore.header_parsing.parse_errors"); 32var instrument = _meter.CreateCounter<long>(@"aspnetcore.header_parsing.cache_accesses");
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Metrics.g.cs (4)
22private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 24public ParsingErrorCounter(global::System.Diagnostics.Metrics.Counter<long> counter) 44private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 46public CacheAccessCounter(global::System.Diagnostics.Metrics.Counter<long> counter)
Microsoft.AspNetCore.Identity (5)
SignInManagerMetrics.cs (5)
24private readonly Counter<long> _rememberTwoFactorClientCounter; 25private readonly Counter<long> _forgetTwoFactorCounter; 26private readonly Counter<long> _checkPasswordCounter; 27private readonly Counter<long> _signInsCounter; 28private readonly Counter<long> _signOutsCounter;
Microsoft.AspNetCore.RateLimiting (1)
RateLimitingMetrics.cs (1)
20private readonly Counter<long> _requestsCounter;
Microsoft.AspNetCore.Routing (1)
RoutingMetrics.cs (1)
18private readonly Counter<long> _matchAttemptsCounter;
Microsoft.AspNetCore.Server.HttpSys (3)
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolMetrics.cs (3)
22private readonly Counter<long> _allocatedMemoryCounter; 23private readonly Counter<long> _evictedMemoryCounter; 24private readonly Counter<long> _rentedMemoryCounter;
Microsoft.AspNetCore.Server.IIS (3)
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolMetrics.cs (3)
22private readonly Counter<long> _allocatedMemoryCounter; 23private readonly Counter<long> _evictedMemoryCounter; 24private readonly Counter<long> _rentedMemoryCounter;
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Internal\Infrastructure\KestrelMetrics.cs (2)
36private readonly Counter<long> _rejectedConnectionsCounter; 37private readonly Counter<long> _bareLineFeedRequestsCounter;
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolMetrics.cs (3)
22private readonly Counter<long> _allocatedMemoryCounter; 23private readonly Counter<long> _evictedMemoryCounter; 24private readonly Counter<long> _rentedMemoryCounter;
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (3)
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolMetrics.cs (3)
22private readonly Counter<long> _allocatedMemoryCounter; 23private readonly Counter<long> _evictedMemoryCounter; 24private readonly Counter<long> _rentedMemoryCounter;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolMetrics.cs (3)
22private readonly Counter<long> _allocatedMemoryCounter; 23private readonly Counter<long> _evictedMemoryCounter; 24private readonly Counter<long> _rentedMemoryCounter;
Microsoft.Extensions.Diagnostics.HealthChecks.Common (6)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Factory.g.cs (2)
22var instrument = _meter.CreateCounter<long>(@"dotnet.health_check.reports"); 32var instrument = _meter.CreateCounter<long>(@"dotnet.health_check.unhealthy_checks");
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Metrics.g.cs (4)
22private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 24public HealthCheckReportCounter(global::System.Diagnostics.Metrics.Counter<long> counter) 43private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 45public UnhealthyHealthCheckCounter(global::System.Diagnostics.Metrics.Counter<long> counter)
Microsoft.Extensions.Diagnostics.Testing (1)
..\..\..\..\src\Libraries\Microsoft.Extensions.Diagnostics.Testing\Metrics\MeasurementExtensions.cs (1)
60/// Process the series of measurements adding all values together to produce a final count, identical to what a <see cref="Counter{T}" /> instrument would produce.
Microsoft.Extensions.Diagnostics.Testing.Tests (21)
..\..\..\..\test\Libraries\Microsoft.Extensions.Diagnostics.Testing.Tests\Metrics\MeasurementExtensionsTests.cs (11)
18var counter = meter.CreateCounter<long>("MyCounter"); 43var counter = meter.CreateCounter<long>("MyCounter"); 68var counter = meter.CreateCounter<long>("MyCounter"); 96var counter = meter.CreateCounter<long>("MyCounter"); 127var counter = meter.CreateCounter<byte>("MyCounter"); 144var counter = meter.CreateCounter<short>("MyCounter"); 161var counter = meter.CreateCounter<int>("MyCounter"); 178var counter = meter.CreateCounter<long>("MyCounter"); 195var counter = meter.CreateCounter<float>("MyCounter"); 212var counter = meter.CreateCounter<double>("MyCounter"); 229var counter = meter.CreateCounter<decimal>("MyCounter");
..\..\..\..\test\Libraries\Microsoft.Extensions.Diagnostics.Testing.Tests\Metrics\MetricCollectorTests.cs (10)
34var counter = meter.CreateCounter<long>("Counter"); 55var counter = meter.CreateCounter<long>(CounterName); 95var counter = meter.CreateCounter<long>(CounterName); 141var counter = meter.CreateCounter<long>(CounterName); 243var counter = meter.CreateCounter<long>(CounterName); 281var counter = meter.CreateCounter<long>(CounterName); 307var counter = meter.CreateCounter<long>(CounterName); 339var counter = meter.CreateCounter<long>(CounterName); 354var counter = meter.CreateCounter<long>(CounterName); 392var counter = meter.CreateCounter<long>(CounterName);
Microsoft.Extensions.Identity.Core (3)
UserManagerMetrics.cs (3)
30private readonly Counter<long> _checkPasswordAttemptsCounter; 31private readonly Counter<long> _verifyTokenAttemptsCounter; 32private readonly Counter<long> _generateTokensCounter;
Microsoft.Gen.Metrics.Generated.Tests (159)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Factory.g.cs (53)
20var instrument = _meter.CreateCounter<long>(@"NoNamespaceCounterInstrument"); 54var instrument = _meter.CreateCounter<int>(@"NestedClassCounter"); 82var instrument = _meter.CreateCounter<int>(@"MultiLevelNestedClassCounter"); 117var instrument = _meter.CreateCounter<int>(@"NestedRecordClassCounter"); 152var instrument = _meter.CreateCounter<int>(@"NestedRecordStructCounter"); 187var instrument = _meter.CreateCounter<int>(@"NestedStructCounter"); 222var instrument = _meter.CreateCounter<long>(@"PublicCounter"); 393var instrument = _meter.CreateCounter<int>(@"GenericIntCounter0D"); 403var instrument = _meter.CreateCounter<int>(@"GenericIntCounterExt0D"); 413var instrument = _meter.CreateCounter<long>(@"Counter0D"); 423var instrument = _meter.CreateCounter<long>(@"MyNamedCounter"); 433var instrument = _meter.CreateCounter<long>(@"CounterExt0D"); 443var instrument = _meter.CreateCounter<int>(@"GenericIntCounter1D"); 453var instrument = _meter.CreateCounter<int>(@"GenericIntCounterExt1D"); 463var instrument = _meter.CreateCounter<float>(@"GenericFloatCounter1D"); 473var instrument = _meter.CreateCounter<float>(@"GenericFloatCounterExt1D"); 483var instrument = _meter.CreateCounter<long>(@"Counter2D"); 493var instrument = _meter.CreateCounter<long>(@"CounterExt2D"); 503var instrument = _meter.CreateCounter<long>(@"Counter3D"); 513var instrument = _meter.CreateCounter<long>(@"CounterExt3D"); 523var instrument = _meter.CreateCounter<long>(@"Counter4D"); 533var instrument = _meter.CreateCounter<long>(@"CounterExt4D"); 543var instrument = _meter.CreateCounter<long>(@"CounterS0D2"); 553var instrument = _meter.CreateCounter<long>(@"CounterExtS0D2"); 563var instrument = _meter.CreateCounter<long>(@"CounterS1D1"); 573var instrument = _meter.CreateCounter<long>(@"CounterExtS1D1"); 583var instrument = _meter.CreateCounter<long>(@"CounterS3D2"); 593var instrument = _meter.CreateCounter<long>(@"CounterExtS3D2"); 603var instrument = _meter.CreateCounter<long>(@"CounterS5D5"); 613var instrument = _meter.CreateCounter<long>(@"CounterExtS5D5"); 623var instrument = _meter.CreateCounter<long>(@"TestCounter"); 633var instrument = _meter.CreateCounter<long>(@"TestCounterExt"); 643var instrument = _meter.CreateCounter<long>(@"MyCounterMetric"); 653var instrument = _meter.CreateCounter<long>(@"MyCounterMetric"); 663var instrument = _meter.CreateCounter<long>(@"MyMetric\Category\SingleSlash"); 673var instrument = _meter.CreateCounter<long>(@"MyMetric\Category\SingleSlash"); 683var instrument = _meter.CreateCounter<long>(@"MyMetric\Category\DoubleSlash"); 693var instrument = _meter.CreateCounter<long>(@"MyMetric\Category\DoubleSlash"); 703var instrument = _meter.CreateCounter<decimal>(@"MyCounterStrongTypeMetric"); 713var instrument = _meter.CreateCounter<decimal>(@"MyCounterStrongTypeMetricExt"); 723var instrument = _meter.CreateCounter<long>(@"MyCounterStructTypeMetric"); 733var instrument = _meter.CreateCounter<long>(@"MyCounterStructTypeMetric"); 743var instrument = _meter.CreateCounter<long>(@"MyCounterRecordClassTypeMetric"); 761var instrument = _meter.CreateCounter<long>(@"FileScopedNamespaceCounter"); 771var instrument = _meter.CreateCounter<double>(@"FileScopedNamespaceGenericDoubleCounter"); 1205var instrument = _meter.CreateCounter<int>(@"CounterFromRecordClass"); 1219var instrument = _meter.CreateCounter<int>(@"CounterFromRecordStruct"); 1233var instrument = _meter.CreateCounter<int>(@"CounterFromStruct"); 1275var instrument = _meter.CreateCounter<long>(@"CounterWithUnit", @"seconds"); 1285var instrument = _meter.CreateCounter<long>(@"CounterWithUnitAndDims", @"bytes"); 1295var instrument = _meter.CreateCounter<long>(@"CounterStrongTypeWithUnit", @"bytes"); 1305var instrument = _meter.CreateCounter<double>(@"GenericDoubleCounterWithUnit", @"meters"); 1370var instrument = _meter.CreateCounter<long>(@"OverlappingNamesCounter");
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Metrics.g.cs (106)
20private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 22public NoNamespaceCounterInstrument(global::System.Diagnostics.Metrics.Counter<long> counter) 69private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 71public NestedClassCounter(global::System.Diagnostics.Metrics.Counter<int> counter) 119private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 121public MultiLevelNestedClassCounter(global::System.Diagnostics.Metrics.Counter<int> counter) 169private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 171public NestedRecordClassCounter(global::System.Diagnostics.Metrics.Counter<int> counter) 219private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 221public NestedRecordStructCounter(global::System.Diagnostics.Metrics.Counter<int> counter) 269private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 271public NestedStructCounter(global::System.Diagnostics.Metrics.Counter<int> counter) 316private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 318public PublicCounter(global::System.Diagnostics.Metrics.Counter<long> counter) 499private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 501public GenericIntCounter0D(global::System.Diagnostics.Metrics.Counter<int> counter) 515private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 517public GenericIntCounterExt0D(global::System.Diagnostics.Metrics.Counter<int> counter) 531private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 533public Counter0D(global::System.Diagnostics.Metrics.Counter<long> counter) 547private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 549public MyNamedCounter(global::System.Diagnostics.Metrics.Counter<long> counter) 563private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 565public CounterExt0D(global::System.Diagnostics.Metrics.Counter<long> counter) 579private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 581public GenericIntCounter1D(global::System.Diagnostics.Metrics.Counter<int> counter) 600private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 602public GenericIntCounterExt1D(global::System.Diagnostics.Metrics.Counter<int> counter) 621private readonly global::System.Diagnostics.Metrics.Counter<float> _counter; 623public GenericFloatCounter1D(global::System.Diagnostics.Metrics.Counter<float> counter) 642private readonly global::System.Diagnostics.Metrics.Counter<float> _counter; 644public GenericFloatCounterExt1D(global::System.Diagnostics.Metrics.Counter<float> counter) 663private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 665public Counter2D(global::System.Diagnostics.Metrics.Counter<long> counter) 685private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 687public CounterExt2D(global::System.Diagnostics.Metrics.Counter<long> counter) 707private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 709public Counter3D(global::System.Diagnostics.Metrics.Counter<long> counter) 730private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 732public CounterExt3D(global::System.Diagnostics.Metrics.Counter<long> counter) 753private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 755public Counter4D(global::System.Diagnostics.Metrics.Counter<long> counter) 777private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 779public CounterExt4D(global::System.Diagnostics.Metrics.Counter<long> counter) 801private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 803public CounterS0D2(global::System.Diagnostics.Metrics.Counter<long> counter) 823private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 825public CounterExtS0D2(global::System.Diagnostics.Metrics.Counter<long> counter) 845private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 847public CounterS1D1(global::System.Diagnostics.Metrics.Counter<long> counter) 867private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 869public CounterExtS1D1(global::System.Diagnostics.Metrics.Counter<long> counter) 889private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 891public CounterS3D2(global::System.Diagnostics.Metrics.Counter<long> counter) 914private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 916public CounterExtS3D2(global::System.Diagnostics.Metrics.Counter<long> counter) 939private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 941public CounterS5D5(global::System.Diagnostics.Metrics.Counter<long> counter) 974private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 976public CounterExtS5D5(global::System.Diagnostics.Metrics.Counter<long> counter) 1009private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1011public TestCounter(global::System.Diagnostics.Metrics.Counter<long> counter) 1033private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1035public TestCounterExt(global::System.Diagnostics.Metrics.Counter<long> counter) 1057private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1059public CounterWithVariableParams(global::System.Diagnostics.Metrics.Counter<long> counter) 1080private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1082public CounterExtWithVariableParams(global::System.Diagnostics.Metrics.Counter<long> counter) 1103private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1105public CounterX(global::System.Diagnostics.Metrics.Counter<long> counter) 1119private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1121public CounterExtX(global::System.Diagnostics.Metrics.Counter<long> counter) 1135private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1137public CounterY(global::System.Diagnostics.Metrics.Counter<long> counter) 1151private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1153public CounterExtY(global::System.Diagnostics.Metrics.Counter<long> counter) 1167private readonly global::System.Diagnostics.Metrics.Counter<decimal> _counter; 1169public StrongTypeDecimalCounter(global::System.Diagnostics.Metrics.Counter<decimal> counter) 1207private readonly global::System.Diagnostics.Metrics.Counter<decimal> _counter; 1209public StrongTypeDecimalCounterExt(global::System.Diagnostics.Metrics.Counter<decimal> counter) 1247private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1249public StructTypeCounter(global::System.Diagnostics.Metrics.Counter<long> counter) 1272private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1274public StructTypeCounterExt(global::System.Diagnostics.Metrics.Counter<long> counter) 1297private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1299public RecordClassTypeCounter(global::System.Diagnostics.Metrics.Counter<long> counter) 1339private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 1341public FileScopedNamespaceCounter(global::System.Diagnostics.Metrics.Counter<long> counter) 1355private readonly global::System.Diagnostics.Metrics.Counter<double> _counter; 1357public FileScopedNamespaceGenericDoubleCounter(global::System.Diagnostics.Metrics.Counter<double> counter) 2223private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 2225public CounterFromRecordClass(global::System.Diagnostics.Metrics.Counter<int> counter) 2247private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 2249public CounterFromRecordStruct(global::System.Diagnostics.Metrics.Counter<int> counter) 2271private readonly global::System.Diagnostics.Metrics.Counter<int> _counter; 2273public CounterFromStruct(global::System.Diagnostics.Metrics.Counter<int> counter) 2323private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 2325public CounterWithUnit(global::System.Diagnostics.Metrics.Counter<long> counter) 2339private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 2341public CounterWithUnitAndDims(global::System.Diagnostics.Metrics.Counter<long> counter) 2361private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 2363public CounterStrongTypeWithUnit(global::System.Diagnostics.Metrics.Counter<long> counter) 2388private readonly global::System.Diagnostics.Metrics.Counter<double> _counter; 2390public GenericDoubleCounterWithUnit(global::System.Diagnostics.Metrics.Counter<double> counter) 2499private readonly global::System.Diagnostics.Metrics.Counter<long> _counter; 2501public OverlappingNamesCounter(global::System.Diagnostics.Metrics.Counter<long> counter)
Stress.ApiService (1)
TestMetrics.cs (1)
14private readonly Counter<int> _counter;
Stress.TelemetryService (1)
CounterMetrics.cs (1)
15var counter = meter.CreateCounter<int>(
System.Diagnostics.DiagnosticSource (6)
System\Diagnostics\Metrics\AggregationManager.cs (1)
384if (genericDefType == typeof(Counter<>))
System\Diagnostics\Metrics\Meter.cs (4)
135public Counter<T> CreateCounter<T>(string name, string? unit = null, string? description = null) where T : struct => CreateCounter<T>(name, unit, description, tags: null); 148public Counter<T> CreateCounter<T>(string name, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct 149=> (Counter<T>)GetOrCreateInstrument<T>(typeof(Counter<T>), name, unit, description, tags, () => new Counter<T>(this, name, unit, description, tags));
System\Diagnostics\Metrics\RuntimeMetrics.cs (1)
23private static readonly Counter<long> s_exceptions;