All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.gatling.charts.component.DetailsStatsTableComponent.scala Maven / Gradle / Ivy

There is a newer version: 3.13.1
Show newest version
/*
 * Copyright 2011-2024 GatlingCorp (https://gatling.io)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.gatling.charts.component

import io.gatling.charts.stats.{ GeneralStats, Ranges }
import io.gatling.core.config.IndicatorsConfiguration
import io.gatling.shared.util.NumberHelper._

private[charts] object Stats {
  def printable[T: Numeric](value: T): String =
    value match {
      case GeneralStats.NoPlotMagicValue => "-"
      case _: Int | _: Long              => value.toString
      case _                             => implicitly[Numeric[T]].toDouble(value).toPrintableString
    }
}

private[charts] final class Stats[T: Numeric](val name: String, val total: T, val success: T, val failure: T)

private[charts] final class RequestStatistics(
    val name: String,
    val path: String,
    val numberOfRequestsStatistics: Stats[Long],
    val minResponseTimeStatistics: Stats[Int],
    val maxResponseTimeStatistics: Stats[Int],
    val meanResponseTimeStatistics: Stats[Int],
    val stdDeviationStatistics: Stats[Int],
    val percentiles1: Stats[Int],
    val percentiles2: Stats[Int],
    val percentiles3: Stats[Int],
    val percentiles4: Stats[Int],
    val ranges: Ranges,
    val meanNumberOfRequestsPerSecondStatistics: Stats[Double]
)

private[charts] final class DetailsStatsTableComponent(configuration: IndicatorsConfiguration) extends Component {
  override def html: String = s"""
                        
Stats

Executions

TotalOKKO
Total count
Mean count/s

Response Time (ms)

Total OK KO
Min
${configuration.percentile1.toRank} percentile
${configuration.percentile2.toRank} percentile
${configuration.percentile3.toRank} percentile
${configuration.percentile4.toRank} percentile
Max
Mean
Standard Deviation
""" val js = "" val jsFiles: Seq[String] = Nil }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy