File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
src/NTorSpectator.Observer/Services Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 1
1
using NTorSpectator . Observer . TorIntegration ;
2
2
using NTorSpectator . Services ;
3
3
using NTorSpectator . Services . Models ;
4
+ using Prometheus ;
4
5
using Quartz ;
5
6
6
7
namespace NTorSpectator . Observer . Services ;
7
8
8
9
public class SpectatorJob : IJob
9
10
{
11
+ private static readonly Gauge QueueLength = Metrics . CreateGauge ( "sites_queue_length" , "Length of the queue left to observe" ) ;
10
12
private readonly ILogger < SpectatorJob > _logger ;
11
13
private readonly ISitesCatalogue _sitesCatalogue ;
12
14
private readonly TorControlManager _torControl ;
@@ -29,6 +31,7 @@ public async Task Execute(IJobExecutionContext context)
29
31
var siteQueue = new Queue < QueuedSite > ( sites . Select ( x => new QueuedSite ( x , 0 ) ) ) ;
30
32
while ( siteQueue . TryDequeue ( out var queuedSite ) )
31
33
{
34
+ QueueLength . Set ( siteQueue . Count ) ;
32
35
using var _ = _logger . BeginScope ( new Dictionary < string , object > { { "HiddenService" , queuedSite . Site . SiteUri } } ) ;
33
36
_logger . LogDebug ( "Starting observations on the next site" ) ;
34
37
try
You can’t perform that action at this time.
0 commit comments