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
public class Person { | |
private final String firstname; | |
private final String lastname; | |
private final String address; | |
private final String zipCode; | |
private final Gender gender; | |
public Person(final String firstname, final String lastname, final String address, final String zipCode, final Gender gender) { | |
this.firstname = Preconditions.nonNull(firstname); | |
this.lastname = Preconditions.nonNull(lastname); |
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
@Override | |
public <T> Page<T> query(Query query, Pager pager, Function<Row, T> conversion, Function<T, Boolean> filter) { | |
for (QueryFragment qf : query.getFragments()) { | |
Clause clause = Match(qf.getFilter()).of( | |
Case(instanceOf(With.Ids.class), FilterApplicators::withIds), | |
Case(instanceOf(With.Names.class), FilterApplicators::withNames), | |
// etc. | |
Case($(), o -> { throw new IllegalArgumentException("Unsupported filter type " + o.getClass()); })); |
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
@Override | |
public Iterator<Row> getTransitiveClosureOver(Row startingPoint, Relationships.Direction direction, | |
String... relationshipNames) { | |
String table; | |
switch (direction) { | |
case incoming: | |
table = RELATIONSHIP_IN; | |
break; | |
case outgoing: |
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
{ | |
"__inputs": [ | |
{ | |
"name": "DS_HAWKULAR-DEV", | |
"label": "Hawkular-dev", | |
"description": "", | |
"type": "datasource", | |
"pluginId": "hawkular-datasource", | |
"pluginName": "Hawkular" | |
} |
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
hawkular: | |
image: "jotak/hawkular-services:latest" | |
ports: | |
- "8080:8080" | |
- "8443:8443" | |
- "9990:9990" | |
links: | |
- myCassandra | |
volumes: | |
- /home/jotak/hservices/opt/data:/opt/data:Z |
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
Vertx vertx = Vertx.vertx(new VertxOptions().setMetricsOptions( | |
new DropwizardMetricsOptions().setEnabled(true).setRegistryName("reg"))); | |
HawkularReporter hawkularReporter = HawkularReporter | |
.builder(SharedMetricRegistries.getOrCreate("reg"), "sample-tenant") | |
.build(); | |
hawkularReporter.start(1, TimeUnit.SECONDS); | |
vertx.deployVerticle(/*...*/); |
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 2014-2017 Red Hat, Inc. and/or its affiliates | |
* and other contributors as indicated by the @author tags. | |
* | |
* 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 | |
* |
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
apiVersion: v1 | |
kind: Template | |
metadata: | |
name: grafaprom | |
objects: | |
- apiVersion: v1 | |
kind: DeploymentConfig | |
metadata: | |
generation: 1 | |
labels: |
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
{ | |
"resources":[ | |
{ | |
"id":"EAP-1", | |
"name":"EAP-1", | |
"typeId":"EAP", | |
"parentId":null, | |
"metrics":[ | |
{ | |
"name":"memory1", |
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
public class PrometheusNamesProvider implements MetricNamesProvider { | |
private static final String CONNECTIONS = "connections"; | |
private static final String BYTES_RECEIVED = "bytes_received"; | |
private static final String BYTES_SENT = "bytes_sent"; | |
private static final String ERROR_COUNT = "error_count"; | |
private static final String REQUESTS = "requests"; | |
private static final String REQUEST_COUNT = "request_count"; | |
private static final String WS_CONNECTIONS = "ws_connections"; | |
private static final String RESPONSE_TIME = "response_time"; |