Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run dotnet-format on solution #2106

Merged
merged 2 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion benchmarks/Elastic.Apm.Benchmarks/MetricsBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void CollectTotalCpuTime2X()
[Benchmark]
public void CollectTotalAndFreeMemory2X()
{
var mockPayloadSender = new FreeAndTotalMemoryProvider( new List<WildcardMatcher>());
var mockPayloadSender = new FreeAndTotalMemoryProvider(new List<WildcardMatcher>());

mockPayloadSender.GetSamples();
mockPayloadSender.GetSamples();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Elastic.Apm.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

Expand Down
6 changes: 4 additions & 2 deletions benchmarks/Elastic.Apm.Benchmarks/TracerBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ public void SimpleTransactionsWith1SpanWithoutStackTrace()
public void Simple100Transaction10Spans()
=> _agent.Tracer.CaptureTransaction("transaction", "perfTransaction", transaction =>
{
for (var j = 0; j < 10; j++) transaction.CaptureSpan("span", "perfSpan", () => { });
for (var j = 0; j < 10; j++)
transaction.CaptureSpan("span", "perfSpan", () => { });
});

[Benchmark]
public void DebugLogSimpleTransaction10Spans()
=> _agent.Tracer.CaptureTransaction("transaction", "perfTransaction", transaction =>
{
for (var j = 0; j < 10; j++) transaction.CaptureSpan("span", "perfSpan", () => { });
for (var j = 0; j < 10; j++)
transaction.CaptureSpan("span", "perfSpan", () => { });
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public void Setup()
{
_str = string.Empty;
var random = new Random();
for (var i = 0; i < 1000; i++) _str += random.Next(10).ToString();
for (var i = 0; i < 1000; i++)
_str += random.Next(10).ToString();
}

[Benchmark]
Expand Down
6 changes: 6 additions & 0 deletions dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"commands": [
"minver"
]
},
"dotnet-format": {
"version": "5.1.250801",
"commands": [
"dotnet-format"
]
}
}
}
4 changes: 3 additions & 1 deletion sample/ApiSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ public static void SampleSpanWithCustomContextFillAll()
{
span.Context.Db = new Database
{
Statement = "GET /_all/_search?q=tag:wow", Type = Database.TypeElasticsearch, Instance = "MyInstance"
Statement = "GET /_all/_search?q=tag:wow",
Type = Database.TypeElasticsearch,
Instance = "MyInstance"
};
});
});
Expand Down
13 changes: 7 additions & 6 deletions sample/Elastic.Apm.Azure.ServiceBus.Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Messaging.ServiceBus;
Expand All @@ -25,8 +25,8 @@ private static async Task<int> Main(string[] args)
var connectionString = args[0];
_client = new ServiceBusClient(connectionString);

_queueName = "foo"; //Guid.NewGuid().ToString("D");
_queueName = "foo"; //Guid.NewGuid().ToString("D");

await ReadMessages();

Console.WriteLine("Press any key to continue...");
Expand All @@ -40,8 +40,8 @@ private static async Task SendSingleMessage()
var sender = _client.CreateSender(_queueName);

await Agent.Tracer.CaptureTransaction("Send AzureServiceBus Single Message", "messaging", async () =>
{
await sender.SendMessageAsync(new ServiceBusMessage($"test message - single")).ConfigureAwait(false);
{
await sender.SendMessageAsync(new ServiceBusMessage($"test message - single")).ConfigureAwait(false);
});

Console.WriteLine("Messages sent");
Expand Down Expand Up @@ -86,7 +86,8 @@ private static async Task SendMessages()

await Agent.Tracer.CaptureTransaction("Send AzureServiceBus Messages", "messaging", async () =>
{
for (var i = 0; i < 10; i++) await sender.SendMessageAsync(new ServiceBusMessage($"test message {i}")).ConfigureAwait(false);
for (var i = 0; i < 10; i++)
await sender.SendMessageAsync(new ServiceBusMessage($"test message {i}")).ConfigureAwait(false);
});

Console.WriteLine("Messages sent");
Expand Down
2 changes: 1 addition & 1 deletion sample/ElasticsearchSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;
using Elastic.Apm;
using Elastic.Apm.Api;
Expand Down
2 changes: 1 addition & 1 deletion sample/HttpListenerSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

Expand Down
14 changes: 7 additions & 7 deletions sample/StackExchangeRedisSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using Elastic.Apm;
using Elastic.Apm.Api;
using Elastic.Apm.StackExchange.Redis;
Expand All @@ -18,16 +18,16 @@ public static async Task Main(string[] args)
connection.UseElasticApm();

for (var i = 0; i < 10; i++)
{
// async
{
// async
await Agent.Tracer.CaptureTransaction("Set and Get String", ApiConstants.TypeDb, async () =>
{
var database = connection.GetDatabase();
await database.StringSetAsync($"string{i}", i);
await database.StringGetAsync($"string{i}");
// fire and forget commands may not end up in the profiling session before
// transaction end, and the profiling session is finished.
await database.StringGetAsync($"string{i}");

// fire and forget commands may not end up in the profiling session before
// transaction end, and the profiling session is finished.
await database.StringSetAsync($"string{i}", i, flags: CommandFlags.FireAndForget);
await database.StringGetAsync($"string{i}", CommandFlags.FireAndForget);
});
Expand Down
30 changes: 15 additions & 15 deletions src/Elastic.Apm.Specification/ImplementationProperty.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System;

namespace Elastic.Apm.Specification
{
{
/// <summary>
/// A property defined on a type that implements the APM server specification
/// </summary>
Expand All @@ -17,26 +17,26 @@ public ImplementationProperty(string name, Type propertyType, Type declaringType
Name = name;
PropertyType = propertyType;
DeclaringType = declaringType;
}
}

/// <summary>
/// The name of the property
/// </summary>
public string Name { get; }
public string Name { get; }

/// <summary>
/// The type of the property
/// </summary>
public Type PropertyType { get; }
public Type PropertyType { get; }

/// <summary>
/// The type that declares the property
/// </summary>
public Type DeclaringType { get; }
public Type DeclaringType { get; }

/// <summary>
/// The max length that the property value can have
/// </summary>
public int? MaxLength { get; set; }
public int? MaxLength { get; set; }
}
}
12 changes: 6 additions & 6 deletions src/Elastic.Apm.Specification/JsonSchemaExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System.IO;
using NJsonSchema;

namespace Elastic.Apm.Specification
{
public static class JsonSchemaExtensions
{
{
/// <summary>
/// Gets the schema $id if it exists, the name of the property if the schema represents a property,
/// or the file name of the schema document path.
Expand Down
10 changes: 5 additions & 5 deletions src/Elastic.Apm.Specification/TypeValidationError.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System;

namespace Elastic.Apm.Specification
Expand Down
10 changes: 5 additions & 5 deletions src/Elastic.Apm.Specification/TypeValidationResult.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
16 changes: 8 additions & 8 deletions src/Elastic.Apm.Specification/Validation.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
// Licensed to Elasticsearch B.V under
// one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

namespace Elastic.Apm.Specification
{
{
/// <summary>
/// Determines how validation is performed
/// </summary>
public enum Validation
{
{
/// <summary>
/// Validates the type against the specification. A type must be a valid implementation of the specification, but
/// it may be only a subset of the properties i.e. schema properties of type "null" may not be implemented.
/// </summary>
TypeToSpec,
TypeToSpec,
/// <summary>
/// Validates the specification against the type. A type must match the specification exactly in order to be valid
/// </summary>
Expand Down
Loading
Loading