Browse Source

Remove metrics.

pull/816/head
Sebastian 4 years ago
parent
commit
4b358364e8
  1. 3
      backend/.editorconfig
  2. 18
      backend/src/Squidex.Infrastructure/Orleans/J{T}.cs
  3. 2
      backend/src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs

3
backend/.editorconfig

@ -22,6 +22,9 @@ dotnet_diagnostic.SA1649.severity = none
# CA1707: Identifiers should not contain underscores
dotnet_diagnostic.CA1707.severity = none
# CA2016: Forward the 'CancellationToken' parameter to methods
dotnet_diagnostic.CA2016.severity = none
# CS8618: Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
dotnet_diagnostic.CS8618.severity = none

18
backend/src/Squidex.Infrastructure/Orleans/J{T}.cs

@ -54,27 +54,17 @@ namespace Squidex.Infrastructure.Orleans
[SerializerMethod]
public static void Serialize(object? input, ISerializationContext context, Type? expected)
{
using (Telemetry.Activities.StartActivity("JsonSerializer/Serialize"))
{
var jsonSerializer = GetSerializer(context);
var stream = new StreamWriterWrapper(context.StreamWriter);
var stream = new StreamWriterWrapper(context.StreamWriter);
jsonSerializer.Serialize(input, stream);
}
GetSerializer(context).Serialize(input, stream);
}
[DeserializerMethod]
public static object? Deserialize(Type expected, IDeserializationContext context)
{
using (Telemetry.Activities.StartActivity("JsonSerializer/Deserialize"))
{
var jsonSerializer = GetSerializer(context);
var stream = new StreamReaderWrapper(context.StreamReader);
var stream = new StreamReaderWrapper(context.StreamReader);
return jsonSerializer.Deserialize<object>(stream, expected);
}
return GetSerializer(context).Deserialize<object>(stream, expected);
}
private static IJsonSerializer GetSerializer(ISerializerContext context)

2
backend/src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs

@ -203,7 +203,6 @@ namespace Squidex.Areas.Api.Controllers.Assets
private async Task ResizeAsync(IAssetEntity asset, string suffix, Stream target, ResizeOptions resizeOptions, bool overwrite,
CancellationToken ct)
{
#pragma warning disable CA2016 // Forward the 'CancellationToken' parameter to methods
#pragma warning disable MA0040 // Flow the cancellation token
using var activity = Telemetry.Activities.StartActivity("Resize");
@ -264,7 +263,6 @@ namespace Squidex.Areas.Api.Controllers.Assets
await resizeStream.CopyToAsync(target, ct);
}
}
#pragma warning restore CA2016 // Forward the 'CancellationToken' parameter to methods
#pragma warning restore MA0040 // Flow the cancellation token
}
}

Loading…
Cancel
Save