esigs.dora.lib 1.0.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package esigs.dora.lib --version 1.0.0
                    
NuGet\Install-Package esigs.dora.lib -Version 1.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="esigs.dora.lib" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="esigs.dora.lib" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="esigs.dora.lib" />
                    
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 esigs.dora.lib --version 1.0.0
                    
#r "nuget: esigs.dora.lib, 1.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 esigs.dora.lib@1.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=esigs.dora.lib&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=esigs.dora.lib&version=1.0.0
                    
Install as a Cake Tool

Dora Metrics Tracker

Overview

The Dora Metrics Tracker is a .NET library designed to help track key DORA (DevOps Research and Assessment) metrics: Deployment Frequency, Lead Time for Changes, Change Failure Rate, and Mean Time to Recovery. It provides a flexible interface (IDoraMetricsTracker) with different implementations for storing and retrieving these metrics, including an in-memory solution and a file-based JSON storage solution.

Features

  • Track DORA Metrics: Record deployments and incidents to calculate core DORA metrics.
  • Flexible Storage: Choose between in-memory tracking for quick testing/prototyping or file-based JSON storage for persistence.
  • Extensible: Easily implement new storage mechanisms by adhering to the IDoraMetricsTracker interface.
  • Dependency Injection Friendly: Designed for seamless integration with dependency injection containers.

Getting Started

Prerequisites

  • .NET SDK (Version 9.0 or later recommended)

Building the Project

To build the entire solution, navigate to the project's root directory and run:

dotnet build DoraSolution.sln

Running Tests

To execute all unit tests, run the following command from the project's root directory:

dotnet test DoraSolution.sln

Usage

The core functionality is exposed through the IDoraMetricsTracker interface. You can inject an implementation of this interface into your application.

Example (Conceptual)

// Example of how to use the IDoraMetricsTracker (actual setup depends on your DI container)
public class MyService
{
    private readonly IDoraMetricsTracker _metricsTracker;

    public MyService(IDoraMetricsTracker metricsTracker)
    {
        _metricsTracker = metricsTracker;
    }

    public void PerformDeployment()
    {
        // ... perform deployment logic ...

        // Record a successful deployment
        var result = _metricsTracker.RecordDeployment(DateTime.UtcNow, true, TimeSpan.FromHours(2));
        if (result.IsFailure)
        {
            Console.WriteLine($"Failed to record deployment: {result.Error}");
        }
    }

    public void AnalyzeMetrics()
    {
        var startDate = DateTime.UtcNow.AddMonths(-1);
        var endDate = DateTime.UtcNow;

        var deploymentFrequency = _metricsTracker.GetDeploymentFrequency(startDate, endDate);
        if (deploymentFrequency.IsSuccess)
        {
            Console.WriteLine($"Deployment Frequency: {deploymentFrequency.Value}");
        }

        // ... similar calls for other metrics ...
    }
}

Available Implementations

  • InMemoryDoraMetricsTracker: Stores all metrics data in memory. Ideal for short-lived applications or testing.
  • FileBasedDoraMetricsTracker: Persists metrics data to a JSON file. Requires configuration via DoraFileStorageOptions.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.

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
1.1.8-g570dda1647 152 9/1/2025
1.1.4-g07db0044b9 144 9/1/2025
1.1.3-g4068ca7ce5 140 9/1/2025
1.1.1-g16080c1b9a 143 9/1/2025
1.0.0 156 9/1/2025