Skip to content

Commit

Permalink
Remove a few internal references (#4290)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikita Balabaev <[email protected]>
  • Loading branch information
xakep139 and xakep139 authored Aug 15, 2023
1 parent 578992f commit ee09560
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 49 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,4 @@ BenchmarkDotNet.artifacts/

/_TEST

*.binlog

/docs/releases/r9-packages.md
*.binlog
18 changes: 0 additions & 18 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ ECS
ECS
ejuvenate
encodings
eng.ms
enricher
Enricher
enrichers
Expand Down Expand Up @@ -283,23 +282,6 @@ Protobuf-net
PubSub
QoS
quantiles
R9
R9_RELEASE
R9A000
R9A001
R9A002
R9G000
R9G001
R9G002
R9G003
R9G004
R9G005
R9G006
R9G007
R9G008
R9G009
R9G010
r9support
Ramati
ramping
RDFE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Http.Telemetry.Logging.Bench;

internal sealed class BenchEnricher : IHttpClientLogEnricher
{
private const string Key = "Performance in R9";
private const string Key = "Performance in .NET Extensions";
private const string Value = "is paramount.";

public void Enrich(IEnrichmentTagCollector collector, HttpRequestMessage? request = null,
Expand Down
26 changes: 13 additions & 13 deletions eng/Tools/DiagConfig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ refreshed as new analyzers are added or existing ones are modified.
The lower a diagnostic's tier value, the more relatively important the diagnostic is.

* A variable set of named attributes. Each attribute indicates a severity for the diagnostic, along with
an optional comment. Attributes and their severities are maintained by the R9 team and are used to
an optional comment. Attributes and their severities are maintained by the .NET Extensions team and are used to
describe how to handle a given diagnostic for a given type of source code. More on attributes below.

Here's an example diagnostic:

```yaml
Diagnostics:
EA0001:
CA1001:
Metadata:
Category: Performance
Title: Switch to `Microsoft.IO.RecyclableMemoryStream` for additional performance.
Description: Identifies uses of System.IO.MemoryStream.
HelpLinkUri: https://eng.ms/docs/experiences-devices/r9-sdk/docs/static-analysis-and-analyzers/analyzer/rules/r9a001
CustomTags: []
Tier: 1
Category: Design
Title: Types that own disposable fields should be disposable
Description: A class declares and implements an instance field that is a System.IDisposable type, and the class does not implement IDisposable. A class that declares an IDisposable field indirectly owns an unmanaged resource and should implement the IDisposable interface.
HelpLinkUri: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1001
CustomTags:
- PortedFromFxCop
- Telemetry
- EnabledRuleInAggressiveMode
DefaultSeverity: None
Tier: 2
Attributes:
baseline:
Severity: None
Comment:
production:
general:
Severity: Warning
Comment:
```
## What's the Point?
Expand Down
2 changes: 1 addition & 1 deletion src/LegacySupport/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# About this Folder

This folder contains a bunch of sources copied from newer versions of .NET which we pull in to
R9 sources as necessary. This enables us to compile source code that depends on these newer
our sources as necessary. This enables us to compile source code that depends on these newer
features from .NET even when targeting older frameworks.

Please see the `eng/MSBuild/LegacySupport.props` file for the set of project properties that control importing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public FakeLogRecord(LogLevel level, EventId id, object? state, Exception? excep
///
/// The object returned by this property is the same as what <see cref="State"/> returns, except it has been cast to a read-only list.
/// </remarks>
/// <exception cref="InvalidCastException">The state object was not generated by the R9 logging model and is not a read-only list.</exception>
/// <exception cref="InvalidCastException">The state object is not compatible with supported logging model and is not a read-only list.</exception>
public IReadOnlyList<KeyValuePair<string, string?>>? StructuredState => (IReadOnlyList<KeyValuePair<string, string?>>?)State;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class EventCountersCollectorOptions
/// </value>
/// <remarks>
/// Includes the recommended default event counters in addition to the counters specified in <see cref="Counters"/>.
/// See the list of recommended default counters in <see href="https://eng.ms/docs/experiences-devices/r9-sdk/docs/telemetry/metering/event-counters"/>.
/// EventSource: "System.Runtime", Counters:
/// - "cpu-usage", "working-set", "time-in-gc", "alloc-rate", "exception-count", "gen-2-gc-count", "gen-2-size",
/// - "monitor-lock-contention-count", "active-timer-count", "threadpool-queue-length", "threadpool-thread-count",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void Basic()
var factory = serviceProvider.GetService<ILoggerFactory>();
var collector = serviceProvider.GetFakeLogCollector();

var logger = factory!.CreateLogger("R9");
var logger = factory!.CreateLogger("DOT-NET");
Assert.Equal(0, collector.Count);
logger.LogError("M1");
Assert.Equal(1, collector.Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public async Task AddMetering_MeterStateOverrides_WithOverlappingMatches_Applies
jsonConfigRoot.Bind("MeteringWithOverrides", meteringOptions);
configurationSection.Value = JsonConvert.SerializeObject(meteringOptions);

using var exporter = new TestExporter("R9.Test");
using var exporter = new TestExporter("DotNet.Test");
using var reader = new BaseExportingMetricReader(exporter);

using var host = await FakeHost.CreateBuilder()
Expand All @@ -216,23 +216,23 @@ public async Task AddMetering_MeterStateOverrides_WithOverlappingMatches_Applies
}))
.StartAsync();

var meterNameR9Test = $"R9.Test{DateTime.Now.Ticks}";
var meterNameR9Test = $"DotNet.Test{DateTime.Now.Ticks}";
using var meter1 = new Meter(meterNameR9Test);
var counter1 = meter1.CreateCounter<long>("meter1_counter1");
counter1.Add(5);
reader.Collect();
Assert.Equal(0, exporter.Metrics.Count);
Assert.False(IsMetricAvailable(exporter.Metrics, meterNameR9Test, "meter1_counter1"));

var meterNameR9TestInternal = $"R9.Test.Internal{DateTime.Now.Ticks}";
var meterNameR9TestInternal = $"DotNet.Test.Internal{DateTime.Now.Ticks}";
using var meter2 = new Meter(meterNameR9TestInternal);
var counter2 = meter2.CreateCounter<long>("meter2_counter2");
counter2.Add(16);
reader.Collect();
Assert.True(IsMetricAvailable(exporter.Metrics, meterNameR9TestInternal, "meter2_counter2"));
Assert.Equal(16, exporter.FirstMetricPoint().GetSumLong());

var meterNameR9TestExternal = $"R9.Test.External{DateTime.Now.Ticks}";
var meterNameR9TestExternal = $"DotNet.Test.External{DateTime.Now.Ticks}";
using var meter3 = new Meter(meterNameR9TestExternal);
var counter3 = meter3.CreateCounter<long>("meter3_counter3");
counter2.Add(8);
Expand Down Expand Up @@ -375,7 +375,7 @@ public async Task LongCounter_SumAsExpected()
[Fact(Skip = "Flaky")]
public async Task EmitMetric_DoesNotThrowAsync()
{
var meterName1 = $"Microsoft.R9.Extensions.Meter1{DateTime.Now.Ticks}";
var meterName1 = $"Microsoft.Extensions.Meter1{DateTime.Now.Ticks}";
var meterName2 = $"Meter2{DateTime.Now.Ticks}";

using var exporter = new TestExporter(meterName1, meterName2);
Expand All @@ -388,7 +388,7 @@ public async Task EmitMetric_DoesNotThrowAsync()
builder.AddMetering(option =>
{
option.MeterState = MeteringState.Disabled;
option.MeterStateOverrides.Add(new KeyValuePair<string, MeteringState>("Microsoft.R9.Extensions", MeteringState.Enabled));
option.MeterStateOverrides.Add(new KeyValuePair<string, MeteringState>("Microsoft.Extensions", MeteringState.Enabled));
})
.AddTestExporter(reader);
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.Extensions.Telemetry.Internal.Test;

[EventSource(Name = "R9-SelfDiagnostics-Test")]
[EventSource(Name = "DotNet-SelfDiagnostics-Test")]
internal sealed class TestEventSource : EventSource
{
public const string WarningMessageText = "This is a warning event.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"MeterState": "Enabled",
"MeterStateOverrides": {
"testMeter2": "Disabled",
"R9.Test": "Disabled",
"R9.Test.Internal": "Enabled",
"R9.Test.External": "Disabled"
"DotNet.Test": "Disabled",
"DotNet.Test.Internal": "Enabled",
"DotNet.Test.External": "Disabled"
}
},
"MeteringWithOverridesWithEmptyOverride": {
Expand Down

0 comments on commit ee09560

Please sign in to comment.