Skip to content

Commit 7548f44

Browse files
authored
Apply formatting fixes (dotnet#2906)
1 parent 4786220 commit 7548f44

File tree

38 files changed

+43
-66
lines changed

38 files changed

+43
-66
lines changed

samples/Prometheus/HttpLoadApp/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
foreach (var planet in planets)
1313
{
14-
_ = Task.Run( () =>
14+
_ = Task.Run(() =>
1515
{
1616
CreateLoad("http://localhost:5000/" + planet);
1717
});
@@ -21,7 +21,7 @@
2121
async void CreateLoad(string UrlPrefix)
2222
{
2323
var i = 0;
24-
while(true)
24+
while (true)
2525
{
2626
var url = UrlPrefix + "/" + i;
2727
var resp = await client.GetAsync(url);

samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/PrometheusOutboundHttpMetrics.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
5-
// Licensed to the .NET Foundation under one or more agreements.
6-
// The .NET Foundation licenses this file to you under the MIT license.
7-
84
using System;
95
using Yarp.Telemetry.Consumption;
106
using Prometheus;
@@ -28,7 +24,7 @@ public sealed class PrometheusOutboundHttpMetrics : IMetricsConsumer<HttpMetrics
2824
"Number of outbound requests failed"
2925
);
3026

31-
private static readonly Gauge _outboundCurrentRequests =Metrics.CreateGauge(
27+
private static readonly Gauge _outboundCurrentRequests = Metrics.CreateGauge(
3228
"yarp_outbound_http_current_requests",
3329
"Number of active outbound requests that have started but not yet completed or failed"
3430
);
@@ -38,12 +34,12 @@ public sealed class PrometheusOutboundHttpMetrics : IMetricsConsumer<HttpMetrics
3834
"Number of currently open HTTP 1.1 connections"
3935
);
4036

41-
private static readonly Gauge _outboundCurrentHttp20Connections= Metrics.CreateGauge(
37+
private static readonly Gauge _outboundCurrentHttp20Connections = Metrics.CreateGauge(
4238
"yarp_outbound_http20_connections",
4339
"Number of active proxy requests that have started but not yet completed or failed"
4440
);
4541

46-
private static readonly Histogram _outboundHttp11RequestQueueDuration= Metrics.CreateHistogram(
42+
private static readonly Histogram _outboundHttp11RequestQueueDuration = Metrics.CreateHistogram(
4743
"yarp_outbound_http11_request_queue_duration",
4844
"Average time spent on queue for HTTP 1.1 requests that hit the MaxConnectionsPerServer limit in the last metrics interval",
4945
new HistogramConfiguration

samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/PrometheusSocketMetrics.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public sealed class PrometheusSocketMetrics : IMetricsConsumer<SocketsMetrics>
1313
"Number of outgoing (Connect) Socket connections established"
1414
);
1515

16-
1716
private static readonly Counter _incomingConnectionsEstablished = Metrics.CreateCounter(
1817
"yarp_sockets_incoming_connections_established",
1918
"Number of incoming (Accept) Socket connections established"

samples/ReverseProxy.Code.Sample/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
var app = builder.Build();
2424

25-
2625
app.Map("/update", context =>
2726
{
2827
context.RequestServices.GetRequiredService<InMemoryConfigProvider>().Update(GetRoutes(), GetClusters());

samples/ReverseProxy.Metrics.Sample/PerRequestMetrics.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ private PerRequestMetrics() { }
2424
// Time the request was started via the pipeline
2525
public DateTime StartTime { get; set; }
2626

27-
2827
// Offset Tics for each part of the proxy operation
2928
public float RouteInvokeOffset { get; set; }
3029
public float ProxyStartOffset { get; set; }

samples/ReverseProxy.Metrics.Sample/PerRequestYarpMetricCollectionMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public async Task InvokeAsync(HttpContext context)
3939
// Called after the other middleware steps have completed
4040
// Write the info to the console via ILogger. In a production scenario you probably want
4141
// to write the results to your telemetry systems directly.
42-
_logger.LogInformation("PerRequestMetrics: "+ metrics.ToJson());
42+
_logger.LogInformation("PerRequestMetrics: " + metrics.ToJson());
4343
}
4444
}
4545

src/Kubernetes.Controller/Caching/IngressCache.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public bool Update(WatchEventType eventType, V1Ingress ingress)
8080
return true;
8181
}
8282

83-
8483
public ImmutableList<string> Update(WatchEventType eventType, V1Service service)
8584
{
8685
ArgumentNullException.ThrowIfNull(service);
@@ -163,7 +162,6 @@ private bool IsYarpIngress(IngressData ingress)
163162
{
164163
return _ingressClassData.ContainsKey(ingress.Spec.IngressClassName);
165164
}
166-
167165
}
168166

169167
private NamespaceCache Namespace(string key)

src/Kubernetes.Controller/Client/V1IngressResourceStatusUpdater.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public V1IngressResourceStatusUpdater(
3232
_logger = logger;
3333
}
3434

35-
3635
public async Task UpdateStatusAsync(CancellationToken cancellationToken)
3736
{
3837
var service = await _client.CoreV1.ReadNamespacedServiceStatusAsync(_options.ControllerServiceName, _options.ControllerServiceNamespace, cancellationToken: cancellationToken);

src/Kubernetes.Controller/Converters/YarpConfigContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ internal class YarpConfigContext
1414

1515
public List<ClusterConfig> BuildClusterConfig()
1616
{
17-
return ClusterTransfers.Values.Select(c => new ClusterConfig() {
17+
return ClusterTransfers.Values.Select(c => new ClusterConfig()
18+
{
1819
Destinations = c.Destinations,
1920
ClusterId = c.ClusterId,
2021
HealthCheck = c.HealthCheck,

src/Kubernetes.Controller/Protocol/ReceiverOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ namespace Yarp.Kubernetes.Protocol;
99
public class ReceiverOptions
1010
{
1111
public Uri ControllerUrl { get; set; }
12-
12+
1313
public HttpMessageInvoker Client { get; set; }
1414
}

0 commit comments

Comments
 (0)