Giter Site home page Giter Site logo

3tty0n / gatling-thrift Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 2.0 223 KB

Gatling third party plugin for thrift protocol.

Home Page: https://3tty0n.github.io/gatling-thrift/

License: Apache License 2.0

Scala 98.84% Thrift 1.16%
sbt thrift gatling load-testing thrift-server

gatling-thrift's Introduction

gatling-thrift's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

matsu-chara wqhyy

gatling-thrift's Issues

java.lang.ClassNotFoundException: jdk.internal.misc.Unsafe

java.lang.ClassNotFoundException: jdk.internal.misc.Unsafe
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:288)
	at io.netty.util.internal.PlatformDependent.getSystemClassLoader(PlatformDependent.java:887)
	at io.netty.util.internal.PlatformDependent.isAndroid0(PlatformDependent.java:911)
	at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:70)
	at io.netty.util.ResourceLeakDetector.<init>(ResourceLeakDetector.java:155)
	at io.netty.util.ResourceLeakDetector.<init>(ResourceLeakDetector.java:200)
	at io.netty.util.ResourceLeakDetectorFactory$DefaultResourceLeakDetectorFactory.newResourceLeakDetector(ResourceLeakDetectorFactory.java:201)
	at io.netty.util.HashedWheelTimer.<clinit>(HashedWheelTimer.java:89)
	at com.twitter.finagle.netty4.Netty4HashedWheelTimer.<init>(Netty4HashedWheelTimer.scala:100)
	at com.twitter.finagle.netty4.Netty4HashedWheelTimer$.<init>(Netty4HashedWheelTimer.scala:113)
	at com.twitter.finagle.netty4.Netty4HashedWheelTimer$.<clinit>(Netty4HashedWheelTimer.scala)
	at com.twitter.finagle.Thrift$Client$.<init>(Thrift.scala:215)
	at com.twitter.finagle.Thrift$Client$.<clinit>(Thrift.scala)
	at com.twitter.finagle.Thrift$.<init>(Thrift.scala:341)
	at com.twitter.finagle.Thrift$.<clinit>(Thrift.scala)
	at simulation.ThriftSimulationExample.<init>(ThriftSimulationExample.scala:20)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at io.gatling.app.Gatling$.io$gatling$app$Gatling$$$anonfun$1(Gatling.scala:41)
	at io.gatling.app.Gatling.run(Gatling.scala:92)
	at io.gatling.app.Gatling.runIfNecessary(Gatling.scala:75)
	at io.gatling.app.Gatling.start(Gatling.scala:65)
	at io.gatling.app.Gatling$.start(Gatling.scala:57)
	at io.gatling.app.Gatling$.fromArgs(Gatling.scala:49)
	at io.gatling.thrift.testrunner.GatlingRunner$class.main(GatlingRunner.scala:19)
	at simulation.ThriftSimulationMain$.main(ThriftSimulationExample.scala:15)
	at simulation.ThriftSimulationMain.main(ThriftSimulationExample.scala)

thrift callback was only called once

class ThriftSimulationExample extends ThriftSimulation {
  val client: PingService.FutureIface =
    Thrift.client.newIface[PingService.FutureIface]("localhost:9911")

  private val isDone = new AtomicBoolean(false)

  implicit val callback: Future[String] = {
    if (isDone.compareAndSet(false, true)) {
      Future.value("first")
    } else {
      Future.exception(new RuntimeException("already done"))
    }
  }

  val scn: ScenarioBuilder = scenario("Thrift Scenario").repeat(1) {
    exec(callback)
  }

  setUp(scn.inject(constantUsersPerSec(100) during (1 seconds)))
}

will cause OK=100

================================================================================
---- Global Information --------------------------------------------------------
> request count                                        100 (OK=100    KO=0     )
> min response time                                      0 (OK=0      KO=-     )
> max response time                                      1 (OK=1      KO=-     )
> mean response time                                     0 (OK=0      KO=-     )
> std deviation                                          0 (OK=0      KO=-     )
> response time 50th percentile                          0 (OK=0      KO=-     )
> response time 75th percentile                          0 (OK=0      KO=-     )
> response time 95th percentile                          0 (OK=0      KO=-     )
> response time 99th percentile                          0 (OK=0      KO=-     )
> mean requests/sec                                     50 (OK=50     KO=-     )
---- Response Time Distribution ------------------------------------------------
> t < 800 ms                                           100 (100%)
> 800 ms < t < 1200 ms                                   0 (  0%)
> t > 1200 ms                                            0 (  0%)
> failed                                                 0 (  0%)
================================================================================

Callback should take session parameter

thank you for all the effort on this library!

I would like to use the Session parameter like this:

def deleteImage(session: Session): Future[Boolean] = {
  thriftClient.deleteImage(session("i").as[String])
}

...

val deleteImages = scenario("DeleteImages")
    .feed(images.shuffle.circular)
    .exec(deleteImage)

This is currently not possible because the implicit callback builder looks like this:

implicit def callbackToThriftActionBuilder[A](
      callback: => Future[A]
  ): ThriftActionBuilder[A] = ThriftActionBuilder(callback)

so it does not take a session parameter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.