This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* stress test a JUnit test | |
given your test body: | |
feature(a) { | |
} | |
... | |
feature(c) { | |
} | |
wrap it: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoggingScheduledThreadPoolExecutor(nthreads: Int) | |
extends ScheduledThreadPoolExecutor(nthreads) { | |
private val log = Logger(LoggerFactory.getLogger(classOf[LoggingScheduledThreadPoolExecutor])) | |
override def submit[T](task: Runnable, result: T): java.util.concurrent.Future[T] = { | |
val queueTime = System.nanoTime() | |
log debug s"Submit task $task" | |
super.submit(new Runnable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoggingScheduledThreadPoolExecutor(nthreads: Int) | |
extends ScheduledThreadPoolExecutor(nthreads) { | |
private val log = Logger(LoggerFactory.getLogger(classOf[LoggingScheduledThreadPoolExecutor])) | |
class CustomTask[T](runnable: AnyRef, task: RunnableScheduledFuture[T]) | |
extends RunnableScheduledFuture[T] { | |
val creationTime = System.nanoTime() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package adriansr.test | |
import scala.util.control.NonFatal | |
import akka.actor.{Actor, ActorRef, ActorSystem, InvalidActorNameException, Props} | |
case class Test(name: String, retries: Int, delay: Long) | |
case class Create(iter: Long, cfg: Test) | |
case class Remove(iter: Long, actor: ActorRef, cfg: Test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
# Writes the body of a REST resource | |
# input is a list of <type> <name> variables, one per line: | |
# i.e: | |
# String nwDstAddress | |
# int nwDstLength | |
# UUID[] inPorts | |
# [...] | |
# helloWorld => HELLO_WORLD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
#include <stdlib.h> | |
#include <sys/xattr.h> | |
*/ | |
import "C" | |
import ( | |
"fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +build windows | |
package main | |
import ( | |
"encoding/binary" | |
"encoding/hex" | |
"fmt" | |
"syscall" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
die() { | |
echo "error: $@" >&2 | |
exit 1 | |
} | |
test "$#" -gt 0 || die "Usage: $0 <package identifier>" | |
test "$(uname -s)" = "Darwin" || die "Must be run under macOS" | |
test $(id -u) -eq 0 || die "Must be root" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
set -e | |
SIZES=" | |
16,16x16 | |
32,16x16@2x | |
32,32x32 | |
64,32x32@2x | |
128,128x128 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"sync/atomic" | |
"fmt" | |
"os" | |
"strconv" | |
"syscall" | |
"time" | |
) |
OlderNewer