This project is an implementation of the Vert.x Metrics Service Provider Interface (SPI). It uses Micrometer for managing metrics and reporting to several backends.
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
const len = dataRps.length; | |
let minRps: number = len > 1 ? +dataRps[1] : 0; | |
let maxRps: number = minRps; | |
let errSample: number = dataErrors.length > 1 ? +dataErrors[1] : 0; | |
let pctMinErr: number = 100 * errSample / minRps; | |
let pctMaxErr: number = pctMinErr; | |
for (let i = 2; i < len; ++i) { | |
const sample: number = +dataRps[i]; | |
minRps = sample < minRps ? sample : minRps; |
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
var countHistograms, countGauges uint32 | |
api.SpyArgumentsAndReturnEmpty(func(args mock.Arguments) { | |
query := args[1].(string) | |
assert.IsType(t, v1.Range{}, args[2]) | |
r := args[2].(v1.Range) | |
assert.Contains(t, query, "svc.ns.svc.cluster.local") | |
assert.Contains(t, query, "[1m]") | |
if strings.Contains(query, "histogram_quantile") { |
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
[INFO] --- maven-dependency-plugin:3.0.2:tree (default-cli) @ vertx-rx-java --- | |
[INFO] io.vertx:vertx-rx-java:jar:3.6.0-SNAPSHOT | |
[INFO] +- io.vertx:vertx-rx-java-codegen:jar:3.6.0-SNAPSHOT:compile | |
[INFO] | \- io.reactivex:rxjava:jar:1.3.5:compile | |
[INFO] +- io.vertx:vertx-core:test-jar:tests:3.6.0-SNAPSHOT:test | |
[INFO] | +- io.netty:netty-common:jar:4.1.19.Final:compile | |
[INFO] | +- io.netty:netty-buffer:jar:4.1.19.Final:compile | |
[INFO] | +- io.netty:netty-transport:jar:4.1.19.Final:compile | |
[INFO] | +- io.netty:netty-handler:jar:4.1.19.Final:compile | |
[INFO] | | \- io.netty:netty-codec:jar:4.1.19.Final:compile |
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
package main | |
import ( | |
"log" | |
"net/http" | |
"time" | |
"github.com/swift-sunshine/swscore/config" | |
"github.com/swift-sunshine/swscore/routing" | |
) |
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
package io.vertx.monitoring; | |
import io.vertx.core.Vertx; | |
import io.vertx.ext.unit.Async; | |
import io.vertx.ext.unit.TestContext; | |
import io.vertx.ext.unit.junit.VertxUnitRunner; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; |
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
@RunWith(VertxUnitRunner.class) | |
public class MyTest { | |
@Test | |
public void testRunningForever(TestContext context) { | |
Vertx vertx = Vertx.vertx(); | |
Async async = context.async(); | |
vertx.setTimer(1000, t -> { | |
context.fail("something wrong"); | |
async.complete(); |
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
global: | |
scrape_interval: 10s | |
scrape_timeout: 10s | |
scrape_configs: | |
- job_name: my-kubernetes-job | |
tls_config: | |
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | |
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token | |
kubernetes_sd_configs: | |
# role "pod", or whatever |
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
global: | |
# set whatever you like | |
scrape_interval: 10s | |
scrape_timeout: 10s | |
scrape_configs: | |
- job_name: dc_prometheus | |
honor_labels: true | |
metrics_path: /federate | |
params: | |
match[]: |
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
# Label from HTTP code family & server name (ex from vertx_http_servers_0_0_0_0:8081_responses_2xx_total) | |
metric_relabel_configs: | |
# Transforming vertx_http_servers_0_0_0_0:8081_responses_2xx_total ... | |
# ... to vertx_http_servers_0_0_0_0:8081_responses_total{code=2xx} | |
- source_labels: [__name__] | |
regex: '(.*)_(\dxx)_(.*)' | |
replacement: '${2}' | |
target_label: code | |
- source_labels: [__name__] | |
regex: '(.*)_(\dxx)_(.*)' |