Browse Source

[crystal/raze] Remove Raze as it is unmaintained (#9075)

Raze hasn't been updated in 4 years and the project is archived:
https://github.com/samueleaton/raze
Petrik de Heus 1 year ago
parent
commit
0a1689868a

+ 0 - 5
frameworks/Crystal/raze/README.md

@@ -1,5 +0,0 @@
-# Crystal-Raze
-
-This is the [Raze](https://github.com/samueleaton/raze) test of the Framework Benchmarks. Crystal is a new language that closely resembles Ruby with a goal of removing typed variables and parameters (instead inferencing), whilst maintaining top speed through bindings into C.
-
-Raze is a Modular, light web framework for Crystal https://razecr.com/

+ 0 - 28
frameworks/Crystal/raze/benchmark_config.json

@@ -1,28 +0,0 @@
-{
-  "framework": "raze",
-  "tests": [{
-    "default": {
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "fortune_url": "/fortunes",
-      "update_url": "/updates?queries=",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "Postgres",
-      "framework": "raze",
-      "language": "Crystal",
-      "flavor": "None",
-      "orm": "micro",
-      "platform": "None",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "Raze (PostgreSQL)",
-      "notes": "",
-      "versus": "crystal"
-    }
-  }]
-}

+ 0 - 19
frameworks/Crystal/raze/config.toml

@@ -1,19 +0,0 @@
-[framework]
-name = "raze"
-
-[main]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/updates?queries="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Fullstack"
-database = "Postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "micro"
-platform = "None"
-webserver = "None"
-versus = "crystal"

+ 0 - 107
frameworks/Crystal/raze/raze.cr

@@ -1,107 +0,0 @@
-require "raze"
-require "pg"
-
-BENCH_DB = DB.open(ENV["DATABASE_URL"])
-
-class CONTENT
-  ID_MAX = 10_000
-  JSON  = "application/json"
-  PLAIN = "text/plain"
-  HTML  = "text/html; charset=UTF-8"
-end
-
-private def get_world
-  id = Random.rand(CONTENT::ID_MAX).succ
-  random_number = BENCH_DB.query_one("SELECT id, randomNumber FROM world WHERE id = $1", id, as: Int32)
-  { id: id, randomNumber: random_number }
-end
-
-private def set_world(world)
-  BENCH_DB.exec("UPDATE world SET randomNumber = $1 WHERE id = $2", world[:randomNumber], world[:id])
-  world
-end
-
-private def fortunes
-  data = Array(NamedTuple(id: Int32, message: String)).new
-
-  BENCH_DB.query_each("SELECT id, message FROM Fortune") do |rs|
-    data.push({id: rs.read(Int32), message: rs.read(String)})
-  end
-
-  data
-end
-
-private def sanitized_query_count(ctx)
-  queries = ctx.query["queries"].as(String)
-  queries = queries.to_i? || 1
-  queries.clamp(1..500)
-end
-
-# Test 1: JSON Serialization
-get "/json" do |ctx|
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::JSON
-  { message: "Hello, World!" }.to_json
-end
-
-# Postgres Test 2: Single database query
-get "/db" do |ctx|
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::JSON
-  get_world.to_json
-end
-
-# Postgres Test 3: Multiple database query
-get "/queries" do |ctx|
-  results = (1..sanitized_query_count(ctx)).map do
-    get_world
-  end
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::JSON
-  results.to_json
-end
-
-# Postgres Test 4: Fortunes
-get "/fortunes" do |ctx|
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::HTML
-  data = fortunes
-  additional_fortune = {
-    id:      0,
-    message: "Additional fortune added at request time.",
-  }
-  data.push(additional_fortune)
-
-  data.sort_by! { |fortune| fortune[:message] }
-
-  render "views/fortunes.ecr"
-end
-
-# Postgres Test 5: Database Updates
-get "/updates" do |ctx|
-  updated = (1..sanitized_query_count(ctx)).map do
-    set_world({id: get_world[:id], randomNumber: Random.rand(CONTENT::ID_MAX).succ})
-  end
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::JSON
-  updated.to_json
-end
-
-# Test 6: Plaintext
-get "/plaintext" do |ctx|
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::PLAIN
-  "Hello, World!"
-end
-
-Raze.config.logging = false
-Raze.config.port = 8080
-Raze.config.env = "production"
-Raze.config.reuse_port = true
-Raze.run

+ 0 - 17
frameworks/Crystal/raze/raze.dockerfile

@@ -1,17 +0,0 @@
-FROM crystallang/crystal:0.26.1
-
-WORKDIR /raze
-COPY views views
-COPY run.sh run.sh
-COPY raze.cr raze.cr
-COPY shard.lock shard.lock
-COPY shard.yml shard.yml
-
-ENV DATABASE_URL postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world?initial_pool_size=56&max_pool_size=56&max_idle_pool_size=56
-
-RUN shards install
-RUN crystal build --release --no-debug raze.cr
-
-EXPOSE 8080
-
-CMD bash run.sh

+ 0 - 7
frameworks/Crystal/raze/run.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-for i in $(seq 1 $(nproc --all)); do
-  ./raze -p 8080 &
-done
-
-wait

+ 0 - 22
frameworks/Crystal/raze/shard.lock

@@ -1,22 +0,0 @@
-version: 1.0
-shards:
-  db:
-    github: crystal-lang/crystal-db
-    version: 0.5.0
-
-  kilt:
-    github: jeromegn/kilt
-    version: 0.4.0
-
-  pg:
-    github: will/crystal-pg
-    version: 0.15.0
-
-  radix:
-    github: luislavena/radix
-    version: 0.3.8
-
-  raze:
-    github: samueleaton/raze
-    version: 0.3.0
-

+ 0 - 18
frameworks/Crystal/raze/shard.yml

@@ -1,18 +0,0 @@
-name: raze
-version: 0.1.0
-
-targets:
-  raze:
-    main: src/raze.cr
-
-crystal: 0.26.1
-
-license: MIT
-
-dependencies:
-  raze:
-    github: samueleaton/raze
-    version: 0.3.0
-  pg:
-    github: will/crystal-pg
-    version: 0.15.0

+ 0 - 20
frameworks/Crystal/raze/views/fortunes.ecr

@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-	<title>Fortunes</title>
-</head>
-<body>
-	<table>
-		<tr>
-		<th>id</th>
-		<th>message</th>
-		</tr>
-		<% data.each do |fortune| %>
-			<tr>
-			<td><%= fortune[:id] %></td>
-			<td><%= HTML.escape(fortune[:message]) %></td>
-			</tr>
-		<% end %>
-	</table>
-</body>
-</html>