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
fun main() { | |
// init prometheus registry | |
val registry = PrometheusMeterRegistry(PrometheusConfig.DEFAULT) | |
// bind micrometer metrics | |
ClassLoaderMetrics().bindTo(registry) | |
JvmMemoryMetrics().bindTo(registry) | |
JvmGcMetrics().bindTo(registry) | |
ProcessorMetrics().bindTo(registry) | |
JvmThreadMetrics().bindTo(registry) | |
UptimeMetrics().bindTo(registry) |
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
fun main() { | |
val rooms = mutableMapOf<String, MutableSet<ServerWebSocket>>() | |
val vertx = Vertx.vertx() | |
vertx.createHttpServer() | |
.webSocketHandler { | |
rooms.computeIfPresent(it.path()) { _, listOfConnections -> | |
listOfConnections.add(it) | |
listOfConnections | |
} | |
rooms.computeIfAbsent(it.path()) { _ -> mutableSetOf(it) } |
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
infix fun <T,O>List<T>.cartesianProduct(others:List<O>):List<Pair<T,O>> = | |
flatMap{ t:T-> | |
others.map { o-> Pair(t,o) } | |
} | |
inline fun <T, O, R> List<T>.mapCartesianProduct(others: List<O>, transform: (Pair<T, O>) -> R): List<R> = | |
flatMap { t: T -> | |
others.map { o -> transform(Pair(t, o)) } | |
} |
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
/* | |
* Copyright (c) 2013 Mindoo GmbH | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
use async_std::task::sleep; | |
use crypto::digest::Digest; | |
use crypto::sha1::Sha1; | |
use futures_util::*; | |
use roux::comment::CommentData; | |
use roux_stream::stream_comments; | |
use serde_json::{json, Value}; | |
use std::{borrow::Borrow, collections::HashSet, time::Duration}; | |
use tokio_retry::strategy::ExponentialBackoff; | |
use chrono::{self, Timelike}; |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sun Aug 6 03:07:53 UTC 2023 | |
Basic System Information: | |
--------------------------------- |
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
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sat Aug 5 23:24:44 EDT 2023 | |
ARM compatibility is considered *experimental* | |
Basic System Information: | |
--------------------------------- |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sun Aug 6 03:39:44 UTC 2023 | |
Basic System Information: | |
--------------------------------- |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sun Aug 6 04:01:44 UTC 2023 | |
Basic System Information: | |
--------------------------------- |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sun Aug 6 17:43:28 UTC 2023 | |
Basic System Information: | |
--------------------------------- |
OlderNewer