{"action":"created","issue":{"url":"https://api.github.com/repos/gatling/gatling/issues/3132","repository_url":"https://api.github.com/repos/gatling/gatling","labels_url":"https://api.github.com/repos/gatling/gatling/issues/3132/labels{/name}","comments_url":"https://api.github.com/repos/gatling/gatling/issues/3132/comments","events_url":"https://api.github.com/repos/gatling/gatling/issues/3132/events","html_url":"https://github.com/gatling/gatling/issues/3132","id":175197928,"number":3132,"title":"Metrics are partially sent to InfluxDB if scenario consists of multiple files","user":{"login":"sskorol","id":6638780,"avatar_url":"https://avatars.githubusercontent.com/u/6638780?v=3","gravatar_id":"","url":"https://api.github.com/users/sskorol","html_url":"https://github.com/sskorol","followers_url":"https://api.github.com/users/sskorol/followers","following_url":"https://api.github.com/users/sskorol/following{/other_user}","gists_url":"https://api.github.com/users/sskorol/gists{/gist_id}","starred_url":"https://api.github.com/users/sskorol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sskorol/subscriptions","organizations_url":"https://api.github.com/users/sskorol/orgs","repos_url":"https://api.github.com/users/sskorol/repos","events_url":"https://api.github.com/users/sskorol/events{/privacy}","received_events_url":"https://api.github.com/users/sskorol/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-06T09:13:45Z","updated_at":"2016-09-06T12:05:06Z","closed_at":"2016-09-06T09:57:30Z","body":"Problem: when scenario consists of multiple objects and they're located in separate files, only first object's data is sent to InfluxDB. However, if they composed within a single file, everything works as expected.\r\n\r\nOS: Windows 7 x64\r\nProject type: Maven\r\nJDK: 1.8.0_102\r\nMaven: 3.3.9\r\n\r\npom.xml:\r\n\r\n```xml\r\n    <properties>\r\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r\n        <gatling.version>2.2.2</gatling.version>\r\n        <gatling-plugin.version>2.2.0</gatling-plugin.version>\r\n    </properties>\r\n\r\n    <dependencies>\r\n        <dependency>\r\n            <groupId>io.gatling.highcharts</groupId>\r\n            <artifactId>gatling-charts-highcharts</artifactId>\r\n            <version>${gatling.version}</version>\r\n        </dependency>\r\n        <dependency>\r\n            <groupId>io.gatling</groupId>\r\n            <artifactId>gatling-core</artifactId>\r\n            <version>${gatling.version}</version>\r\n        </dependency>\r\n        <dependency>\r\n            <groupId>io.gatling</groupId>\r\n            <artifactId>gatling-http</artifactId>\r\n            <version>${gatling.version}</version>\r\n        </dependency>\r\n    </dependencies>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>io.gatling</groupId>\r\n                <artifactId>gatling-maven-plugin</artifactId>\r\n                <version>${gatling-plugin.version}</version>\r\n                <configuration>\r\n                    <simulationClass>simulations.AuthSimulation</simulationClass>\r\n                    <configFolder>${project.basedir}/src/test/resources</configFolder>\r\n                    <dataFolder>${project.basedir}/src/test/resources/data</dataFolder>\r\n                    <resultsFolder>${project.basedir}/target/gatling/results</resultsFolder>\r\n                    <bodiesFolder>${project.basedir}/src/test/resources/bodies</bodiesFolder>\r\n                    <simulationsFolder>${project.basedir}/src</simulationsFolder>\r\n                </configuration>\r\n                <executions>\r\n                    <execution>\r\n                        <goals>\r\n                            <goal>test</goal>\r\n                        </goals>\r\n                    </execution>\r\n                </executions>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n```\r\n\r\ngatling.conf:\r\n\r\n```txt\r\n#########################\r\n# Gatling Configuration #\r\n#########################\r\n\r\n# This file contains all the settings configurable for Gatling with their default values\r\n\r\ngatling {\r\n  core {\r\n    #outputDirectoryBaseName = \"\" # The prefix for each simulation result folder (then suffixed by the report generation timestamp)\r\n    #runDescription = \"\"          # The description for this simulation run, displayed in each report\r\n    #encoding = \"utf-8\"           # Encoding to use throughout Gatling for file and string manipulation\r\n    #simulationClass = \"\"         # The FQCN of the simulation to run (when used in conjunction with noReports, the simulation for which assertions will be validated)\r\n    #mute = false                 # When set to true, don't ask for simulation name nor run description (currently only used by Gatling SBT plugin)\r\n\r\n    extract {\r\n      regex {\r\n        #cacheMaxCapacity = 200 # Cache size for the compiled regexes, set to 0 to disable caching\r\n      }\r\n      xpath {\r\n        #cacheMaxCapacity = 200 # Cache size for the compiled XPath queries,  set to 0 to disable caching\r\n      }\r\n      jsonPath {\r\n        #cacheMaxCapacity = 200 # Cache size for the compiled jsonPath queries, set to 0 to disable caching\r\n        #preferJackson = false  # When set to true, prefer Jackson over Boon for JSON-related operations\r\n        jackson {\r\n          #allowComments = false           # Allow comments in JSON files\r\n          #allowUnquotedFieldNames = false # Allow unquoted JSON fields names\r\n          #allowSingleQuotes = false       # Allow single quoted JSON field names\r\n        }\r\n\r\n      }\r\n      css {\r\n        #cacheMaxCapacity = 200 # Cache size for the compiled CSS selectors queries,  set to 0 to disable caching\r\n      }\r\n    }\r\n\r\n    timeOut {\r\n      #simulation = 8640000 # Absolute timeout, in seconds, of a simulation\r\n    }\r\n    directory {\r\n      #data = data               # Folder where user's data (e.g. files used by Feeders) is located\r\n      #bodies = bodies           # Folder where bodies are located\r\n      #simulations = simulations # Folder where the bundle's simulations are located\r\n      #reportsOnly = \"\"                     # If set, name of report folder to look for in order to generate its report\r\n      #binaries = \"\"                        # If set, name of the folder where compiles classes are located: Defaults to GATLING_HOME/target.\r\n      #results = results                    # Name of the folder where all reports folder are located\r\n    }\r\n  }\r\n  charting {\r\n    noReports = true       # When set to true, don't generate HTML reports\r\n    #maxPlotPerSeries = 1000 # Number of points per graph in Gatling reports\r\n    #accuracy = 10           # Accuracy, in milliseconds, of the report's stats\r\n    indicators {\r\n      #lowerBound = 500      # Lower bound for the requests' response time to track in the reports and the console summary\r\n      #higherBound = 1000    # Higher bound for the requests' response time to track in the reports and the console summary\r\n      #percentile1 = 50      # Value for the 1st percentile to track in the reports, the console summary and Graphite\r\n      #percentile2 = 75      # Value for the 2nd percentile to track in the reports, the console summary and Graphite\r\n      #percentile3 = 95      # Value for the 3rd percentile to track in the reports, the console summary and Graphite\r\n      #percentile4 = 99      # Value for the 4th percentile to track in the reports, the console summary and Graphite\r\n    }\r\n  }\r\n  http {\r\n    #elFileBodiesCacheMaxCapacity = 200        # Cache size for request body EL templates, set to 0 to disable\r\n    #rawFileBodiesCacheMaxCapacity = 200       # Cache size for request body Raw templates, set to 0 to disable\r\n    #fetchedCssCacheMaxCapacity = 200          # Cache size for CSS parsed content, set to 0 to disable\r\n    #fetchedHtmlCacheMaxCapacity = 200         # Cache size for HTML parsed content, set to 0 to disable\r\n    #redirectPerUserCacheMaxCapacity = 200     # Per virtual user cache size for permanent redirects, set to 0 to disable\r\n    #expirePerUserCacheMaxCapacity = 200       # Per virtual user cache size for permanent 'Expire' headers, set to 0 to disable\r\n    #lastModifiedPerUserCacheMaxCapacity = 200 # Per virtual user cache size for permanent 'Last-Modified' headers, set to 0 to disable\r\n    #etagPerUserCacheMaxCapacity = 200         # Per virtual user cache size for permanent ETag headers, set to 0 to disable\r\n    #warmUpUrl = \"http://gatling.io\"           # The URL to use to warm-up the HTTP stack (blank means disabled)\r\n    #enableGA = true                           # Very light Google Analytics, please support\r\n    ssl {\r\n      trustStore {\r\n        #type = \"\"      # Type of SSLContext's TrustManagers store\r\n        #file = \"\"      # Location of SSLContext's TrustManagers store\r\n        #password = \"\"  # Password for SSLContext's TrustManagers store\r\n        #algorithm = \"\" # Algorithm used by SSLContext's TrustManagers store\r\n      }\r\n      keyStore {\r\n        #type = \"\"      # Type of SSLContext's KeyManagers store\r\n        #file = \"\"      # Location of SSLContext's KeyManagers store\r\n        #password = \"\"  # Password for SSLContext's KeyManagers store\r\n        #algorithm = \"\" # Algorithm used SSLContext's KeyManagers store\r\n      }\r\n    }\r\n    ahc {\r\n      #allowPoolingConnections = true             # Allow pooling HTTP connections (keep-alive header automatically added)\r\n      #allowPoolingSslConnections = true          # Allow pooling HTTPS connections (keep-alive header automatically added)\r\n      #compressionEnforced = false                # Enforce gzip/deflate when Accept-Encoding header is not defined\r\n      #connectTimeout = 60000                     # Timeout when establishing a connection\r\n      #pooledConnectionIdleTimeout = 60000        # Timeout when a connection stays unused in the pool\r\n      #readTimeout = 60000                        # Timeout when a used connection stays idle\r\n      #connectionTTL = -1                         # Max duration a connection can stay open (-1 means no limit)\r\n      #ioThreadMultiplier = 2                     # Number of Netty worker threads per core\r\n      #maxConnectionsPerHost = -1                 # Max number of connections per host (-1 means no limit)\r\n      #maxConnections = -1                        # Max number of connections (-1 means no limit)\r\n      #maxRetry = 0                               # Number of times that a request should be tried again\r\n      #requestTimeout = 60000                     # Timeout of the requests\r\n      #useProxyProperties = false                 # When set to true, supports standard Proxy System properties\r\n      #webSocketTimeout = 60000                   # Timeout when a used websocket connection stays idle\r\n      #useRelativeURIsWithConnectProxies = true   # When set to true, use relative URIs when talking with an SSL proxy or a WebSocket proxy\r\n      #acceptAnyCertificate = true                # When set to true, doesn't validate SSL certificates\r\n      #httpClientCodecMaxInitialLineLength = 4096 # Maximum length of the initial line of the response (e.g. \"HTTP/1.0 200 OK\")\r\n      #httpClientCodecMaxHeaderSize = 8192        # Maximum size, in bytes, of each request's headers\r\n      #httpClientCodecMaxChunkSize = 8192         # Maximum length of the content or each chunk\r\n      #keepEncodingHeader = true                  # Don't drop Encoding response header after decoding\r\n      #webSocketMaxFrameSize = 10240              # Maximum frame payload size\r\n      #httpsEnabledProtocols = []                 # Array of separated enabled protocols for HTTPS, if empty use the JDK defaults\r\n      #httpsEnabledCipherSuites = []              # Array of separated enabled cipher suites for HTTPS, if empty  use the JDK defaults\r\n    }\r\n  }\r\n  data {\r\n    writers = [console, file, graphite] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite, jdbc)\r\n    #reader = file             # The DataReader used by the charting engine for reading simulation results\r\n    console {\r\n      #light = false           # When set to true, displays a light version without detailed request stats\r\n    }\r\n    file {\r\n      #bufferSize = 8192       # FileDataWriter's internal data buffer size, in bytes\r\n    }\r\n    leak {\r\n      #noActivityTimeout = 30  # Period, in seconds, for which Gatling may have no activity before considering a leak may be happening\r\n    }\r\n    jdbc {\r\n      db {\r\n        #url = \"jdbc:mysql://localhost:3306/temp\" # The JDBC URL used by the JDBC DataWriter\r\n        #username = \"root\"                        # The database user used by the JDBC DataWriter\r\n        #password = \"123123q\"                     # The password for the specified user\r\n      }\r\n      #bufferSize = 20                            # The size for each batch of SQL inserts to send to the database\r\n      create {\r\n        #createRunRecordTable = \"CREATE TABLE IF NOT EXISTS `RunRecords` ( `id` INT NOT NULL AUTO_INCREMENT , `runDate` DATETIME NULL , `simulationId` VARCHAR(45) NULL , `runDescription` VARCHAR(45) NULL , PRIMARY KEY (`id`) )\"\r\n        #createRequestRecordTable = \"CREATE TABLE IF NOT EXISTS `RequestRecords` (`id` int(11) NOT NULL AUTO_INCREMENT, `runId` int DEFAULT NULL, `scenario` varchar(45) DEFAULT NULL, `userId` VARCHAR(20) NULL, `name` varchar(50) DEFAULT NULL, `requestStartDate` bigint DEFAULT NULL, `requestEndDate` bigint DEFAULT NULL, `responseStartDate` bigint DEFAULT NULL, `responseEndDate` bigint DEFAULT NULL, `status` varchar(2) DEFAULT NULL, `message` varchar(4500) DEFAULT NULL, `responseTime` bigint DEFAULT NULL, PRIMARY KEY (`id`) )\"\r\n        #createScenarioRecordTable = \"CREATE TABLE IF NOT EXISTS `ScenarioRecords` (`id` int(11) NOT NULL AUTO_INCREMENT, `runId` int DEFAULT NULL, `scenarioName` varchar(45) DEFAULT NULL, `userId` VARCHAR(20) NULL, `event` varchar(50) DEFAULT NULL, `startDate` bigint DEFAULT NULL, `endDate` bigint DEFAULT NULL, PRIMARY KEY (`id`) )\"\r\n        #createGroupRecordTable = \"CREATE TABLE IF NOT EXISTS `GroupRecords` (`id` int(11) NOT NULL AUTO_INCREMENT, `runId` int DEFAULT NULL, `scenarioName` varchar(45) DEFAULT NULL, `userId` VARCHAR(20) NULL, `entryDate` bigint DEFAULT NULL, `exitDate` bigint DEFAULT NULL, `status` varchar(2) DEFAULT NULL, PRIMARY KEY (`id`) )\"\r\n      }\r\n      insert {\r\n        #insertRunRecord = \"INSERT INTO RunRecords (runDate, simulationId, runDescription) VALUES (?,?,?)\"\r\n        #insertRequestRecord = \"INSERT INTO RequestRecords (runId, scenario, userId, name, requestStartDate, requestEndDate, responseStartDate, responseEndDate, status, message, responseTime) VALUES (?,?,?,?,?,?,?,?,?,?,?)\"\r\n        #insertScenarioRecord = \"INSERT INTO ScenarioRecords (runId, scenarioName, userId, event, startDate, endDate) VALUES (?,?,?,?,?,?)\"\r\n        #insertGroupRecord = \"INSERT INTO GroupRecords (runId, scenarioName, userId, entryDate, exitDate, status) VALUES (?,?,?,?,?,?)\"\r\n      }\r\n    }\r\n    graphite {\r\n      #light = false              # only send the all* stats\r\n      host = \"localhost\"         # The host where the Carbon server is located\r\n      port = 2003                # The port to which the Carbon server listens to\r\n      protocol = \"tcp\"           # The protocol used to send data to Carbon (currently supported : \"tcp\", \"udp\")\r\n      rootPathPrefix = \"gatling\" # The common prefix of all metrics sent to Graphite\r\n      #bufferSize = 8192          # GraphiteDataWriter's internal data buffer size, in bytes\r\n      #writeInterval = 1          # GraphiteDataWriter's write interval, in seconds\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nProject structure:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/6638780/18267540/308d078e-7428-11e6-975e-78690f14278c.png)\r\n\r\nAuthorization.scala:\r\n\r\n```scala\r\nobject Authorization {\r\n\r\n  val login = exec(http(\"Load main URL\")\r\n    .get(\"/ui\"))\r\n    .exec(http(\"Get user\")\r\n      .get(EndPoint.User)\r\n      .check(status.is(401)))\r\n    .exec(http(\"Handshake\")\r\n      .get(EndPoint.Handshake)\r\n      .check(header(CSRF).saveAs(\"csrf\")))\r\n    .feed(UsersFeeder)\r\n    // ...\r\n```\r\n\r\nPayments.scala:\r\n\r\n```scala\r\nobject Payments {\r\n  val createNew = exec(http(\"Get profiles\")\r\n    .post(EndPoint.Execute)\r\n    .header(CSRF, \"${csrf}\")\r\n    .body(RequestBody.Profiles).asJSON)\r\n    .exec(http(\"Get payment dates\")\r\n      .get(EndPoint.GetPaymentDates)\r\n      .header(CSRF, \"${csrf}\")\r\n      .check(regex(\"\\\"minProcessingDate\\\" : \\\"(.*)T\").saveAs(\"minDate\")))\r\n    .feed(ProfilesFeeder)\r\n    // ...\r\n```\r\n\r\nAuthSimulation.scala:\r\n\r\n```scala\r\nclass AuthSimulation extends Simulation {\r\n\r\n  val httpProtocol = http\r\n    .baseURL(BaseURL)\r\n    .inferHtmlResources(DefaultBlackList, DefaultWhiteList)\r\n    .acceptHeader(AcceptableHeader)\r\n    .acceptEncodingHeader(AcceptableEncodingHeader)\r\n    .acceptLanguageHeader(AcceptableLanguageHeader)\r\n    .userAgentHeader(AgentHeader)\r\n    .disableCaching\r\n    .contentTypeHeader(TypeHeader)\r\n    .headers(DefaultHeaders)\r\n\r\n  val companyUsers = scenario(\"Company Users Authorization\")\r\n    .exec(Authorization.login, Payments.createNew)\r\n\r\n  setUp(companyUsers.inject(atOnceUsers(1)))\r\n    .protocols(httpProtocol)\r\n    .assertions(global.responseTime.max.lessThan(MaxResponseTime))\r\n}\r\n```\r\n\r\nWhen I run this via `mvn gatling:test` I see a debug log for metrics from `Authorization.scala`:\r\n\r\n```txt\r\n11:32:29.555 [DEBUG] i.g.m.m.GraphiteMetrics$ - GraphiteMetrics=gatling.authsimulation.users.allUsers.active 1 1473150749\r\ngatling.authsimulation.users.allUsers.waiting 0 1473150749\r\ngatling.authsimulation.users.allUsers.done 0 1473150749\r\ngatling.authsimulation.users.Company_Users_Authorization.active 1 1473150749\r\ngatling.authsimulation.users.Company_Users_Authorization.waiting 0 1473150749\r\ngatling.authsimulation.users.Company_Users_Authorization.done 0 1473150749\r\ngatling.authsimulation.Get_banner_messages.ok.count 0 1473150749\r\ngatling.authsimulation.Get_banner_messages.ko.count 0 1473150749\r\n// ...\r\n```\r\n\r\nBut nothing related to `Payments.scala`. And there're no DB metrics tracked for this object.\r\nHowever, if I put the following into `Authorization.scala`:\r\n\r\n```scala\r\nval createNew = exec(http(\"Get profiles\")\r\n    .post(EndPoint.Execute)\r\n    // ...\r\n```\r\nand then make corresponding changes in scenario:\r\n\r\n```scala\r\n  val companyUsers = scenario(\"Company Users Authorization\")\r\n    .exec(Authorization.login, Authorization.createNew)\r\n```\r\n\r\nall metrics appear in DB and debug log.\r\n\r\nIn [official docs ](http://gatling.io/docs/2.2.2/advanced_tutorial.html) there's a note that we can use dedicated files for scenario definition. And it actually works in terms of requests execution. But it doesn't send any data (except first listed object) into InfluxDB."},"comment":{"url":"https://api.github.com/repos/gatling/gatling/issues/comments/244929811","html_url":"https://github.com/gatling/gatling/issues/3132#issuecomment-244929811","issue_url":"https://api.github.com/repos/gatling/gatling/issues/3132","id":244929811,"user":{"login":"sskorol","id":6638780,"avatar_url":"https://avatars.githubusercontent.com/u/6638780?v=3","gravatar_id":"","url":"https://api.github.com/users/sskorol","html_url":"https://github.com/sskorol","followers_url":"https://api.github.com/users/sskorol/followers","following_url":"https://api.github.com/users/sskorol/following{/other_user}","gists_url":"https://api.github.com/users/sskorol/gists{/gist_id}","starred_url":"https://api.github.com/users/sskorol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sskorol/subscriptions","organizations_url":"https://api.github.com/users/sskorol/orgs","repos_url":"https://api.github.com/users/sskorol/repos","events_url":"https://api.github.com/users/sskorol/events{/privacy}","received_events_url":"https://api.github.com/users/sskorol/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T12:05:06Z","updated_at":"2016-09-06T12:05:06Z","body":"@slandelle could you please clarify this one:\r\n```\r\nbecause you forgot a dot to attach parts of the chain\r\n```\r\nwhere exactly dot is missing?"}}
{"actor":{"display_login":"sskorol"}}