Parcourir la source

[New Framework]: Oxygen.jl (#8789)

* added Oxygen.jl example with /plaintext and /json tests

* renamed framework from oxygen-jl to oxygen

* renamed top level directory to match framework name

* updated readme
Nathan Ortega il y a 1 an
Parent
commit
158bd471de

+ 21 - 0
frameworks/Julia/oxygen/README.md

@@ -0,0 +1,21 @@
+# Oxygen.jl Benchmarking Test
+
+Oxygen is a micro-framework built on top of the HTTP.jl library and comes with helpful utilities to quickly setup and run web applications in Julia.
+
+### Test Type Implementation Source Code
+
+* [JSON](Relative/Path/To/Your/Source/File)
+* [PLAINTEXT](Relative/Path/To/Your/Source/File)
+
+## Important Libraries
+The tests were run with:
+* [Oxygen.jl](https://github.com/OxygenFramework/Oxygen.jl)
+
+## Test URLs
+### JSON
+
+http://localhost:8080/json
+
+### PLAINTEXT
+
+http://localhost:8080/plaintext

+ 26 - 0
frameworks/Julia/oxygen/benchmark_config.json

@@ -0,0 +1,26 @@
+{
+	"framework": "oxygen",
+	"tests": [
+		{
+			"default": {
+				"json_url": "/json",
+				"plaintext_url": "/plaintext",
+				"port": 8080,
+				"approach": "Realistic",
+				"classification": "None",
+				"database": "None",
+				"framework": "Oxygen.jl",
+				"language": "Julia",
+				"orm": "None",
+				"platform": "None",
+				"webserver": "Oxygen.jl",
+				"os": "Linux",
+				"database_os": "Linux",
+				"display_name": "Oxygen.jl",
+				"notes": "",
+				"versus": "",
+				"tags": []
+			}
+		}
+	]
+}

+ 8 - 0
frameworks/Julia/oxygen/oxygen.dockerfile

@@ -0,0 +1,8 @@
+FROM julia:latest
+
+WORKDIR /app
+COPY ./src ./
+RUN julia --project -e 'using Pkg; Pkg.instantiate()'
+
+EXPOSE 8080
+CMD julia -t 2 --project server.jl

+ 4 - 0
frameworks/Julia/oxygen/src/Project.toml

@@ -0,0 +1,4 @@
+[deps]
+Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
+HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
+Oxygen = "df9a0d86-3283-4920-82dc-4555fc0d1d8b"

+ 23 - 0
frameworks/Julia/oxygen/src/server.jl

@@ -0,0 +1,23 @@
+
+using Oxygen
+using Dates
+using HTTP
+
+@get "/json" function()
+   return json(("message" => "Hello, World!"))
+end
+
+@get "/plaintext" function()
+   return text("Hello, World!")
+end
+
+function HeaderMiddleware(handle::Function)
+   function(req::HTTP.Request)
+      response = handle(req)
+      HTTP.setheader(response, "Server" => "Julia-Oxygen")
+      HTTP.setheader(response, "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT")
+      return response
+   end
+end
+
+serveparallel(host="0.0.0.0", port=8080, middleware=[HeaderMiddleware], access_log=nothing, metrics=false, docs=false)