Skip to content

Instantly share code, notes, and snippets.

View renatoathaydes's full-sized avatar

Renato Athaydes renatoathaydes

View GitHub Profile
{"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
{"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 April 10, 2014 09:08
Creating and configuring a HttpAsyncClient
// 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 )
package com.smartbear.saas.rs.storage;
import com.smartbear.saas.rs.model.TestRun;
import java.util.Optional;
import java.util.Set;
public interface TestRunStorage
{
@renatoathaydes
renatoathaydes / osgiRuntimeAnalyser.groovy
Last active August 29, 2015 13:56
OSGi Runtime Analyser - scans a directory recursively for bundles, finding if all packages are used/provided by the bundles found.
#!/usr/bin/groovy
/**
* OSGi Runtime Analyser
* Scans a directory recursively for bundles, finding if all packages are
* used/provided by the bundles found.
*/
import groovy.io.FileType
import groovy.transform.EqualsAndHashCode
@renatoathaydes
renatoathaydes / ScalaVSCeylon.scala
Last active October 17, 2018 08:29
Scala VS Ceylon
// This is a comparison between Scala and Ceylon based on this previous comparison I made between Haskell and Groovy:
// https://gist.github.com/renatoathaydes/5078535
// Ex 1. If we have two lists, [2,5,10] and [8,10,11] and we want to get the products of all the possible
// combinations between numbers in those lists, here's what we'd do.
/* SCALA */
for { x <- List(2,5,10); y <- List(8,10,11) } yield x*y
@renatoathaydes
renatoathaydes / Bindables.ceylon
Last active December 30, 2015 07:09
Example of binding properties for Ceylon.
"A read-only property."
shared interface Property<out Prop> {
"Gets the value of this property."
shared formal Prop get;
"On change of the value of this property, the given function will be invoked."
shared formal void onChange(Anything(Prop) runOnChange);
}
@renatoathaydes
renatoathaydes / ceylon-generics.ceylon
Created November 28, 2013 21:55
Playing with Ceylon generics.
shared void run() {
object mouseDownBus extends EventBus<MouseDown>() {}
object mouseUpBus extends EventBus<MouseUp>() {}
mouseDownBus.listen(void (MouseDown event) => print("1 - " + event.string));
mouseDownBus.listen(void (MouseDown event) => print("2 - " + event.string));
mouseUpBus.listen(void (MouseUp event) => print("3 - " + event.string));
@renatoathaydes
renatoathaydes / CheckGraphicsDeviceBounds.groovy
Last active December 26, 2015 01:28
Groovy script that prints information about the graphics devices currently in use.
import java.awt.*
def virtualBounds = new Rectangle()
GraphicsEnvironment ge = GraphicsEnvironment.localGraphicsEnvironment
GraphicsDevice[] gs = ge.screenDevices
println Arrays.toString(gs)
gs.each { GraphicsDevice gd ->
GraphicsConfiguration[] gc = gd.configurations
@renatoathaydes
renatoathaydes / ThrownMatcher.java
Last active February 15, 2016 14:01
ThrownMatcher is a Hamcrest matcher that can be used to verify a Throwable of a certain type has been thrown.
package com.athaydes.automaton.internal;
import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.junit.internal.matchers.TypeSafeMatcher;
/**
* User: Renato
*/