Add Clojure duct framework#3874
Conversation
| @@ -0,0 +1,4 @@ | |||
| (ns hello.handler.example-test | |||
There was a problem hiding this comment.
Could you remove this test file? I see it is basically an empty placeholder, but even if it wasn't empty, we still don't want to maintain framework-specific functional tests in this repository.
I made a similar request in another PR recently with a longer explanation: #3895 (comment)
There was a problem hiding this comment.
I removed the test file which was generated by the lein template.
|
|
||
| (defn- query [db] | ||
| (first | ||
| (jdbc/query db ["select * from world where id = ?" (inc (rand-int 4))]))) |
There was a problem hiding this comment.
It's supposed to be a random number between 1 and 10,000 (inclusive on both ends), so I think this should be (rand-int 10000) instead of (rand-int 4).
There was a problem hiding this comment.
Nice catch, I only had some rows in local, before I configured Docker on my machine 👍
| (jdbc/query db ["select * from world where id = ?" (inc (rand-int 4))]))) | ||
|
|
||
| (defn- mongo-query [db] | ||
| (dissoc (mc/find-one-as-map db "world" {:id 5}) :_id)) |
There was a problem hiding this comment.
This looks like it's hardcoded to find the world with id=5. It should be a randomly-generated id just like in the SQL version.
| "language": "Clojure", | ||
| "flavor": "None", | ||
| "orm": "Raw", | ||
| "platform": "Servlet", |
There was a problem hiding this comment.
Just checking - is "platform": "Servlet" correct? I don't see a servlet container such as Resin or Tomcat being used in the dockerfiles to launch the web application, so I'm wondering if this part is intentional.
There was a problem hiding this comment.
You're right, the platform for the default, mongodb and httpkit is supposed to be Ring. I also updated the other implementations like aleph -> Netty, immutant -> Undertow.
| ; :duct.logger.timbre/brief #ig/ref :duct.logger.timbre/brief}}} | ||
|
|
||
| :duct.database.mongodb/monger | ||
| {:host "localhost" :port 27017} |
There was a problem hiding this comment.
Is this file used by the implementation that gets benchmarked? If not, if it's a config file only used when launching the application directly rather than running it through the TFB toolset, then please remove it.
There was a problem hiding this comment.
Same with any other files like this (I see a few others that are suspicious). We don't want any source code that's not being used in the benchmarks.
There was a problem hiding this comment.
These files are useful for local development (in order to test from the REPL), I'll remove them from the repository and keep them locally 👍
|
I will investigate why it does not start anymore while on the train 😄 |
* Add Clojure Duct framework * Clean up comments * Disable logging * Remove useless testing file. * Update invalid rand number. * Update platform in benchmark_config * Remove localhost config. * Remove development platform config * Update docker files.
Add implementation for the Clojure's duct framework.