Notification on Create Users

Hi,

I’ve created a test and it is running and giving me metrics perfectly, but the thing is that my boss wants to track the test and see what’s happening in real time.
He basically wants to see when a user is created by gatling. I’ve downloaded the code to see if there’s some kind of notification feature but I didn’t find anything.
Do you know if there’s some way to achieve what I need to do?
And about the code, the developing section of the wiki is outdated right? because I didn’t find any pom.xml in the master of the project.

Thank you very much.

Augusto

Best would be to use Graphite, Gatling can exports some metrics live in there.

Cheers
Nicolas

I've just seen a topic here about it...
Searching about :slight_smile:

thank you

Let me ask you something:
Is the create section in graphite the create users I want?
I’ve seen there’s a DataWriter in the code… Is it possible and is there any doc to write a new one?

Thanks,

Augusto

I’ve tried to put the JDBC writer there, but there’s an error when it tries to save:

java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
at com.mysql.jdbc.StatementImpl.getGeneratedKeys(StatementImpl.java:2061)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10$$anonfun$apply$11.apply(JdbcDataWriter.scala:96)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10$$anonfun$apply$11.apply(JdbcDataWriter.scala:91)
at io.gatling.jdbc.util.SQLHelper$.withStatement(SQLHelper.scala:31)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10.apply(JdbcDataWriter.scala:91)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10.apply(JdbcDataWriter.scala:81)
at scala.Option.foreach(Option.scala:236)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3$$anonfun$apply$8$$anonfun$apply$9.apply(JdbcDataWriter.scala:81)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3$$anonfun$apply$8$$anonfun$apply$9.apply(JdbcDataWriter.scala:80)
at scala.Option.foreach(Option.scala:236)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3$$anonfun$apply$8.apply(JdbcDataWriter.scala:80)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3$$anonfun$apply$8.apply(JdbcDataWriter.scala:79)
at scala.Option.foreach(Option.scala:236)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3.apply(JdbcDataWriter.scala:79)
at io.gatling.jdbc.result.writer.JdbcDataWriter$$anonfun$onInitializeDataWriter$3.apply(JdbcDataWriter.scala:78)
at scala.Option.foreach(Option.scala:236)
at io.gatling.jdbc.result.writer.JdbcDataWriter.onInitializeDataWriter(JdbcDataWriter.scala:78)
at io.gatling.core.result.writer.DataWriter$$anonfun$uninitialized$1.applyOrElse(DataWriter.scala:92)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
at akka.actor.ActorCell.invoke(ActorCell.scala:456)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:385)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Rich. Another crap for the mysql JDBC driver…

I’ll be frank: this DataWriter is not polished, we don’t use it and don’t really maintain it, and have no idea about its performance impact.

If it doesn’t find a maintainer, it might be extracted and moved to a dedicated project.

How to build the project?

I don't see any pom.xml there?

Gatling now builds with sbt: http://www.scala-sbt.org/

https://github.com/excilys/gatling/issues/1743

Fixed

Thank you.

I’ve seen the code and I found out I can extend the DataWriter class and create a block on config file.
But I was testing the JDBC and I found an issue:
First there’s a missing commit after the executeUpdate on line 96 of JdbcDataWriter
I don’t know why, but I its actor become unitialized and every time I see a “Can’t handle RequestMessage” in the log. Is it possible that Akka is destroying the Actor?

First there's a missing commit after the executeUpdate on line 96 of
JdbcDataWriter

Fixed, thanks: Missing commit in JdbcDataWriter · Issue #1745 · gatling/gatling · GitHub

I don't know why, but I its actor become unitialized and every time I see
a "Can't handle RequestMessage" in the log. Is it possible that Akka is
destroying the Actor?

Because for a reason, an Exception was raised, the Actor crashed, and was
automatically re-created in its initial state.
What is the initial exception you get?

I have been able to write a DataWriter that writes to OpenTSDB for real time monitoring of the gatling run. Once you implement the DataWriter interface, you just need to add your datawriter to gatling.conf like this:

data {
writers = “console, file, com.box.gatling.opentsdb.TSDBDataWriter”

}

you would also need to have your jar with the class in ./lib dir in the gatling package.

~Harold.

Man, one more thing to investigate in the TODO list… :slight_smile:

Thanks for the information.

I can’t see any Exception being thrown by gatling in the log…
I’ll put more logs int the jdbcdatawriter and test if see where it stops working

I’ve figured out the problem is when it calls executeBatchUpdate but it does not throw any exception…

We weren’t logging actor crashes for DataWriters, this is fixed: https://github.com/excilys/gatling/issues/1746

Maybe this will help investigating.

I've found the problem. The create table in the gatling.conf defined userId
as int and in the app it is as a String.

Great job!
Indeed, the userId type was changed.

I’m fixing this ASAP.

Fixed: https://github.com/excilys/gatling/issues/1747

Thank you very much.
I really liked the project and the support here
I’ll develop a TCPDataWriter and a web application to manage, run and monitor the tests :slight_smile: