-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Update Bencher CLI usage (#3100)
- Loading branch information
Showing
2 changed files
with
55 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,47 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>hello-wasm example</title> | ||
</head> | ||
<body> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>hello-wasm example</title> | ||
</head> | ||
<body> | ||
<div id="content"> | ||
<!-- Adding input field and button --> | ||
<label for="queryInput"></label><input type="text" id="queryInput" placeholder="Enter your query here" /> | ||
<button id="btn">Run Query</button> | ||
<p id="result"></p> | ||
</div> | ||
|
||
<div id="content"> | ||
<!-- Adding input field and button --> | ||
<label for="queryInput"></label><input type="text" id="queryInput" placeholder="Enter your query here" /> | ||
<button id="btn">Run Query</button> | ||
<p id="result"></p> | ||
</div> | ||
<script type="module"> | ||
import init, {TailcallBuilder} from "../../browser/pkg/tailcall_wasm.js" | ||
await init() | ||
|
||
<script type="module"> | ||
import init, { TailcallBuilder } from "../../browser/pkg/tailcall_wasm.js"; | ||
await init(); | ||
let executor // Making executor accessible | ||
|
||
let executor; // Making executor accessible | ||
async function setup() { | ||
try { | ||
const urlParams = new URLSearchParams(window.location.search) | ||
let schemaUrl = urlParams.get("config") | ||
|
||
async function setup() { | ||
try { | ||
const urlParams = new URLSearchParams(window.location.search); | ||
let schemaUrl = urlParams.get("config"); | ||
|
||
let builder = new TailcallBuilder(); | ||
builder = await builder.with_config(schemaUrl); | ||
executor = await builder.build(); | ||
let btn = document.getElementById("btn"); | ||
btn.addEventListener("click", runQuery); | ||
} catch (error) { | ||
alert("error: " + error); | ||
} | ||
} | ||
async function runQuery() { | ||
let query = document.getElementById("queryInput").value; | ||
try { | ||
document.getElementById("result").textContent = await executor.execute(query); | ||
} catch (error) { | ||
console.error("Error executing query: " + error); | ||
document.getElementById("result").textContent = "Error: " + error; | ||
} | ||
} | ||
setup(); | ||
</script> | ||
</body> | ||
let builder = new TailcallBuilder() | ||
builder = await builder.with_config(schemaUrl) | ||
executor = await builder.build() | ||
let btn = document.getElementById("btn") | ||
btn.addEventListener("click", runQuery) | ||
} catch (error) { | ||
alert("error: " + error) | ||
} | ||
} | ||
async function runQuery() { | ||
let query = document.getElementById("queryInput").value | ||
try { | ||
document.getElementById("result").textContent = await executor.execute(query) | ||
} catch (error) { | ||
console.error("Error executing query: " + error) | ||
document.getElementById("result").textContent = "Error: " + error | ||
} | ||
} | ||
setup() | ||
</script> | ||
</body> | ||
</html> |
4f4336b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running 30s test @ http://localhost:8000/graphql
4 threads and 100 connections
770659 requests in 30.01s, 3.86GB read
Requests/sec: 25681.22
Transfer/sec: 131.81MB