Giter Site home page Giter Site logo

rtriunfo / gatling-gradle-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paoloambrosio-skyuk/gatling-gradle-plugin

0.0 0.0 0.0 199 KB

[Deprecated] The gatling gradle plugin provides the ability to run gatling scenarios directly from a gradle build. The plugin utilizes the gatling cli provided by gatling.

License: Apache License 2.0

Groovy 100.00%

gatling-gradle-plugin's Introduction

THIS PROJECT IS DEPRECATED

gatling-gradle-plugin is no longer maintained, and this repository will be removed from GitHub on or after Wednesday, March 4, 2020. Published release artifacts will continue to be available indefinitely via JCenter.

Gatling Gradle Plugin

The gatling gradle plugin provides the ability to run gatling scenarios directly from a gradle build. The plugin utilizes the gatling cli provided by gatling.

See our security policy for handling of security-related matters.

3.0.0 Release

August 22, 2019

This version is a substantial update with support for newer versions of Gradle.

  • gatling gradle plugin now supports up to Gradle 5.2.1
  • Gradle version compatibility testing is now included as GatlingPluginFunctionalSpec

2.0 Release

June 20, 2016

Version 2.0 of this plugin is now available. This version is a major upgrade and is not compatible with configurations for the 1.x plugin versions. This upgrade deliveres the following features:

  • The ability to configure multiple simulations per gradle project.
  • Ability to set degradation tolerances for comparison of metrics in graphite.
  • Ability to pass JVM properties per task definition.

September 7, 2016

Version 2.1 of this plugin is now available. This version is a minor upgrade and should not effect current configurations for the 2.x plugin versions. This upgrade deliveres the following features:

  • The ability to set minimum average time thresholds for individual metrics

Compatibility

The gatling gradle plugin currently supports Java 8. The plugin requires gradle version 2.0 or later and gatling 2.1 or later. The most recently verified version of gradle is 3.3 and the most recently verified version of gatling is 2.2.3.

Using the Plugin

Download

The following gradle configuration will execute the gatling scenarios "MyAwesomeSimulation" and "MyCoolSimulation" using bodies in the "bodies" directory, data in the "data" directory, and the configuration file "resources/gatling.conf". Reports will be stores in the "reports" directory. The plugin will also check for KOed requests, and compare request times to previous request times.

apply plugin: 'scala'

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.commercehub:gatling-gradle-plugin:2.0'
    }

}

repositories {
    jcenter()
}

ext {
    SCALA_VERSION = "2.11.7"
    GATLING_VERSION = "2.2.3"
}

dependencies {
    compile "org.scala-lang:scala-library:${SCALA_VERSION}"
    testCompile "io.gatling:gatling-http:${GATLING_VERSION}"
    testCompile "io.gatling:gatling-core:${GATLING_VERSION}"
    testCompile "io.gatling.highcharts:gatling-charts-highcharts:${GATLING_VERSION}"
    testCompile "io.gatling:gatling-app:${GATLING_VERSION}"
}


apply plugin: 'gatling'

gatling {
    checkForKOs = true
    koThreshold = 0

    metrics {
        graphiteUrl = "http://my.graphite.server.com"
        metricPrefix = 'my-namespace'
    }
}

import com.commercehub.gradle.plugin.GatlingTask
task loadTest(type: GatlingTask, dependsOn: ['compileTestScala']) {
    gatlingSimulation = 'MyGatlingTest'
    metrics {
        metricsToCheck = ['myapp:pageresponsetime']
        daysToCheck = 5
        degradationTolerance = 0.50
        thresholdsByMetricIndex = [100]
    }
    jvmOptions {
        minHeapSize = "1024m"
        maxHeapSize = "1024m"
        systemProperty 'some.custom.setting', 'value'
    }
}

Running the following command will execute the gatling task defined above:

gradle(w) loadTest

GatlingTest Task Configuration

All task paramters except for sourceSet, gatlingSimulation and jvmOptions can be configured at the 'gatling' extension level to provide global defaults.

  • sourceSet : Project source set containing gatling simulation to run. Defaults to project.sourceSets.test.
  • gatlingSimulation : The list of scenarios to run.
  • failBuild : Sets whether or not a failed load test should fail/stop the build. Defaults to true.
  • checkForKOs : Set whether or not to check for KOed requests. Defaults to true.
  • koThreshold : Number of KOs that will be allowed before the build is considered failed. Defaults to 0.
  • gatlingDataDir : The directory containing gatling data files. Defaults to $projectRoot/data.
  • gatlingBodiesDir : The directory containing gatling bodies files. Defaults to $projectRoot/user-files/request-bodies.
  • gatlingReportsDir : The directory where gatling reports will be dropped. Defaults to $projectRoot/build/reports.
  • gatlingConfFile : The gatling conf file to use. Defaults to $projectRoot/resources/gatling.conf.
  • metrics : Nested configuration closure configuring performance metrics checks.
  • jvmOptions : Nested configuration of type JavaForkOptions

Configuring checking of performance metrics in graphite

  • graphiteUrl : The graphite base url.
  • graphiteMetricPrefix : prefix to add to the graphite metric.
  • metricsToCheck : The list of graphite metrics to check. Metrics in this list will be pre-pended with. gatling.<graphiteMetricPrefix>.<gatlingSimulation(lowercase)>.
  • thresholdsByMetricIndex : The list of timing thresholds(in ms) that you don't want your average metric times to exceed. Must be a positive integer. Must have one threshold per metricsToCheck or exclude from configuration to bypass tests. The index of the threshold number correlates to the index of the metric in metricsToCheck that it belongs to.
  • numberOfDaysToCheck : Number of previous days to compare the current run to. If this value is 0, no check will occur. Must be a positive integer. Defaults to 0.
  • degradationTolerance : Percentage threshold for which the current average response times for a metric cannot exceed historical averages. Defaults to 0.5, for 50%.

gatling-gradle-plugin's People

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.