Job Management and Metrics

Overview

The open source library Coravel uses invocable classes as a way for you to build isolated tasks/jobs that can be "understood" by Coravel - and they integrate seemlessly with .NET Core's dependency injection system.

However, Coravel Pro takes this idea even further - and calls them "jobs". A job is an invocable class, but with extra super powers.

Coravel Pro's job management allows you to:

  • View a list of all your invocable classes.
  • Ability to run them by simply clicking a button.
  • View status of any running jobs.
  • View history of all executed jobs.
  • View any errors caused by failed jobs.

You can manage all your jobs by using an attractive and intuitive user interface. Piece of cake!

Zero-Config

All you need is to create one or more invocable classes in your solution. Coravel Pro will automatically detect all of them and add them to .NET Core's service provider.

All your jobs will magically appear on the appropriate UI pages that Coravel Pro provides to you!

Excluding Invocables From Auto-Registration

By implementing the interface Coravel.Pro.IDoNotAutoRegister, a given invocable will not show up on the user interface and will not be automatically registered with the DI service container. This may be useful for certain invocables that you do not want end-users to use, are still in testing, etc.

Accessing Job Management

Navigate to /Coravel/Jobs in your internet browser to access Coravel Pro's job management.

Job Health

At the top of the jobs page are a few metrics that help you determine the overall health of your jobs.

job metrics

Running Jobs

Next, you'll see a list of all your invocable jobs.

running jobs

You may execute any job whenever you want by clicking Run.

FYI

Running a job will actually queue it by using Coravel's queue. Therefore, it might take a few seconds for your job to begin.

Sorting

The list of available jobs is sortable (by clicking the "Job" header).

Destructive Jobs

Sometimes you have jobs that are destructive: deleting database records, causing your server's performance to dip for a couple minutes, etc.

In these cases, you can make your job/invocable implement the interface Coravel.Pro.Features.Jobs.Interfaces.IDestructive.

Coravel Pro will add an extra confirmation for destructive jobs:

destructive jobs

Job History

Under the jobs list you will have a history of all jobs that you have executed from this management screen.

job history

Note About Data Retention

Coravel Pro will delete all history (across all features) that are older than 30 days. This ensures your database doesn't get filled up by Coravel Pro 😉

View Failed Job Details

The most important part of this screen is that you may see details of any failed jobs by clicking the "View Error" button.

view error

View Active Jobs

It will also display any jobs that are currently running.

running job

Keeping Watch

This list is auto-refreshed every few seconds so you can keep a watch on any running jobs.