Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use group duration as a response time for group statistics, close #886

  • Loading branch information...
commit 5b05faab10579499a0d99dffc38d3304796e538a 1 parent 18d62a1
@gcoutant gcoutant authored
Showing with 170 additions and 96 deletions.
  1. +0 −1  gatling-charts/src/main/resources/templates/stats_group.js.ssp
  2. +2 −0  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/component/ComponentLibrary.scala
  3. +0 −2  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/component/StatisticsTextComponent.scala
  4. +2 −0  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/component/impl/ComponentLibraryImpl.scala
  5. +4 −5 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/Container.scala
  6. +67 −0 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/GroupDetailsReportGenerator.scala
  7. +2 −1  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/ReportsGenerator.scala
  8. +4 −5 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/RequestDetailsReportGenerator.scala
  9. +3 −5 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/StatsReportGenerator.scala
  10. +0 −2  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/FileDataReader.scala
  11. +8 −4 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/ResultsHolder.scala
  12. +2 −2 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/Buffers.scala
  13. +11 −9 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/GeneralStatsBuffers.scala
  14. +13 −22 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/GroupBuffers.scala
  15. +1 −5 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/LatencyPerSecBuffers.scala
  16. +4 −6 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/RequestsPerSecBuffers.scala
  17. +6 −7 ...-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/ResponseTimePerSecBuffers.scala
  18. +11 −11 ...g-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/ResponseTimeRangeBuffers.scala
  19. +1 −1  ...-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/SessionDeltaPerSecBuffers.scala
  20. +4 −6 ...-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/TransactionsPerSecBuffers.scala
  21. +25 −0 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/template/GroupDetailsPageTemplate.scala
  22. +0 −2  gatling-core/src/main/scala/com/excilys/ebi/gatling/core/result/reader/DataReader.scala
View
1  gatling-charts/src/main/resources/templates/stats_group.js.ssp
@@ -25,6 +25,5 @@ contents: {
<% if (it.hasNext) { %>,<% } %>
<% } %>
},
-duration: <%= group.groupStats.duration.toString %>,
<% attributes("request") = group.requestStats %>
${include("stats_request.js.ssp")}
View
2  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/component/ComponentLibrary.scala
@@ -53,4 +53,6 @@ abstract class ComponentLibrary {
def getRequestDetailsScatterChartComponent(successData: Series[Int, Int], failuresData: Series[Int, Int]): Component
def getRequestDetailsIndicatorChartComponent: Component
def getNumberOfRequestsChartComponent: Component
+ def getGroupDurationChartComponent(runStart: Long, durations: Series[Int, (Int, Int)]): Component
+ def getGroupDetailsDurationDistributionChartComponent(durations: Series[Int, Int]): Component
}
View
2  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/component/StatisticsTextComponent.scala
@@ -83,8 +83,6 @@ case class RequestStatistics(name: String,
.toString
}
-case class GroupStatistics(duration: Long)
-
class StatisticsTextComponent extends Component {
def getHTMLContent: String = TEMPLATE_ENGINE.layout(GATLING_TEMPLATE_STATISTICS_COMPONENT_URL)
View
2  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/component/impl/ComponentLibraryImpl.scala
@@ -36,4 +36,6 @@ class ComponentLibraryImpl extends ComponentLibrary {
def getRequestDetailsScatterChartComponent(successData: Series[Int, Int], failuresData: Series[Int, Int]): Component = throw new UnsupportedOperationException
def getRequestDetailsIndicatorChartComponent: Component = throw new UnsupportedOperationException
def getNumberOfRequestsChartComponent: Component = throw new UnsupportedOperationException
+ def getGroupDurationChartComponent(runStart: Long, durations: Series[Int, (Int, Int)]): Component = throw new UnsupportedOperationException
+ def getGroupDetailsDurationDistributionChartComponent(durations: Series[Int, Int]): Component = throw new UnsupportedOperationException
}
View
9 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/Container.scala
@@ -21,7 +21,7 @@ import scala.annotation.tailrec
import scala.collection.JavaConversions._
import scala.collection.mutable
-import com.excilys.ebi.gatling.charts.component.{ GroupStatistics, RequestStatistics }
+import com.excilys.ebi.gatling.charts.component.RequestStatistics
import com.excilys.ebi.gatling.core.result.Group
object Container {
@@ -34,7 +34,7 @@ trait Container
case class RequestContainer(name: String, stats: RequestStatistics) extends Container
object GroupContainer {
- def root(groupStats: GroupStatistics, requestStats: RequestStatistics) = GroupContainer("ROOT", groupStats, requestStats)
+ def root(requestStats: RequestStatistics) = GroupContainer("ROOT", requestStats)
def getGroup(root: GroupContainer, group: Option[Group]) = {
@tailrec
@@ -51,12 +51,11 @@ object GroupContainer {
}
case class GroupContainer(name: String,
- groupStats: GroupStatistics,
requestStats: RequestStatistics,
contents: mutable.Map[String, Container] = new JLinkedHashMap[String, Container]) extends Container {
- def addGroup(group: Group, groupStats: GroupStatistics, requestStats: RequestStatistics) {
- GroupContainer.getGroup(this, group.parent).contents += (group.name -> GroupContainer(group.name, groupStats, requestStats))
+ def addGroup(group: Group, requestStats: RequestStatistics) {
+ GroupContainer.getGroup(this, group.parent).contents += (group.name -> GroupContainer(group.name, requestStats))
}
def addRequest(parent: Option[Group], request: RequestStatistics) {
View
67 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/GroupDetailsReportGenerator.scala
@@ -0,0 +1,67 @@
+/**
+ * Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.com)
+ *
+ * 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 com.excilys.ebi.gatling.charts.report
+
+import com.excilys.ebi.gatling.charts.component.{ Component, ComponentLibrary, StatisticsTextComponent }
+import com.excilys.ebi.gatling.charts.config.ChartsFiles.requestFile
+import com.excilys.ebi.gatling.charts.series.Series
+import com.excilys.ebi.gatling.charts.template.GroupDetailsPageTemplate
+import com.excilys.ebi.gatling.charts.util.Colors.BLUE
+import com.excilys.ebi.gatling.core.result.message.OK
+import com.excilys.ebi.gatling.core.result.reader.DataReader
+import com.excilys.ebi.gatling.core.result.Group
+
+class GroupDetailsReportGenerator(runOn: String, dataReader: DataReader, componentLibrary: ComponentLibrary) extends ReportGenerator(runOn, dataReader, componentLibrary) {
+
+ def generate {
+ def generateDetailPage(group: Group) {
+ def responseTimeChartComponent: Component = {
+ val durationsData = dataReader.responseTimeGroupByExecutionStartDate(OK, None, Some(group))
+ val durationsSeries = new Series[Int, (Int, Int)]("Group duration", durationsData, List(BLUE))
+
+ componentLibrary.getGroupDurationChartComponent(dataReader.runStart, durationsSeries)
+ }
+
+ def responseTimeDistributionChartComponent: Component = {
+ val (distribution, _) = dataReader.responseTimeDistribution(100, None, Some(group))
+ val distributionSeries = new Series[Int, Int]("Group duration", distribution, List(BLUE))
+
+ componentLibrary.getGroupDetailsDurationDistributionChartComponent(distributionSeries)
+ }
+
+ def statisticsComponent: Component = new StatisticsTextComponent
+
+ def indicatorChartComponent: Component = componentLibrary.getRequestDetailsIndicatorChartComponent
+
+
+ // Create template
+ val template =
+ new GroupDetailsPageTemplate(group,
+ responseTimeChartComponent,
+ responseTimeDistributionChartComponent,
+ statisticsComponent,
+ indicatorChartComponent)
+
+ // Write template result to file
+ new TemplateWriter(requestFile(runOn, group.path)).writeToFile(template.getOutput)
+ }
+
+ dataReader.groupsAndRequests.foreach {
+ case (Some(group), None) => generateDetailPage(group)
+ case _ => {}
+ }
+ }
+}
View
3  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/ReportsGenerator.scala
@@ -44,7 +44,8 @@ object ReportsGenerator extends Logging {
val reportGenerators =
List(new AllSessionsReportGenerator(outputDirectoryName, dataReader, ComponentLibrary.instance),
new GlobalReportGenerator(outputDirectoryName, dataReader, ComponentLibrary.instance),
- new RequestDetailsReportGenerator(outputDirectoryName, dataReader, ComponentLibrary.instance))
+ new RequestDetailsReportGenerator(outputDirectoryName, dataReader, ComponentLibrary.instance),
+ new GroupDetailsReportGenerator(outputDirectoryName, dataReader, ComponentLibrary.instance))
copyAssets
generateMenu
View
9 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/RequestDetailsReportGenerator.scala
@@ -68,14 +68,14 @@ class RequestDetailsReportGenerator(runOn: String, dataReader: DataReader, compo
def indicatorChartComponent: Component = componentLibrary.getRequestDetailsIndicatorChartComponent
- def pageTitle: String = requestName match {
+ /*def pageTitle: String = requestName match {
case None => path + " (Duration = " + dataReader.groupStats(group) + " ms)"
case Some(_) => path
- }
+ }*/
// Create template
val template =
- new RequestDetailsPageTemplate(pageTitle,
+ new RequestDetailsPageTemplate(path,
requestName,
group,
responseTimeChartComponent,
@@ -91,8 +91,7 @@ class RequestDetailsReportGenerator(runOn: String, dataReader: DataReader, compo
dataReader.groupsAndRequests.foreach {
case (group, Some(request)) => generateDetailPage(RequestPath.path(request, group), Some(request), group)
- case (Some(group), None) => generateDetailPage(group.path, None, Some(group))
- case _ => throw new UnsupportedOperationException
+ case _ => {}
}
}
}
View
8 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/report/StatsReportGenerator.scala
@@ -15,7 +15,7 @@
*/
package com.excilys.ebi.gatling.charts.report
-import com.excilys.ebi.gatling.charts.component.{ ComponentLibrary, GroupStatistics, RequestStatistics, Statistics }
+import com.excilys.ebi.gatling.charts.component.{ ComponentLibrary, RequestStatistics, Statistics }
import com.excilys.ebi.gatling.charts.config.ChartsFiles.{ GLOBAL_PAGE_NAME, jsStatsFile, jsonStatsFile, tsvStatsFile }
import com.excilys.ebi.gatling.charts.template.{ StatsJsTemplate, StatsJsonTemplate, StatsTsvTemplate }
import com.excilys.ebi.gatling.core.config.GatlingConfiguration.configuration
@@ -57,13 +57,11 @@ class StatsReportGenerator(runOn: String, dataReader: DataReader, componentLibra
RequestStatistics(name, path, numberOfRequestsStatistics, minResponseTimeStatistics, maxResponseTimeStatistics, meanResponseTimeStatistics, stdDeviationStatistics, percentiles1, percentiles2, groupedCounts, meanNumberOfRequestsPerSecondStatistics)
}
- def computeGroupStats(group: Option[Group]) = GroupStatistics(dataReader.groupStats(group))
-
- val stats = GroupContainer.root(computeGroupStats(None), computeRequestStats(GLOBAL_PAGE_NAME, None, None))
+ val stats = GroupContainer.root(computeRequestStats(GLOBAL_PAGE_NAME, None, None))
dataReader.groupsAndRequests.foreach {
case (group, Some(request)) => stats.addRequest(group, computeRequestStats(request, Some(request), group))
- case (Some(group), None) => stats.addGroup(group, computeGroupStats(Some(group)), computeRequestStats(group.name, None, Some(group)))
+ case (Some(group), None) => stats.addGroup(group, computeRequestStats(group.name, None, Some(group)))
case _ => throw new UnsupportedOperationException
}
View
2  gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/FileDataReader.scala
@@ -205,8 +205,6 @@ class FileDataReader(runUuid: String) extends DataReader(runUuid) with Logging {
.getGeneralStatsBuffers(requestName, group, status)
.compute
- def groupStats(group: Option[Group]) = resultsHolder.getStatsGroupBuffer(group)
-
def numberOfRequestInResponseTimeRange(requestName: Option[String], group: Option[Group]): Seq[(String, Int)] = {
val counts = resultsHolder.getResponseTimeRangeBuffers(requestName, group)
View
12 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/ResultsHolder.scala
@@ -33,21 +33,25 @@ class ResultsHolder(minTime: Long, maxTime: Long)
record.event match {
case START =>
addStartSessionBuffers(record)
- startGroup(record.user, record.scenario, record.executionDate, None)
+ //startGroup(record.user, record.scenario, record.executionDate, None)
addScenarioName(record)
case END =>
addEndSessionBuffers(record)
- endGroup(record.user, record.scenario, record.executionDate)
+ //endGroup(record.user, record.scenario, record.executionDate)
}
}
def addGroupRecord(record: GroupRecord) {
record.event match {
case START =>
- startGroup(record.user, record.scenario, record.executionDate, Some(record.group))
+ startGroup(record)
addGroupName(getCurrentGroup(record.user, record.scenario).get, record.executionDate)
case END =>
- endGroup(record.user, record.scenario, record.executionDate)
+ val (startGroupRecord, group) = endGroup(record)
+ val duration = record.executionDate - startGroupRecord.executionDate
+ updateGroupGeneralStatsBuffers(duration, group)
+ updateGroupResponseTimePerSecBuffers(startGroupRecord.executionDateBucket, duration, group)
+ updateGroupResponseTimeRangeBuffer(duration, group)
}
}
View
4 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/Buffers.scala
@@ -24,7 +24,7 @@ import scala.collection.JavaConversions._
import com.excilys.ebi.gatling.charts.result.reader.ActionRecord
import com.excilys.ebi.gatling.core.result.Group
-trait Buffers {
+/*trait Buffers {
@tailrec
final def recursivelyUpdate(record: ActionRecord, group: Option[Group])(update: (ActionRecord, Option[Group]) => Unit) {
@@ -35,7 +35,7 @@ trait Buffers {
case None => {}
}
}
-}
+}*/
class CountBuffer {
val map: mutable.Map[Int, Int] = new JHashMap[Int, Int]
View
20 ...ing-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/GeneralStatsBuffers.scala
@@ -20,16 +20,15 @@ import java.util.{ HashMap => JHashMap }
import scala.collection.JavaConversions._
import scala.collection.mutable
-import com.excilys.ebi.gatling.charts.result.reader.ActionRecord
-import com.excilys.ebi.gatling.charts.result.reader.FileDataReader
+import com.excilys.ebi.gatling.charts.result.reader.{ ActionRecord, FileDataReader }
import com.excilys.ebi.gatling.charts.result.reader.stats.PercentilesHelper
import com.excilys.ebi.gatling.charts.result.reader.stats.StatsHelper
import com.excilys.ebi.gatling.core.config.GatlingConfiguration.configuration
import com.excilys.ebi.gatling.core.result.Group
-import com.excilys.ebi.gatling.core.result.message.RequestStatus
+import com.excilys.ebi.gatling.core.result.message.{ OK, RequestStatus }
import com.excilys.ebi.gatling.core.result.reader.GeneralStats
-abstract class GeneralStatsBuffers(durationInSec: Long) extends Buffers {
+abstract class GeneralStatsBuffers(durationInSec: Long) {
val generalStatsBuffers: mutable.Map[BufferKey, GeneralStatsBuffer] = new JHashMap[BufferKey, GeneralStatsBuffer]
@@ -37,13 +36,16 @@ abstract class GeneralStatsBuffers(durationInSec: Long) extends Buffers {
generalStatsBuffers.getOrElseUpdate(computeKey(request, group, status), new GeneralStatsBuffer(durationInSec))
def updateGeneralStatsBuffers(record: ActionRecord, group: Option[Group]) {
- recursivelyUpdate(record, group) { (record, group) =>
- getGeneralStatsBuffers(None, group, None).update(record.responseTime)
- getGeneralStatsBuffers(None, group, Some(record.status)).update(record.responseTime)
- }
-
getGeneralStatsBuffers(Some(record.request), group, None).update(record.responseTime)
getGeneralStatsBuffers(Some(record.request), group, Some(record.status)).update(record.responseTime)
+
+ getGeneralStatsBuffers(None, None, None).update(record.responseTime)
+ getGeneralStatsBuffers(None, None, Some(record.status)).update(record.responseTime)
+ }
+
+ def updateGroupGeneralStatsBuffers(duration: Int, group: Group) {
+ getGeneralStatsBuffers(None, Some(group), None).update(duration)
+ getGeneralStatsBuffers(None, Some(group), Some(OK)).update(duration)
}
class GeneralStatsBuffer(duration: Long) extends CountBuffer {
View
35 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/GroupBuffers.scala
@@ -21,42 +21,33 @@ import scala.collection.JavaConversions._
import scala.collection.mutable
import com.excilys.ebi.gatling.core.result.Group
+import com.excilys.ebi.gatling.charts.result.reader.GroupRecord
-trait GroupBuffers extends Buffers {
+trait GroupBuffers {
class GroupStack {
- val stack = new JLinkedList[(Option[Group], Long)]
-
- def start(groupName: Option[String], time: Long) {
- val group = groupName match {
- case Some(groupName) => Some(Group(groupName, getCurrentGroup()))
- case None => None
- }
- stack.push((group, time))
- }
-
- def end(executionEnd: Long) {
- val (group, executionStart) = stack.pop()
+ val stack = new JLinkedList[(GroupRecord, Group)]
- val duration = executionEnd - executionStart
- statsGroupBuffers += (group -> (duration max statsGroupBuffers.getOrElse(group, Long.MinValue)))
+ def start(record: GroupRecord) {
+ stack.push((record, Group(record.group, getCurrentGroup)))
}
- def getCurrentGroup(): Option[Group] = stack.peek()._1
+ def end = stack.pop()
+
+ def getCurrentGroup(): Option[Group] = if (stack.isEmpty) None else Some(stack.peek()._2)
}
val groupStacksByUserAndScenario: mutable.Map[(Int, String), GroupStack] = new JHashMap[(Int, String), GroupStack]
val statsGroupBuffers: mutable.Map[Option[Group], Long] = new JHashMap[Option[Group], Long]
- def startGroup(user: Int, scenario: String, time: Long, group: Option[String]) {
- groupStacksByUserAndScenario.getOrElseUpdate((user, scenario), new GroupStack).start(group, time)
+ def startGroup(record: GroupRecord) {
+ groupStacksByUserAndScenario.getOrElseUpdate((record.user, record.scenario), new GroupStack).start(record)
}
- def endGroup(user: Int, scenario: String, time: Long) {
- groupStacksByUserAndScenario.getOrElseUpdate((user, scenario), throw new IllegalAccessException).end(time)
- }
+ def endGroup(record: GroupRecord) =
+ groupStacksByUserAndScenario.getOrElseUpdate((record.user, record.scenario), throw new IllegalAccessException).end
def getCurrentGroup(user: Int, scenario: String) = groupStacksByUserAndScenario.getOrElseUpdate((user, scenario), new GroupStack).getCurrentGroup()
- def getStatsGroupBuffer(group: Option[Group]) = statsGroupBuffers(group)
+ //def getStatsGroupBuffer(group: Option[Group]) = statsGroupBuffers(group)
}
View
6 ...ng-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/LatencyPerSecBuffers.scala
@@ -24,17 +24,13 @@ import com.excilys.ebi.gatling.charts.result.reader.ActionRecord
import com.excilys.ebi.gatling.core.result.Group
import com.excilys.ebi.gatling.core.result.message.RequestStatus
-trait LatencyPerSecBuffers extends Buffers {
+trait LatencyPerSecBuffers {
val latencyPerSecBuffers: mutable.Map[BufferKey, RangeBuffer] = new JHashMap[BufferKey, RangeBuffer]
def getLatencyPerSecBuffers(requestName: Option[String], group: Option[Group], status: Option[RequestStatus]): RangeBuffer = latencyPerSecBuffers.getOrElseUpdate(computeKey(requestName, group, status), new RangeBuffer)
def updateLatencyPerSecBuffers(record: ActionRecord, group: Option[Group]) {
- recursivelyUpdate(record, group) {
- (record, group) => getLatencyPerSecBuffers(None, group, Some(record.status)).update(record.executionStartBucket, record.latency)
- }
-
getLatencyPerSecBuffers(Some(record.request), group, Some(record.status)).update(record.executionStartBucket, record.latency)
}
}
View
10 ...g-charts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/RequestsPerSecBuffers.scala
@@ -24,19 +24,17 @@ import com.excilys.ebi.gatling.charts.result.reader.ActionRecord
import com.excilys.ebi.gatling.core.result.Group
import com.excilys.ebi.gatling.core.result.message.RequestStatus
-trait RequestsPerSecBuffers extends Buffers {
+trait RequestsPerSecBuffers {
val requestsPerSecBuffers: mutable.Map[BufferKey, CountBuffer] = new JHashMap[BufferKey, CountBuffer]
def getRequestsPerSecBuffer(requestName: Option[String], group: Option[Group], status: Option[RequestStatus]): CountBuffer = requestsPerSecBuffers.getOrElseUpdate(computeKey(requestName, group, status), new CountBuffer)
def updateRequestsPerSecBuffers(record: ActionRecord, group: Option[Group]) {
- recursivelyUpdate(record, group) { (record, group) =>
- getRequestsPerSecBuffer(None, group, None).update(record.executionStartBucket)
- getRequestsPerSecBuffer(None, group, Some(record.status)).update(record.executionStartBucket)
- }
-
getRequestsPerSecBuffer(Some(record.request), group, None).update(record.executionStartBucket)
getRequestsPerSecBuffer(Some(record.request), group, Some(record.status)).update(record.executionStartBucket)
+
+ getRequestsPerSecBuffer(None, None, None).update(record.executionStartBucket)
+ getRequestsPerSecBuffer(None, None, Some(record.status)).update(record.executionStartBucket)
}
}
View
13 ...arts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/ResponseTimePerSecBuffers.scala
@@ -22,20 +22,19 @@ import scala.collection.mutable
import com.excilys.ebi.gatling.charts.result.reader.ActionRecord
import com.excilys.ebi.gatling.core.result.Group
-import com.excilys.ebi.gatling.core.result.message.RequestStatus
+import com.excilys.ebi.gatling.core.result.message.{ OK, RequestStatus }
-trait ResponseTimePerSecBuffers extends Buffers {
+trait ResponseTimePerSecBuffers {
val responseTimePerSecBuffers: mutable.Map[BufferKey, RangeBuffer] = new JHashMap[BufferKey, RangeBuffer]
def getResponseTimePerSecBuffers(requestName: Option[String], group: Option[Group], status: Option[RequestStatus]): RangeBuffer = responseTimePerSecBuffers.getOrElseUpdate(computeKey(requestName, group, status), new RangeBuffer)
def updateResponseTimePerSecBuffers(record: ActionRecord, group: Option[Group]) {
- recursivelyUpdate(record, group) { (record, group) =>
- getResponseTimePerSecBuffers(None, group, Some(record.status)).update(record.executionStartBucket, record.responseTime)
- }
-
- getResponseTimePerSecBuffers(None, group, Some(record.status)).update(record.executionStartBucket, record.responseTime)
getResponseTimePerSecBuffers(Some(record.request), group, Some(record.status)).update(record.executionStartBucket, record.responseTime)
}
+
+ def updateGroupResponseTimePerSecBuffers(start: Int, duration: Int, group: Group) {
+ getResponseTimePerSecBuffers(None, Some(group), Some(OK)).update(start, duration)
+ }
}
View
22 ...harts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/ResponseTimeRangeBuffers.scala
@@ -22,25 +22,25 @@ import scala.collection.mutable
import com.excilys.ebi.gatling.charts.result.reader.ActionRecord
import com.excilys.ebi.gatling.core.result.Group
-import com.excilys.ebi.gatling.core.result.message.KO
+import com.excilys.ebi.gatling.core.result.message.{ KO, OK, RequestStatus }
-trait ResponseTimeRangeBuffers extends Buffers {
+trait ResponseTimeRangeBuffers {
val responseTimeRangeBuffers: mutable.Map[BufferKey, ResponseTimeRangeBuffer] = new JHashMap[BufferKey, ResponseTimeRangeBuffer]
def getResponseTimeRangeBuffers(requestName: Option[String], group: Option[Group]): ResponseTimeRangeBuffer = responseTimeRangeBuffers.getOrElseUpdate(computeKey(requestName, group, None), new ResponseTimeRangeBuffer)
def updateResponseTimeRangeBuffer(record: ActionRecord, group: Option[Group]) {
- recursivelyUpdate(record, group) {
- (record, group) => getResponseTimeRangeBuffers(None, group).update(record)
- }
+ getResponseTimeRangeBuffers(Some(record.request), group).update(record.responseTime, record.status)
+ getResponseTimeRangeBuffers(None, None).update(record.responseTime, record.status)
+ }
- getResponseTimeRangeBuffers(Some(record.request), group).update(record)
+ def updateGroupResponseTimeRangeBuffer(duration: Int, group: Group) {
+ getResponseTimeRangeBuffers(None, Some(group)).update(duration, OK)
}
class ResponseTimeRangeBuffer {
- import com.excilys.ebi.gatling.core.result.message.RequestStatus
import com.excilys.ebi.gatling.core.config.GatlingConfiguration.configuration
var low = 0
@@ -48,11 +48,11 @@ trait ResponseTimeRangeBuffers extends Buffers {
var high = 0
var ko = 0
- def update(record: ActionRecord) {
+ def update(time: Int, status: RequestStatus) {
- if (record.status == KO) ko += 1
- else if (record.responseTime < configuration.charting.indicators.lowerBound) low += 1
- else if (record.responseTime > configuration.charting.indicators.higherBound) high += 1
+ if (status == KO) ko += 1
+ else if (time < configuration.charting.indicators.lowerBound) low += 1
+ else if (time > configuration.charting.indicators.higherBound) high += 1
else middle += 1
}
}
View
2  ...arts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/SessionDeltaPerSecBuffers.scala
@@ -22,7 +22,7 @@ import scala.collection.mutable
import com.excilys.ebi.gatling.charts.result.reader.ScenarioRecord
-trait SessionDeltaPerSecBuffers extends Buffers {
+trait SessionDeltaPerSecBuffers {
val sessionDeltaPerSecBuffers: mutable.Map[Option[String], SessionDeltaBuffer] = new JHashMap[Option[String], SessionDeltaBuffer]
View
10 ...arts/src/main/scala/com/excilys/ebi/gatling/charts/result/reader/buffers/TransactionsPerSecBuffers.scala
@@ -24,19 +24,17 @@ import com.excilys.ebi.gatling.charts.result.reader.ActionRecord
import com.excilys.ebi.gatling.core.result.Group
import com.excilys.ebi.gatling.core.result.message.RequestStatus
-trait TransactionsPerSecBuffers extends Buffers {
+trait TransactionsPerSecBuffers {
val transactionsPerSecBuffers: mutable.Map[BufferKey, CountBuffer] = new JHashMap[BufferKey, CountBuffer]
def getTransactionsPerSecBuffer(requestName: Option[String], group: Option[Group], status: Option[RequestStatus]): CountBuffer = transactionsPerSecBuffers.getOrElseUpdate(computeKey(requestName, group, status), new CountBuffer)
def updateTransactionsPerSecBuffers(record: ActionRecord, group: Option[Group]) {
- recursivelyUpdate(record, group) { (record, group) =>
- getTransactionsPerSecBuffer(None, group, None).update(record.executionEndBucket)
- getTransactionsPerSecBuffer(None, group, Some(record.status)).update(record.executionEndBucket)
- }
-
getTransactionsPerSecBuffer(Some(record.request), group, None).update(record.executionEndBucket)
getTransactionsPerSecBuffer(Some(record.request), group, Some(record.status)).update(record.executionEndBucket)
+
+ getTransactionsPerSecBuffer(None, None, None).update(record.executionEndBucket)
+ getTransactionsPerSecBuffer(None, None, Some(record.status)).update(record.executionEndBucket)
}
}
View
25 gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/template/GroupDetailsPageTemplate.scala
@@ -0,0 +1,25 @@
+/**
+ * Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.com)
+ *
+ * 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 com.excilys.ebi.gatling.charts.template
+
+import com.excilys.ebi.gatling.charts.component.Component
+import com.excilys.ebi.gatling.core.result.Group
+
+class GroupDetailsPageTemplate(group: Group, rtChartComponent: Component, percentilesChartComponent: Component, statsTextComponent: Component, indicChartComponent: Component)
+ extends PageTemplate(group.path, true, statsTextComponent, indicChartComponent, rtChartComponent, percentilesChartComponent) {
+
+ override def getAttributes = super.getAttributes + ("requestName" -> None, "group" -> Some(group))
+}
View
2  gatling-core/src/main/scala/com/excilys/ebi/gatling/core/result/reader/DataReader.scala
@@ -48,8 +48,6 @@ abstract class DataReader(runUuid: String) {
def generalStats(status: Option[RequestStatus] = None, requestName: Option[String] = None, group: Option[Group] = None): GeneralStats
- def groupStats(group: Option[Group]): Long
-
def numberOfRequestInResponseTimeRange(requestName: Option[String] = None, group: Option[Group] = None): Seq[(String, Int)]
def responseTimeGroupByExecutionStartDate(status: RequestStatus, requestName: Option[String] = None, group: Option[Group] = None): Seq[(Int, (Int, Int))]
Please sign in to comment.
Something went wrong with that request. Please try again.