Skip to content

Instantly share code, notes, and snippets.

Avatar

Renato Athaydes renatoathaydes

View GitHub Profile
@renatoathaydes
renatoathaydes / updateAll.groovy
Last active Aug 29, 2015
Update all Saas projects
View updateAll.groovy
//#!/usr/bin/env groovy
// Change this to your projects home
home = "D:/Programming/Projects"
// Change this to where your Maven installation is located
mvn = "C:/Program Files (x86)/Maven/apache-maven-3.0.4"
if ('help' in args || 'h' in args) {
println """
View union-final-tabular-data.json
{
"results": [
{
"max": 1245,
"min": 1245,
"count": 3352,
"variable": "responseSize",
"resource": "http://win-srvmontest.sthlm.smartbear.local/welcome.png",
"average": 0
},
View union-live-data-format.json
{
"results": [
{
"resource": "http://win-srvmontest.sthlm.smartbear.local/welcome.png",
"minLatency": 1,
"maxLatency": 2,
"averageLatency": 1,
"percentile90thLatency": 2,
"minTimeElapsed": 1,
"maxTimeElapsed": 9,
@renatoathaydes
renatoathaydes / treeMapPrinter.ceylon
Last active Aug 29, 2015
Prints a TreeMap in an easy-to-see what's going on way. This code must be pasted inside TreeMap code.
View treeMapPrinter.ceylon
void traverse(Integer level, Node node, MutableMap<Integer, MutableList<Node>> nodes) {
value list = nodes[level] else ArrayList<Node>();
nodes.put(level, list);
list.add(node);
if (exists l = node.left) {
print("Left of ``node.key`` is ``l.key``");
traverse(level + 1, l, nodes);
}
if (exists r = node.right) {
View tabular-live-data.json
// no assets
{
"results": [
{
"sent": ${sent},
"averageTimeElapsed": ${avgTe},
"minTimeElapsed": ${minTe},
"maxTimeElapsed": ${maxTe},
"averageLatency": ${avgLatency},
View loadui-new-stats-with-assets.json
{"timestamp":1398694754046,"source":"main","variable":"sent","total":0,"perSecond":0}
{"timestamp":1398694754049,"resource":"http://win-srvmontest.sthlm.smartbear.local","source":"main","variable":"sent","total":0,"perSecond":0}
{"timestamp":1398694754477,"resource":"http://win-srvmontest.sthlm.smartbear.local/welcome.png","source":"main","variable":"sent","total":0,"perSecond":0}
{"timestamp":1398694754494,"source":"main","variable":"timeElapsed","count":1,"average":445,"min":445,"max":445,"percentile90th":445}
{"timestamp":1398694754504,"source":"main","variable":"responseSize","count":1,"average":0,"min":0,"max":0,"percentile90th":0}
{"timestamp":1398694755047,"resource":"http://win-srvmontest.sthlm.smartbear.local","source":"main","variable":"timeElapsed","count":2,"average":42,"min":5,"max":80,"percentile90th":72}
{"timestamp":1398694755055,"resource":"http://win-srvmontest.sthlm.smartbear.local","source":"main","variable":"responseSize","count":2,"average":689,"min":689,"max":689,"percentile90th":689}
{
View loadui-new-stats.json
{"timestamp":1398344097050,"source":"main","totalCount":0,"totalSent":0}
{"timestamp":1398344097857,"source":"main","totalCount":5,"averageLatency":48,"percentile90th":126}
{"timestamp":1398344097878,"source":"main","totalCount":5,"averageTimeElapsed":53,"maxTimeElapsed":203,"minTimeElapsed":10,"percentile90th":134}
{"timestamp":1398344097896,"source":"main","totalCount":5,"averageResponseSize":0,"percentile90th":0,"minResponseSize":0,"maxResponseSize":0}
{"timestamp":1398344098050,"source":"main","totalCount":6,"totalSent":6}
{"timestamp":1398344099057,"source":"main","totalCount":6,"averageLatency":11,"percentile90th":12}
{"timestamp":1398344099078,"source":"main","totalCount":6,"averageTimeElapsed":14,"maxTimeElapsed":31,"minTimeElapsed":9,"percentile90th":21}
{"timestamp":1398344099089,"source":"main","totalCount":6,"averageResponseSize":0,"percentile90th":0,"minResponseSize":0,"maxResponseSize":0}
{"timestamp":1398344099050,"source":"main","totalCount":11,"totalSent":5}
{"timestamp":1398344100063,"source
View loadui-old-stats.json
{"pages":{"main":{"timestamp":1397482045548,"total_count":0,"total_sent":0}}}
{"pages":{"main":{"timestamp":1397482046356,"total_count":5,"total_latency":434}}}
{"pages":{"main":{"timestamp":1397482046376,"total_count":5,"total_time_elapsed":460,"max_response_time":382,"min_response_time":11}}}
{"pages":{"main":{"timestamp":1397482046390,"total_count":5,"total_response_size":0}}}
{"pages":{"main":{"timestamp":1397482046548,"total_count":6,"total_sent":6}}}
{"pages":{"main":{"timestamp":1397482047554,"total_count":6,"total_latency":62}}}
{"pages":{"main":{"timestamp":1397482047571,"total_count":6,"total_time_elapsed":78,"max_response_time":26,"min_response_time":9}}}
{"pages":{"main":{"timestamp":1397482047587,"total_count":6,"total_response_size":0}}}
{"pages":{"main":{"timestamp":1397482047548,"total_count":11,"total_sent":5}}}
{"pages":{"main":{"timestamp":1397482048559,"total_count":5,"total_latency":55}}}
@renatoathaydes
renatoathaydes / HttpAsyncClientCreator.java
Created Apr 10, 2014
Creating and configuring a HttpAsyncClient
View HttpAsyncClientCreator.java
// more config options at http://hc.apache.org/httpcomponents-asyncclient-4.0.x/httpasyncclient/examples/org/apache/http/examples/nio/client/AsyncClientConfiguration.java
public RequestRunner provideRequestRunner( ComponentContext context, URI pageUri, Iterable<URI> assetUris )
throws IOException
{
try
{
IOReactorConfig ioReactorConfig = IOReactorConfig.custom()
.setIoThreadCount( Runtime.getRuntime().availableProcessors() )
.setConnectTimeout( 30_000 )
View TestRunStorage.java
package com.smartbear.saas.rs.storage;
import com.smartbear.saas.rs.model.TestRun;
import java.util.Optional;
import java.util.Set;
public interface TestRunStorage
{