Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ejsmith committed Aug 7, 2024
1 parent e8201fd commit defd3da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
Expand All @@ -24,13 +24,13 @@ public class DiagnosticsMetricsCollector : IDisposable
private readonly ConcurrentQueue<RecordedMeasurement<float>> _floatMeasurements = new();
private readonly ConcurrentQueue<RecordedMeasurement<double>> _doubleMeasurements = new();
private readonly ConcurrentQueue<RecordedMeasurement<decimal>> _decimalMeasurements = new();
private readonly int _maxMeasurementCountPerType = 1000;
private readonly int _maxMeasurementCountPerType;
private readonly AsyncAutoResetEvent _measurementEvent = new(false);
private readonly ILogger _logger;

public DiagnosticsMetricsCollector(string metricNameOrPrefix, ILogger logger, int maxMeasurementCountPerType = 1000) : this(n => n.StartsWith(metricNameOrPrefix), logger, maxMeasurementCountPerType) { }
public DiagnosticsMetricsCollector(string metricNameOrPrefix, ILogger logger, int maxMeasurementCountPerType = 10000) : this(n => n.StartsWith(metricNameOrPrefix), logger, maxMeasurementCountPerType) { }

public DiagnosticsMetricsCollector(Func<string, bool> shouldCollect, ILogger logger, int maxMeasurementCount = 1000)
public DiagnosticsMetricsCollector(Func<string, bool> shouldCollect, ILogger logger, int maxMeasurementCount = 10000)
{
_logger = logger;
_maxMeasurementCountPerType = maxMeasurementCount;
Expand Down
6 changes: 3 additions & 3 deletions src/Foundatio.TestHarness/Queue/QueueTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ await queue.EnqueueAsync(new SimpleWorkItem
public virtual Task VerifyRetryAttemptsAsync()
{
const int retryCount = 2;
var queue = GetQueue(retryCount, TimeSpan.FromSeconds(1), TimeSpan.Zero, new[] { 1 });
var queue = GetQueue(retryCount, TimeSpan.FromSeconds(1), TimeSpan.Zero, [1]);
if (queue == null)
return Task.CompletedTask;

Expand All @@ -344,7 +344,7 @@ public virtual Task VerifyRetryAttemptsAsync()
public virtual Task VerifyDelayedRetryAttemptsAsync()
{
const int retryCount = 2;
var queue = GetQueue(retryCount, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), new[] { 1 });
var queue = GetQueue(retryCount, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), [1]);
if (queue == null)
return Task.CompletedTask;

Expand Down Expand Up @@ -400,7 +400,7 @@ await queue.EnqueueAsync(new SimpleWorkItem

metricsCollector.RecordObservableInstruments();
Assert.Equal(retryCount + 1, metricsCollector.GetSum<long>("foundatio.simpleworkitem.dequeued"));
Assert.Equal(0, metricsCollector.GetSum<int>("foundatio.simpleworkitem.completed"));
Assert.Equal(0, metricsCollector.GetSum<long>("foundatio.simpleworkitem.completed"));
Assert.Equal(retryCount + 1, metricsCollector.GetSum<long>("foundatio.simpleworkitem.abandoned"));

Assert.Equal(0, metricsCollector.GetSum<long>("foundatio.simpleworkitem.count"));
Expand Down

0 comments on commit defd3da

Please sign in to comment.