Hi there,Just to let you know that I've pushed checksum checks support in master code, with md5 and sha1 built-ins:I need to perform further tests, but this should be out in 1.2.2 to be released by the end of the week.Cheers,
Stephane2012/6/8 Stéphane LandelleHi,
We hadn't thought of this use case, so no, it's not doable with the current API.AsyncHttpClient AsyncHandler provides a callback where you can get a byte array of a chunk every time one arrives, so that's probably something that would suit your needs.If your not in a very hurry and can wait for a next version, we can give it a thought.Cheers,
Stephane2012/6/8 Aris Green
I am new to scala and gatling. I have gone over the examples and some introduction to scala. I am trying to determine of gatling could be used for testing involving large file downloads. The current tests we have hash files (~50 to 200 MiB) as they are downloaded. The file is not saved, but the hash is validated. This will not work if the http request in the gatling test buffers the entire response before the user can access it. We need to access the response in chunks using a stream.
http("Downloading filel").get("http://my-host/my-path").check(md5.is("0xA59E79AB53EEF2883D72B8F8398C9AC3"))
val javaMemoryFlags = List("-Xmx12g")
javaOptions in GatlingKeys.Gatling := GatlingKeys.overrideDefaultJavaOptions(javaMemoryFlags:_*),
Below is the call. As the part of the test i need to download the file to disk but it is not able to download more than 500mb file. Please can you suggest me . I am able to upload hugh files
def downloadFile(): HttpRequestBuilder = {
http("Download file")
.get(s"$baseUrl/sdes/download/${fileToDownload}")
.check(status.is(200), status.not(500))
.extraInfoExtractor { extraInfo => List(getExtraInfo(extraInfo)) }
}def getExtraInfo(extraInfo: ExtraInfo): Unit = {
println("************** Printing Response metrics for the file download*******************************************")
println("Request URL:" + extraInfo.request.getUrl)
println("HAS RESPONSE Body------>:" + extraInfo.response.hasResponseBody)
println(" RESPONSE Body length----->:" + extraInfo.response.bodyLength)
println(" RESPONSE Body isreceived----->:" + extraInfo.response.isReceived)
println(" File downloaded in seconds ----->:" + (extraInfo.response.responseTimeInMillis) / 1000)
println(" Response status code----->:" + extraInfo.response.statusCode)
val downloadFileResponse: String = extraInfo.response.body.string
val timestamp = new java.text.SimpleDateFormat("MM_dd_yyyy_h:mm:ss").format(new Date());
val newDownloadFileName = s"${timestamp}_${fileToDownload}"
println("New file name is --->" + newDownloadFileName)
writeToFile(downloadFileResponse, s"/tmp/download/${timestamp}_${fileToDownload}")
}
def writeToFile(response: String, filePath: String) = {
var writer = null
try {
var writer: BufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filePath)))
writer.write(response)
writer.close()
} catch {
case e: IOException =>
}
}
}
ava.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid4863.hprof ...