Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Hangfire.Core/Storage/IMonitoringApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public interface IMonitoringApi
JobList<FailedJobDto> FailedJobs(int from, int count);
JobList<DeletedJobDto> DeletedJobs(int from, int count);

long JobCount(string stateName);
long ScheduledCount();
long EnqueuedCount(string queue);
long FetchedCount(string queue);
Expand Down
1 change: 1 addition & 0 deletions src/Hangfire.Core/Storage/JobStorageMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public virtual JobList<AwaitingJobDto> AwaitingJobs(int from, int count)
throw JobStorageFeatures.GetNotSupportedException(JobStorageFeatures.Monitoring.AwaitingJobs);
}

public abstract long JobCount(string stateName);
public abstract long ScheduledCount();
public abstract long EnqueuedCount(string queue);
public abstract long FetchedCount(string queue);
Expand Down
5 changes: 5 additions & 0 deletions src/Hangfire.SqlServer/SqlServerMonitoringApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public SqlServerMonitoringApi([NotNull] SqlServerStorage storage, int? jobListLi
_jobListLimit = jobListLimit;
}

public override long JobCount(string stateName)
{
return UseConnection(connection => GetNumberOfJobsByStateName(connection, stateName));
}

public override long ScheduledCount()
{
return UseConnection(connection =>
Expand Down