Skip to content

Instantly share code, notes, and snippets.

Java 8

Default
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       22   51  12.8     53     307
Processing:     0    6   6.8      2      91
Waiting:        0    6   6.6      1      89
Total:         22   58  10.7     56     308

Keybase proof

I hereby claim:

  • I am rpless on github.
  • I am rpless (https://keybase.io/rpless) on keybase.
  • I have a public key ASAbOBBLCAlBpt1lqmx4GO1OQsQECyhysgShS2oUTnALsQo

To claim this, I am signing this object:

@rpless
rpless / stacktrace.txt
Created April 18, 2019 19:36
Druid Router node stack trace
2019-04-18_19:32:02.94131 /druid/v2/sql
2019-04-18_19:32:02.94134 java.lang.NullPointerException
2019-04-18_19:32:02.94135 at org.apache.druid.server.router.TieredBrokerHostSelector.getDefaultLookup(TieredBrokerHostSelector.java:263) ~[druid-server-0.14.0-incubating.jar:0.14.0-incubating]
2019-04-18_19:32:02.94135 at org.apache.druid.server.router.QueryHostFinder.findDefaultServer(QueryHostFinder.java:63) ~[druid-server-0.14.0-incubating.jar:0.14.0-incubating]
2019-04-18_19:32:02.94135 at org.apache.druid.server.router.QueryHostFinder.pickDefaultServer(QueryHostFinder.java:112) ~[druid-server-0.14.0-incubating.jar:0.14.0-incubating]
2019-04-18_19:32:02.94136 at org.apache.druid.server.AsyncQueryForwardingServlet.service(AsyncQueryForwardingServlet.java:272) ~[druid-server-0.14.0-incubating.jar:0.14.0-incubating]
2019-04-18_19:32:02.94136 at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0]
2019-04-18_19:32:02.94136 at org.eclipse.jetty.servlet.ServletHolde
@rpless
rpless / README.md
Last active December 28, 2018 19:58
An example of a web server that uses HAWK authentication with Payload Validation.

An example webserver that uses HAWK authentication with Payload validation. The Auth Key is key and the Auth Id is user.

@rpless
rpless / Main.scala
Last active July 25, 2018 21:48
Finch+Circe Error Accumulation Reporting
import com.twitter.finagle.Http
import com.twitter.util.{Await, Future}
import io.finch._
import io.finch.syntax._
import io.finch.circe.accumulating._
import io.circe._
import io.circe.generic.auto._
case class RequestBody(foo: Boolean, bar: Int)
case class FakeResponse()
@rpless
rpless / kleisli-serialized
Last active December 19, 2021 19:10
Serializing a Circe JsonObject
��sr+io.circe.JsonObject$LinkedHashMapJsonObjectOd�d��L3io$circe$JsonObject$LinkedHashMapJsonObject$$fieldstLjava/util/LinkedHashMap;xrio.circe.JsonObject�G� �&LkleislitLcats/data/Kleisli;xpsrcats.data.KleisliQ���3�LruntLscala/Function1;xpsr!java.lang.invoke.SerializedLambdaoaД,)6�
IimplMethodKind[ capturedArgst[Ljava/lang/Object;LcapturingClasstLjava/lang/Class;LfunctionalInterfaceClasstLjava/lang/String;LfunctionalInterfaceMethodNameq~ L"functionalInterfaceMethodSignatureq~ L implClassq~ LimplMethodNameq~ LimplMethodSignatureq~ LinstantiatedMethodTypeq~ xpur[Ljava.lang.Object;��X�s)lxpq~vq~tscala/Function1tapplyt&(Ljava/lang/Object;)Ljava/lang/Object;tio/circe/JsonObjectt$anonfun$kleisli$1t7(Lio/circe/JsonObject;Ljava/lang/String;)Lscala/Option;t"(Ljava/lang/String;)Lscala/Option;srjava.util.LinkedHashMap4�N\l��Z accessOrderxrjava.util.HashMap���`�F
loadFactorI thresholdxp?@ wtfoosrio.circe.Json$JString"¹�R2(Lvalueq~ xr
io.circe.Json��c�B�Mxptbarx
@rpless
rpless / stacktrace.txt
Created November 6, 2017 23:45
Finch #860 stack trace
WARNING: Exception propagated to the default monitor (upstream address: /0:0:0:0:0:0:0:1:65181, downstream address: n/a, label: ).
org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder$ErrorDataDecoderException: java.io.IOException: File name too long
at org.jboss.netty.handler.codec.http.multipart.HttpPostStandardRequestDecoder.parseBodyAttributes(HttpPostStandardRequestDecoder.java:497)
at org.jboss.netty.handler.codec.http.multipart.HttpPostStandardRequestDecoder.parseBody(HttpPostStandardRequestDecoder.java:225)
at org.jboss.netty.handler.codec.http.multipart.HttpPostStandardRequestDecoder.<init>(HttpPostStandardRequestDecoder.java:143)
at org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.<init>(HttpPostRequestDecoder.java:82)
at org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.<init>(HttpPostRequestDecoder.java:56)
at com.twitter.finagle.http.exp.Multipart$.decodeNonChunked(Multipart.scala:95)
at com.twitter.finagle.http.Request._multipart$lzycomp
@rpless
rpless / Main.scala
Created February 18, 2017 01:21
Reproduction of Netty 4 Decode issue in Finch 0.13.0
import com.twitter.finagle.Http
import com.twitter.util.Await
import io.finch._
import io.finch.circe._
import io.circe.generic.auto._
case class Foo(a: String)
case class Bar(as: List[Int])
@rpless
rpless / wrk-results.md
Created November 19, 2016 13:43
wrk output for Removing the string conversions from the Circe decoder

Finch + Circe: Current

$ wrk -t4 -c24 -d30s -s examples/src/main/scala/io/finch/wrk/wrk.lua http://localhost:8081/
Running 30s test @ http://localhost:8081/
  4 threads and 24 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.53ms   19.77ms 378.12ms   98.27%
    Req/Sec    13.68k     4.94k   29.80k    70.29%
  1619290 requests in 30.06s, 152.88MB read
Requests/sec: 53862.90
@rpless
rpless / sse.scala
Created November 3, 2016 11:22
An example of using sse in Finch on my WIP branch
package io.finch.sse
import java.nio.charset.Charset
import cats.Show
import com.twitter.concurrent.AsyncStream
import com.twitter.conversions.time._
import com.twitter.finagle.Http
import com.twitter.finagle.http.Response
import com.twitter.io.Buf