mirror of https://github.com/apibillme/broker
wip
This commit is contained in:
parent
8148d376f2
commit
ace795479c
|
@ -111,7 +111,6 @@ version = "1.4.6"
|
|||
dependencies = [
|
||||
"bcrypt 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"envy 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"go-flag 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -225,14 +224,6 @@ dependencies = [
|
|||
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.8.0"
|
||||
|
@ -1937,7 +1928,6 @@ dependencies = [
|
|||
"checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d"
|
||||
"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"
|
||||
"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
|
||||
"checksum crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c"
|
||||
"checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac"
|
||||
"checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4"
|
||||
"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
|
||||
|
|
|
@ -27,4 +27,3 @@ jsonwebtoken = "6"
|
|||
reqwest = { version = "0.10", features = ["json", "blocking"] }
|
||||
go-flag = "0.1"
|
||||
envy = "0.4"
|
||||
crossbeam-channel = "0.4"
|
||||
|
|
2
Makefile
2
Makefile
|
@ -1,5 +1,7 @@
|
|||
run:
|
||||
SAVE_PATH=./tmp/broker_data cargo run
|
||||
release:
|
||||
SAVE_PATH=./tmp/broker_data cargo run --release
|
||||
build:
|
||||
sudo snapcraft
|
||||
edge:
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
const http = require('http')
|
||||
|
||||
let drop_goal = 10000;
|
||||
let dropped = 0;
|
||||
|
||||
let query = {
|
||||
host: 'localhost',
|
||||
port: 8080,
|
||||
path: '/events'
|
||||
}
|
||||
|
||||
setInterval(() => {
|
||||
http.get('http://localhost:8080/events', () => print_status(true))
|
||||
.setTimeout(100, () => print_status(false))
|
||||
.on('error', () => {})
|
||||
}, 20)
|
||||
|
||||
function print_status(accepting_connections) {
|
||||
process.stdout.write("\r\x1b[K");
|
||||
process.stdout.write(`Connections dropped: ${dropped}, accepting connections: ${accepting_connections}`);
|
||||
}
|
Loading…
Reference in New Issue