Progress 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Progress --version 2.0.0
                    
NuGet\Install-Package Progress -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Progress" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Progress" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Progress" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Progress --version 2.0.0
                    
#r "nuget: Progress, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Progress@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Progress&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Progress&version=2.0.0
                    
Install as a Cake Tool

Progress

Progress

This library provides a set of features that help you spin up reporting tasks, either in the form of console apps that show workloads progression or via background jobs providing access to stats during the lifespan of the workload.

Key components

  • Reporters are the core components that display information about the current workload status.

    • ConsoleReporter: Used in console apps to report progression of a simple workload.
    • ConsoleAggregateReporter: Used in console apps to report progression of many workloads.
    • BackgroundReporter: Used in background services that don't require to ouput to std out.
  • Components are objects that report progress as figures, such as bars, spinners, pulse ... Only supported for console-based reporters. All these components are internal and they can only be initialized via their Descriptors.

    • Bar
    • Spinner
    • HearthBeat
    • Pulse
  • Descriptors are builders that help to set up components with proper appearance and behavior.

    • BarDescriptor
    • SpinnerDescriptor
    • HearthBeatDescriptor
    • PulseDescriptor
  • ReporterBuilders help to set up reporters with workloads, components and behavior.

    • ConsoleReporterBuilder
    • ConsoleAggregateReporterBuilder
    • BackgroundReporterBuilder

Console apps with ConsoleReporter

        using var reporter = new ConsoleReporterBuilder()
            .DisplayingStartingTime()
            .DisplayingElapsedTime()
            .DisplayingTimeOfArrival()
            .DisplayingRemainingTime()
            .DisplayingItemsSummary()
            .DisplayingItemsOverview()
            .NotifyingProgress(OnProgress)
            .NotifyingCompletion(OnCompletion)
            .ExportingTo("output.json", FileType.Json)
            .UsingReportingFrequency(TimeSpan.FromMilliseconds(50))
            .UsingComponentDescriptor(BarDescriptor.Default)
            .UsingExpectedItems(SimpleWorker.ExpectedItems)
            .Build();

        var worker = new SimpleWorker()
        {
            OnSuccess = reporter.ReportSuccess,
            OnFailure = reporter.ReportFailure,
        };

        reporter.Start();
        await worker.DoMyworkAsync();

Console apps with ConsoleAggregateReporter

    var worker = new InstallerWorker();

    using var reporter = new ConsoleAggregateReporterBuilder()
        .DisplayingStartingTime()
        .DisplayingElapsedTime()
        .DisplayingTimeOfArrival()
        .DisplayingRemainingTime()
        .DisplayingItemsSummary()
        .DisplayingItemsOverview()
        .NotifyingProgress(OnProgress)
        .NotifyingCompletion(OnCompletion)
        .ExportingTo("output.json", FileType.Json)
        .UsingReportingFrequency(TimeSpan.FromMilliseconds(50))
        .UsingWorkload(worker.CalcRequirements, BarDescriptor.Default)
        .UsingWorkload(worker.DownloadArtifacts, BarDescriptor.Default)
        .UsingWorkload(worker.InstallArtifacts, BarDescriptor.Default)
        .Build();

    worker.OnSuccess = reporter.ReportSuccess;
    worker.OnFailure = reporter.ReportFailure;

    reporter.Start();
    await worker.CalcRequirements.CalcAsync();
    Task[] restTasks = [worker.DownloadArtifacts.DownloadAsync(), worker.InstallArtifacts.InstallAsync()];
    await Task.WhenAll(restTasks);

Background services

internal class HostedService : IHostedService
{
    private readonly SimpleWorker _worker = new();
    private readonly BackgroundReporter _reporter;

    public HostedService(ILogger<HostedService> logger)
    {
        _reporter = new BackgroundReporterBuilder()
            .NotifyingProgress((stats) =>
            {
                logger.LogDebug("Getting stats on progress {percent}", stats.CurrentPercent);
            })
            .NotifyingCompletion((stats) =>
            {
                logger.LogDebug("Getting stats on completion");
            })
            .Build(SimpleWorker.ExpectedItems);

        _worker.OnSuccess = () => _reporter.ReportSuccess();
        _worker.OnFailure = () => _reporter.ReportFailure();
    }

    public async Task StartAsync(CancellationToken cancellationToken)
    {        
        _reporter.Start();
        await _worker.DoMyworkAsync();
    }

    public Task StopAsync(CancellationToken cancellationToken)
    {
        _reporter.Stop();
        return Task.CompletedTask;
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 372 11/19/2025
2.0.0 166 10/1/2025
1.4.0 161 9/10/2025
1.3.0 169 9/3/2025
1.2.0 200 8/29/2025
1.1.0 201 8/26/2025