Git Product home page Git Product logo

testinsights's Introduction

TestInsights Build status NuGet version

Adds an attribute to easily track performance tests using NUnit and Application Insights

Prerequisites:

NUnit

TestInsights is build on top of NUnit. With it, you can add instrumentation to any of your existing unit tests.

Application Insights configured on Azure

In order to use TestInsights, you need to have an Application insights endpoint configured in Azure.

Quick Start

1. Get From NuGet

Install-Package MasterDevs.TestInsights

2. Add the PerfSetup attribute with your InstrumentationKey

You will need the instrumentation key that corresponds to the Application Insights configured in the prerequisites.

To find your InstrumentationKey log on to your Azure instanc and

This only needs to be added once.

using MasterDevs.TestInsights;
// ...
[assembly: PerfSetup("3d9e18a2-8c48-8c48-8c48-cb0bb325679")]

3. Add the Perf attribute to any test you want to instrument

[Test]
[Perf]
public void ShortTest()
{
    Assert.IsTrue(true);
}

Optionally, you can set the EventName property on Perf. This allows you to control what the test is reported as to Application Insights

[Test]
[Perf(EventName = "TestWithAGoodName")]
public void TestWithAUselessName()
{
    Assert.IsTrue(true);
}

4. Log on to App Insights and look at your data

Note: Data tends to take some time to refresh in Application Insights. If you don't see it right away, wait a 5 - 15 minutes and it should be there.

Sample Data:

Settings For Sample Data:

          |   |

------------- | --- Chart Type| Grid Aggregation | Avg Chart height | 4 Custom | JoshLongTest, JoshShortTest, LongTest, ShortTest

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.