Skip to content

Commit

Permalink
Indent benchmark specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Gómez committed Jan 3, 2018
1 parent bffb855 commit 20ba7c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,10 @@ In order to test the Redis backend, the plugin needs to be able to connect to a

Running benchmarks on the plugin doesn't make much sense, as there are a number of factors to be considered, like mosquitto's own performance. Also, they are highly tied to other applications and specific infrastructure, such as local postgres instance versus a remote with enabled tls one, network latency for http and jwt, etc. Anyway, there are a couple of benchmarks written for the Files and Redis backends. They were ran on an Asus laptop with the following specs:

OS: Linux Mint 18 Cinnamon 3.07 64-bit
Kernel: 4.11.0-14
Processor: Intel Core i5-6200U CPU @ 2.30GHz x 2
Memory: 5.7 GiB
OS: Linux Mint 18 Cinnamon 3.07 64-bit
Kernel: 4.11.0-14
Processor: Intel Core i5-6200U CPU @ 2.30GHz x 2
Memory: 5.7 GiB

As said, take these benchmarks with a grain of salt and consider them just as a reference. A much better benchmark would be running mosquitto with this plugin and an alternative one (such as [jpmens'](https://github.com/jpmens)) and compare how they do against similarly configured backends. I'd expect that one to be faster, as it's written in C, but hopefully the difference isn't so big. I'd gladly include something like this if anyone is willing to do such benchmark.

Expand Down
2 changes: 1 addition & 1 deletion backends/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestMysql(t *testing.T) {
authOpts["mysql_password"] = "go_auth_test"
authOpts["mysql_userquery"] = "SELECT password_hash FROM test_user WHERE username = ? limit 1"
authOpts["mysql_superquery"] = "select count(*) from test_user where username = ? and is_admin = true"
authOpts["mysql_aclquery"] = "SELECT test_acl.topic FROM test_acl, test_user WHERE test_user.username = ? AND test_acl.test_user_id = test_user.id AND rw >= ?"
authOpts["mysql_aclquery"] = "SELECT test_acl.topic FROM test_acl, test_user WHERE test_user.username = ? AND test_acl.test_user_id = test_user.id AND (rw >= ? or rw = 3)"

Convey("Given valid params NewMysql should return a Mysql backend instance", t, func() {
mysql, err := NewMysql(authOpts, log.DebugLevel)
Expand Down
2 changes: 1 addition & 1 deletion backends/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestPostgres(t *testing.T) {
authOpts["pg_password"] = "go_auth_test"
authOpts["pg_userquery"] = "SELECT password_hash FROM test_user WHERE username = $1 limit 1"
authOpts["pg_superquery"] = "select count(*) from test_user where username = $1 and is_admin = true"
authOpts["pg_aclquery"] = "SELECT test_acl.topic FROM test_acl, test_user WHERE test_user.username = $1 AND test_acl.test_user_id = test_user.id AND rw >= $2"
authOpts["pg_aclquery"] = "SELECT test_acl.topic FROM test_acl, test_user WHERE test_user.username = $1 AND test_acl.test_user_id = test_user.id AND (rw = $2 or rw = 3)"

Convey("Given valid params NewPostgres should return a Postgres backend instance", t, func() {
postgres, err := NewPostgres(authOpts, log.DebugLevel)
Expand Down

0 comments on commit 20ba7c6

Please sign in to comment.