Skip to content

Instantly share code, notes, and snippets.

Value Percentile TotalCount 1/(1-Percentile)
0.000 0.000000000000 1189750 1.00
0.000 0.100000000000 1189750 1.11
0.000 0.200000000000 1189750 1.25
0.000 0.300000000000 1189750 1.43
0.000 0.400000000000 1189750 1.67
0.000 0.500000000000 1189750 2.00
0.000 0.550000000000 1189750 2.22
0.000 0.600000000000 1189750 2.50
import cats.effect._
import fs2._
import org.http4s._
import org.http4s.blaze.server.BlazeServerBuilder
import org.http4s.dsl.Http4sDsl
import org.http4s.implicits._
import org.http4s.server.websocket.WebSocketBuilder2
import org.http4s.websocket.WebSocketFrame
import scala.concurrent.duration._
@kamilkloch
kamilkloch / gist:54da5d5f55798b68d5b093f867ab710c
Created July 13, 2023 09:06
HDRHistogram latency - ember, CE 3.6, fs2 3.8
0.000 0.000000000000 1149923 1.00
0.000 0.100000000000 1149923 1.11
0.000 0.200000000000 1149923 1.25
0.000 0.300000000000 1149923 1.43
0.000 0.400000000000 1149923 1.67
0.000 0.500000000000 1149923 2.00
0.000 0.550000000000 1149923 2.22
0.000 0.600000000000 1149923 2.50
0.000 0.650000000000 1149923 2.86
0.000 0.700000000000 1149923 3.33
@kamilkloch
kamilkloch / gist:7dd03b4007043a9a2170d53189930f35
Created July 13, 2023 08:39
HDRHistogram latency - zio-http
0.000 0.000000000000 1199930 1.00
0.000 0.100000000000 1199930 1.11
0.000 0.200000000000 1199930 1.25
0.000 0.300000000000 1199930 1.43
0.000 0.400000000000 1199930 1.67
0.000 0.500000000000 1199930 2.00
0.000 0.550000000000 1199930 2.22
0.000 0.600000000000 1199930 2.50
0.000 0.650000000000 1199930 2.86
0.000 0.700000000000 1199930 3.33
@kamilkloch
kamilkloch / gist:59beca49f1a478c9a533544446e2d480
Created July 12, 2023 12:00
HDRHistogram latency - ember
2.000 0.000000000000 674780 1.00
2.000 0.100000000000 674780 1.11
2.000 0.200000000000 674780 1.25
2.000 0.300000000000 674780 1.43
2.000 0.400000000000 674780 1.67
2.000 0.500000000000 674780 2.00
2.000 0.550000000000 674780 2.22
3.000 0.600000000000 1148916 2.50
3.000 0.650000000000 1148916 2.86
3.000 0.700000000000 1148916 3.33
@kamilkloch
kamilkloch / gist:058a8ce8f59e5ecee71085670b49577d
Created July 12, 2023 11:58
HDRHistogram latency - Blaze
0.000 0.000000000000 1199614 1.00
0.000 0.100000000000 1199614 1.11
0.000 0.200000000000 1199614 1.25
0.000 0.300000000000 1199614 1.43
0.000 0.400000000000 1199614 1.67
0.000 0.500000000000 1199614 2.00
0.000 0.550000000000 1199614 2.22
0.000 0.600000000000 1199614 2.50
0.000 0.650000000000 1199614 2.86
0.000 0.700000000000 1199614 3.33
@kamilkloch
kamilkloch / TapirWebSocketServer.scala
Created July 12, 2023 11:52
http4s blaze vs ember websocket server
import cats.effect.{IO, IOApp}
import fs2.Stream
import org.http4s.blaze.server.BlazeServerBuilder
import org.http4s.ember.server.EmberServerBuilder
import org.http4s.server.Router
import sttp.capabilities.fs2.Fs2Streams
import sttp.tapir._
import com.comcast.ip4s._
import sttp.tapir.server.http4s.Http4sServerInterpreter
[2022-03-03 16:37:09,171] INFO [io-compute-1] c.s.r.AsyncTests:24 - internalLegacyAPI begin
[2022-03-03 16:37:09,368] INFO [io-compute-2] c.s.r.AsyncTests:45 - cancelEff: finished
[2022-03-03 16:37:09,379] INFO [io-compute-2] c.s.r.AsyncTests:51 - nestedAsync: onAsyncCancel
[2022-03-03 16:37:09,380] INFO [io-compute-2] c.s.r.AsyncTests:32 - AutoCloseable.close()
[2022-03-03 16:37:09,796] INFO [scala-execution-context-global-25] c.s.r.AsyncTests:27 - internalLegacyAPI end
[2022-03-03 16:37:11,382] INFO [io-compute-4] c.s.r.AsyncTests:59 - ******************************
[2022-03-03 16:37:11,386] INFO [io-compute-6] c.s.r.AsyncTests:15 - legacyAPI begin
[2022-03-03 16:37:11,387] INFO [io-compute-6] c.s.r.AsyncTests:24 - internalLegacyAPI begin
[2022-03-03 16:37:11,584] INFO [io-compute-7] c.s.r.AsyncTests:45 - cancelEff: finished
[2022-03-03 16:37:11,887] INFO [scala-execution-context-global-25] c.s.r.AsyncTests:18 - legacyAPI end
import cats.effect.std.{Dispatcher, Queue}
import cats.effect.{IO, IOApp}
import com.typesafe.scalalogging.Logger
import fs2.{Pipe, Stream}
import java.util.concurrent.atomic.AtomicInteger
import scala.collection.mutable
import scala.concurrent.duration.DurationInt
object Subscriptions {
import cats.effect.{IO, IOApp}
import com.typesafe.scalalogging.Logger
import fs2.Stream
import org.http4s.blaze.server.BlazeServerBuilder
import org.http4s.server.Router
import sttp.capabilities.fs2.Fs2Streams
import sttp.client3._
import sttp.client3.asynchttpclient.fs2.AsyncHttpClientFs2Backend
import sttp.tapir._
import sttp.tapir.client.sttp.SttpClientInterpreter