Skip to content

Commit

Permalink
Merge branch 'release-1.4.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Milosevic committed Jul 13, 2017
2 parents 23e50ee + 181a1e3 commit c2b4e0e
Show file tree
Hide file tree
Showing 36 changed files with 678 additions and 33 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ Default reporting interval is 1 minute.
Cluster health module is used to report the health status of the nodes such as which nodes are marked as DOWN by gossiper. It uses the information exposed over JMX.
Default reporting interval is 10 seconds.

#### Hiccup Module

Module based on [jHiccup](https://github.com/giltene/jHiccup) that logs and reports platform hiccups including JVM stalls. Default reporting period is 5 seconds and reporter values and percentiles from 90 to 100 and Mean and Max values.

### Reporters

Reporters take measurement from core and wrap them up in implementation specific format so it can be sent to reporters target (i.e. Influx reporter transforms measurement to influx query and stores it to InfluxDB).
Expand Down
2 changes: 1 addition & 1 deletion cassandra-diagnostics-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.smartcat</groupId>
<artifactId>cassandra-diagnostics</artifactId>
<version>1.4.7</version>
<version>1.4.8</version>
</parent>
<artifactId>cassandra-diagnostics-commons</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,39 @@ public class NodeInfo {
* Information about status of the thrift (active or not).
*/
public final boolean thriftActive;

/**
* Information about status of the native transport (active or not).
*/
public final boolean nativeTransportActive;

/**
* Node uptime in seconds.
*/
public final long uptimeInSeconds;

/**
* Count of uncaught exceptions.
*/
public final int exceptionCount;

/**
* NodeInfo class constructor.
*
* @param gossipActive info if gossip is active
* @param thriftActive info if thrift is active
* @param nativeTransportActive info if native transport is active
* @param uptimeInSeconds uptime in seconds
* @param gossipActive info if gossip is active
* @param thriftActive info if thrift is active
* @param nativeTransportActive info if native transport is active
* @param uptimeInSeconds uptime in seconds
* @param exceptionCount count of uncaught exceptions
*/
public NodeInfo(boolean gossipActive, boolean thriftActive, boolean nativeTransportActive, long uptimeInSeconds) {
public NodeInfo(boolean gossipActive, boolean thriftActive, boolean nativeTransportActive, long uptimeInSeconds,
int exceptionCount) {
super();
this.gossipActive = gossipActive;
this.thriftActive = thriftActive;
this.nativeTransportActive = nativeTransportActive;
this.uptimeInSeconds = uptimeInSeconds;
this.exceptionCount = exceptionCount;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion cassandra-diagnostics-connector21/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.smartcat</groupId>
<artifactId>cassandra-diagnostics</artifactId>
<version>1.4.7</version>
<version>1.4.8</version>
</parent>
<artifactId>cassandra-diagnostics-connector21</artifactId>
<description>Cassandra Diagnostics Connector for Cassandra 2.1.x.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,16 @@ public CompactionSettingsInfo getCompactionSettingsInfo() {
}

/**
* Get the information if the native transport is active on the node.
* Get the information about node such as which protocols are active and uptime.
* Get the information if the native transport is active on the node. Get the information about node such as which
* protocols are active, uptime, and exception count.
*
* @return NodeInfo for the node
*/
@Override
public NodeInfo getNodeInfo() {
NodeInfo nodeInfo = new NodeInfo(this.nodeProbe.isGossipRunning(), this.nodeProbe.isThriftServerRunning(),
this.nodeProbe.isNativeTransportRunning(), this.nodeProbe.getUptime());
this.nodeProbe.isNativeTransportRunning(), this.nodeProbe.getUptime(),
this.nodeProbe.getExceptionCount());
return nodeInfo;
}
}
2 changes: 1 addition & 1 deletion cassandra-diagnostics-connector30/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.smartcat</groupId>
<artifactId>cassandra-diagnostics</artifactId>
<version>1.4.7</version>
<version>1.4.8</version>
</parent>

<artifactId>cassandra-diagnostics-connector30</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,16 @@ public CompactionSettingsInfo getCompactionSettingsInfo() {
}

/**
* Get the information if the native transport is active on the node.
* Get the information about node such as which protocols are active and uptime.
* Get the information if the native transport is active on the node. Get the information about node such as which
* protocols are active, uptime, and exception count.
*
* @return NodeInfo for the node
*/
@Override
public NodeInfo getNodeInfo() {
NodeInfo nodeInfo = new NodeInfo(this.nodeProbe.isGossipRunning(), this.nodeProbe.isThriftServerRunning(),
this.nodeProbe.isNativeTransportRunning(), this.nodeProbe.getUptime());
this.nodeProbe.isNativeTransportRunning(), this.nodeProbe.getUptime(),
this.nodeProbe.getExceptionCount());
return nodeInfo;
}

Expand Down
22 changes: 22 additions & 0 deletions cassandra-diagnostics-core/COREMODULES.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,25 @@ Default reporting interval is set to 10s in order to detect these short outages.
- io.smartcat.cassandra.diagnostics.reporter.LogReporter
```

## Hiccup module

Module based on [jHiccup](https://github.com/giltene/jHiccup) that logs and reports platform hiccups including JVM stalls. Default reporting period is 5 seconds and reporter values and percentiles from 90 to 100 and Mean and Max values.
Hiccup measurement name is by default `hiccup`.

#### Configuration

```
- module: io.smartcat.cassandra.diagnostics.module.hiccup.HiccupModule
options:
resolutionInMs: 1.0d #optional
startDelayInMs: 30000 #optional
allocateObjects: false #optional Allocate an object to make sure potential allocation stalls are measured.
lowestTrackableValueInNanos: 1000L * 20L #optional
highestTrackableValueInNanos: 3600 * 1000L * 1000L * 1000L #optional
numberOfSignificantValueDigits: 2 #optional
period: 5 #optional
timeunit: SECONDS #optional
reporters:
- io.smartcat.cassandra.diagnostics.reporter.LogReporter
```

9 changes: 8 additions & 1 deletion cassandra-diagnostics-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.smartcat</groupId>
<artifactId>cassandra-diagnostics</artifactId>
<version>1.4.7</version>
<version>1.4.8</version>
</parent>
<artifactId>cassandra-diagnostics-core</artifactId>
<packaging>jar</packaging>
Expand All @@ -14,6 +14,7 @@
<version.commons.lang3>3.4</version.commons.lang3>
<version.nanohttpd>2.3.1</version.nanohttpd>
<version.powermock>1.6.5</version.powermock>
<version.hdrhistogram>2.1.9</version.hdrhistogram>
</properties>

<dependencies>
Expand All @@ -31,6 +32,11 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.hdrhistogram</groupId>
<artifactId>HdrHistogram</artifactId>
<version>${version.hdrhistogram}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -104,6 +110,7 @@
<includes>
<include>io.smartcat:*</include>
<include>org.nanohttpd:*</include>
<include>org.hdrhistogram:*</include>
</includes>
</artifactSet>
<transformers>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
package io.smartcat.cassandra.diagnostics.module.hiccup;

import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.yaml.snakeyaml.Yaml;

import io.smartcat.cassandra.diagnostics.config.ConfigurationException;

/**
* Hiccup module's configuration.
*/
public class HiccupConfiguration {

/**
* A helper class for constructing immutable outer class.
*/
public static class Values {

private static final double DEFAULT_RESOLUTION_IN_MS = 1.0;
private static final long DEFAULT_START_DELAY_IN_MS = 30000;
private static final boolean DEFAULT_ALLOCATE_OBJECTS = false;

// default to ~20usec best-case resolution
private static final long DEFAULT_LOWEST_TRACKABLE_VALUE_IN_NANOS = 1000L * 20L;
private static final long DEFAULT_HIGHEST_TRACKABLE_VALUE_IN_NANOS = 3600 * 1000L * 1000L * 1000L;
private static final int DEFAULT_NUMBER_OF_SIGNIFICANT_VALUE_DIGITS = 2;

private static final int DEFAULT_PERIOD = 5;
private static final String DEFAULT_TIMEUNIT = "SECONDS";

/**
* Sleep resolution in millis.
*/
public double resolutionInMs = DEFAULT_RESOLUTION_IN_MS;

/**
* Initial start delay in millis.
*/
public long startDelayInMs = DEFAULT_START_DELAY_IN_MS;

/**
* Allocate objects to measure object creation stalls.
*/
public boolean allocateObjects = DEFAULT_ALLOCATE_OBJECTS;

/**
* Lowest trackable value.
*/
public long lowestTrackableValueInNanos = DEFAULT_LOWEST_TRACKABLE_VALUE_IN_NANOS;

/**
* Highest trackable value.
*/
public long highestTrackableValueInNanos = DEFAULT_HIGHEST_TRACKABLE_VALUE_IN_NANOS;

/**
* Number of significat value digits.
*/
public int numberOfSignificantValueDigits = DEFAULT_NUMBER_OF_SIGNIFICANT_VALUE_DIGITS;

/**
* Hiccup reporting period.
*/
public int period = DEFAULT_PERIOD;

/**
* Hiccup reporting period's time unit.
*/
public TimeUnit timeunit = TimeUnit.valueOf(DEFAULT_TIMEUNIT);
}

private Values values = new Values();

private HiccupConfiguration() {
}

/**
* Create typed configuration for hiccup module out of generic module configuration.
*
* @param options Module configuration options.
* @return typed hiccup module configuration from a generic one
* @throws ConfigurationException in case the provided options are not valid
*/
public static HiccupConfiguration create(Map<String, Object> options) throws ConfigurationException {
HiccupConfiguration conf = new HiccupConfiguration();
Yaml yaml = new Yaml();
String str = yaml.dumpAsMap(options);
conf.values = yaml.loadAs(str, HiccupConfiguration.Values.class);
return conf;
}

/**
* Hiccup sleep resolution in millis.
*
* @return hiccup sleep resolution
*/
public double resolutionInMs() {
return values.resolutionInMs;
}

/**
* Hiccup initial start delay in millis.
*
* @return hiccup initial start delay
*/
public long startDelayInMs() {
return values.startDelayInMs;
}

/**
* Allocate objects to measure object creation stalls.
*
* @return allocate objects
*/
public boolean allocateObjects() {
return values.allocateObjects;
}

/**
* Lowest trackable value.
*
* @return lowest trackable value
*/
public long lowestTrackableValueInNanos() {
return values.lowestTrackableValueInNanos;
}

/**
* Highest trackable value.
*
* @return highest trackable value
*/
public long highestTrackableValueInNanos() {
return values.highestTrackableValueInNanos;
}

/**
* Number of significat value digits.
*
* @return number of significat value digits
*/
public int numberOfSignificantValueDigits() {
return values.numberOfSignificantValueDigits;
}

/**
* Hiccup reporting period getter.
*
* @return hiccup reporting period
*/
public int period() {
return values.period;
}

/**
* Hiccup reporting period time unit getter.
*
* @return hiccup reporting time unit
*/
public TimeUnit timeunit() {
return values.timeunit;
}

/**
* Hiccup reporting interval in milliseconds.
*
* @return reporting interval in milliseconds
*/
public long reportingIntervalInMillis() {
return timeunit().toMillis(period());
}

}
Loading

0 comments on commit c2b4e0e

Please sign in to comment.