Skip to content

Commit c2b4e0e

Browse files
author
Milan Milosevic
committed
Merge branch 'release-1.4.8'
2 parents 23e50ee + 181a1e3 commit c2b4e0e

File tree

36 files changed

+678
-33
lines changed

36 files changed

+678
-33
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ Default reporting interval is 1 minute.
7272
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.
7373
Default reporting interval is 10 seconds.
7474

75+
#### Hiccup Module
76+
77+
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.
78+
7579
### Reporters
7680

7781
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).

cassandra-diagnostics-commons/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.smartcat</groupId>
66
<artifactId>cassandra-diagnostics</artifactId>
7-
<version>1.4.7</version>
7+
<version>1.4.8</version>
88
</parent>
99
<artifactId>cassandra-diagnostics-commons</artifactId>
1010
<packaging>jar</packaging>

cassandra-diagnostics-commons/src/main/java/io/smartcat/cassandra/diagnostics/info/NodeInfo.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,39 @@ public class NodeInfo {
1414
* Information about status of the thrift (active or not).
1515
*/
1616
public final boolean thriftActive;
17+
1718
/**
1819
* Information about status of the native transport (active or not).
1920
*/
2021
public final boolean nativeTransportActive;
22+
2123
/**
2224
* Node uptime in seconds.
2325
*/
2426
public final long uptimeInSeconds;
2527

28+
/**
29+
* Count of uncaught exceptions.
30+
*/
31+
public final int exceptionCount;
32+
2633
/**
2734
* NodeInfo class constructor.
2835
*
29-
* @param gossipActive info if gossip is active
30-
* @param thriftActive info if thrift is active
31-
* @param nativeTransportActive info if native transport is active
32-
* @param uptimeInSeconds uptime in seconds
36+
* @param gossipActive info if gossip is active
37+
* @param thriftActive info if thrift is active
38+
* @param nativeTransportActive info if native transport is active
39+
* @param uptimeInSeconds uptime in seconds
40+
* @param exceptionCount count of uncaught exceptions
3341
*/
34-
public NodeInfo(boolean gossipActive, boolean thriftActive, boolean nativeTransportActive, long uptimeInSeconds) {
42+
public NodeInfo(boolean gossipActive, boolean thriftActive, boolean nativeTransportActive, long uptimeInSeconds,
43+
int exceptionCount) {
3544
super();
3645
this.gossipActive = gossipActive;
3746
this.thriftActive = thriftActive;
3847
this.nativeTransportActive = nativeTransportActive;
3948
this.uptimeInSeconds = uptimeInSeconds;
49+
this.exceptionCount = exceptionCount;
4050
}
4151

4252
/**

cassandra-diagnostics-connector21/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.smartcat</groupId>
66
<artifactId>cassandra-diagnostics</artifactId>
7-
<version>1.4.7</version>
7+
<version>1.4.8</version>
88
</parent>
99
<artifactId>cassandra-diagnostics-connector21</artifactId>
1010
<description>Cassandra Diagnostics Connector for Cassandra 2.1.x.</description>

cassandra-diagnostics-connector21/src/main/java/io/smartcat/cassandra/diagnostics/connector/NodeProbeWrapper.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,16 @@ public CompactionSettingsInfo getCompactionSettingsInfo() {
134134
}
135135

136136
/**
137-
* Get the information if the native transport is active on the node.
138-
* Get the information about node such as which protocols are active and uptime.
137+
* Get the information if the native transport is active on the node. Get the information about node such as which
138+
* protocols are active, uptime, and exception count.
139139
*
140140
* @return NodeInfo for the node
141141
*/
142142
@Override
143143
public NodeInfo getNodeInfo() {
144144
NodeInfo nodeInfo = new NodeInfo(this.nodeProbe.isGossipRunning(), this.nodeProbe.isThriftServerRunning(),
145-
this.nodeProbe.isNativeTransportRunning(), this.nodeProbe.getUptime());
145+
this.nodeProbe.isNativeTransportRunning(), this.nodeProbe.getUptime(),
146+
this.nodeProbe.getExceptionCount());
146147
return nodeInfo;
147148
}
148149
}

cassandra-diagnostics-connector30/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.smartcat</groupId>
77
<artifactId>cassandra-diagnostics</artifactId>
8-
<version>1.4.7</version>
8+
<version>1.4.8</version>
99
</parent>
1010

1111
<artifactId>cassandra-diagnostics-connector30</artifactId>

cassandra-diagnostics-connector30/src/main/java/io/smartcat/cassandra/diagnostics/connector/NodeProbeWrapper.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,16 @@ public CompactionSettingsInfo getCompactionSettingsInfo() {
135135
}
136136

137137
/**
138-
* Get the information if the native transport is active on the node.
139-
* Get the information about node such as which protocols are active and uptime.
138+
* Get the information if the native transport is active on the node. Get the information about node such as which
139+
* protocols are active, uptime, and exception count.
140140
*
141141
* @return NodeInfo for the node
142142
*/
143143
@Override
144144
public NodeInfo getNodeInfo() {
145145
NodeInfo nodeInfo = new NodeInfo(this.nodeProbe.isGossipRunning(), this.nodeProbe.isThriftServerRunning(),
146-
this.nodeProbe.isNativeTransportRunning(), this.nodeProbe.getUptime());
146+
this.nodeProbe.isNativeTransportRunning(), this.nodeProbe.getUptime(),
147+
this.nodeProbe.getExceptionCount());
147148
return nodeInfo;
148149
}
149150

cassandra-diagnostics-core/COREMODULES.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,25 @@ Default reporting interval is set to 10s in order to detect these short outages.
154154
- io.smartcat.cassandra.diagnostics.reporter.LogReporter
155155
```
156156

157+
## Hiccup module
158+
159+
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.
160+
Hiccup measurement name is by default `hiccup`.
161+
162+
#### Configuration
163+
164+
```
165+
- module: io.smartcat.cassandra.diagnostics.module.hiccup.HiccupModule
166+
options:
167+
resolutionInMs: 1.0d #optional
168+
startDelayInMs: 30000 #optional
169+
allocateObjects: false #optional Allocate an object to make sure potential allocation stalls are measured.
170+
lowestTrackableValueInNanos: 1000L * 20L #optional
171+
highestTrackableValueInNanos: 3600 * 1000L * 1000L * 1000L #optional
172+
numberOfSignificantValueDigits: 2 #optional
173+
period: 5 #optional
174+
timeunit: SECONDS #optional
175+
reporters:
176+
- io.smartcat.cassandra.diagnostics.reporter.LogReporter
177+
```
178+

cassandra-diagnostics-core/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.smartcat</groupId>
66
<artifactId>cassandra-diagnostics</artifactId>
7-
<version>1.4.7</version>
7+
<version>1.4.8</version>
88
</parent>
99
<artifactId>cassandra-diagnostics-core</artifactId>
1010
<packaging>jar</packaging>
@@ -14,6 +14,7 @@
1414
<version.commons.lang3>3.4</version.commons.lang3>
1515
<version.nanohttpd>2.3.1</version.nanohttpd>
1616
<version.powermock>1.6.5</version.powermock>
17+
<version.hdrhistogram>2.1.9</version.hdrhistogram>
1718
</properties>
1819

1920
<dependencies>
@@ -31,6 +32,11 @@
3132
<groupId>org.slf4j</groupId>
3233
<artifactId>slf4j-api</artifactId>
3334
</dependency>
35+
<dependency>
36+
<groupId>org.hdrhistogram</groupId>
37+
<artifactId>HdrHistogram</artifactId>
38+
<version>${version.hdrhistogram}</version>
39+
</dependency>
3440
<dependency>
3541
<groupId>org.apache.commons</groupId>
3642
<artifactId>commons-lang3</artifactId>
@@ -104,6 +110,7 @@
104110
<includes>
105111
<include>io.smartcat:*</include>
106112
<include>org.nanohttpd:*</include>
113+
<include>org.hdrhistogram:*</include>
107114
</includes>
108115
</artifactSet>
109116
<transformers>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
package io.smartcat.cassandra.diagnostics.module.hiccup;
2+
3+
import java.util.Map;
4+
import java.util.concurrent.TimeUnit;
5+
6+
import org.yaml.snakeyaml.Yaml;
7+
8+
import io.smartcat.cassandra.diagnostics.config.ConfigurationException;
9+
10+
/**
11+
* Hiccup module's configuration.
12+
*/
13+
public class HiccupConfiguration {
14+
15+
/**
16+
* A helper class for constructing immutable outer class.
17+
*/
18+
public static class Values {
19+
20+
private static final double DEFAULT_RESOLUTION_IN_MS = 1.0;
21+
private static final long DEFAULT_START_DELAY_IN_MS = 30000;
22+
private static final boolean DEFAULT_ALLOCATE_OBJECTS = false;
23+
24+
// default to ~20usec best-case resolution
25+
private static final long DEFAULT_LOWEST_TRACKABLE_VALUE_IN_NANOS = 1000L * 20L;
26+
private static final long DEFAULT_HIGHEST_TRACKABLE_VALUE_IN_NANOS = 3600 * 1000L * 1000L * 1000L;
27+
private static final int DEFAULT_NUMBER_OF_SIGNIFICANT_VALUE_DIGITS = 2;
28+
29+
private static final int DEFAULT_PERIOD = 5;
30+
private static final String DEFAULT_TIMEUNIT = "SECONDS";
31+
32+
/**
33+
* Sleep resolution in millis.
34+
*/
35+
public double resolutionInMs = DEFAULT_RESOLUTION_IN_MS;
36+
37+
/**
38+
* Initial start delay in millis.
39+
*/
40+
public long startDelayInMs = DEFAULT_START_DELAY_IN_MS;
41+
42+
/**
43+
* Allocate objects to measure object creation stalls.
44+
*/
45+
public boolean allocateObjects = DEFAULT_ALLOCATE_OBJECTS;
46+
47+
/**
48+
* Lowest trackable value.
49+
*/
50+
public long lowestTrackableValueInNanos = DEFAULT_LOWEST_TRACKABLE_VALUE_IN_NANOS;
51+
52+
/**
53+
* Highest trackable value.
54+
*/
55+
public long highestTrackableValueInNanos = DEFAULT_HIGHEST_TRACKABLE_VALUE_IN_NANOS;
56+
57+
/**
58+
* Number of significat value digits.
59+
*/
60+
public int numberOfSignificantValueDigits = DEFAULT_NUMBER_OF_SIGNIFICANT_VALUE_DIGITS;
61+
62+
/**
63+
* Hiccup reporting period.
64+
*/
65+
public int period = DEFAULT_PERIOD;
66+
67+
/**
68+
* Hiccup reporting period's time unit.
69+
*/
70+
public TimeUnit timeunit = TimeUnit.valueOf(DEFAULT_TIMEUNIT);
71+
}
72+
73+
private Values values = new Values();
74+
75+
private HiccupConfiguration() {
76+
}
77+
78+
/**
79+
* Create typed configuration for hiccup module out of generic module configuration.
80+
*
81+
* @param options Module configuration options.
82+
* @return typed hiccup module configuration from a generic one
83+
* @throws ConfigurationException in case the provided options are not valid
84+
*/
85+
public static HiccupConfiguration create(Map<String, Object> options) throws ConfigurationException {
86+
HiccupConfiguration conf = new HiccupConfiguration();
87+
Yaml yaml = new Yaml();
88+
String str = yaml.dumpAsMap(options);
89+
conf.values = yaml.loadAs(str, HiccupConfiguration.Values.class);
90+
return conf;
91+
}
92+
93+
/**
94+
* Hiccup sleep resolution in millis.
95+
*
96+
* @return hiccup sleep resolution
97+
*/
98+
public double resolutionInMs() {
99+
return values.resolutionInMs;
100+
}
101+
102+
/**
103+
* Hiccup initial start delay in millis.
104+
*
105+
* @return hiccup initial start delay
106+
*/
107+
public long startDelayInMs() {
108+
return values.startDelayInMs;
109+
}
110+
111+
/**
112+
* Allocate objects to measure object creation stalls.
113+
*
114+
* @return allocate objects
115+
*/
116+
public boolean allocateObjects() {
117+
return values.allocateObjects;
118+
}
119+
120+
/**
121+
* Lowest trackable value.
122+
*
123+
* @return lowest trackable value
124+
*/
125+
public long lowestTrackableValueInNanos() {
126+
return values.lowestTrackableValueInNanos;
127+
}
128+
129+
/**
130+
* Highest trackable value.
131+
*
132+
* @return highest trackable value
133+
*/
134+
public long highestTrackableValueInNanos() {
135+
return values.highestTrackableValueInNanos;
136+
}
137+
138+
/**
139+
* Number of significat value digits.
140+
*
141+
* @return number of significat value digits
142+
*/
143+
public int numberOfSignificantValueDigits() {
144+
return values.numberOfSignificantValueDigits;
145+
}
146+
147+
/**
148+
* Hiccup reporting period getter.
149+
*
150+
* @return hiccup reporting period
151+
*/
152+
public int period() {
153+
return values.period;
154+
}
155+
156+
/**
157+
* Hiccup reporting period time unit getter.
158+
*
159+
* @return hiccup reporting time unit
160+
*/
161+
public TimeUnit timeunit() {
162+
return values.timeunit;
163+
}
164+
165+
/**
166+
* Hiccup reporting interval in milliseconds.
167+
*
168+
* @return reporting interval in milliseconds
169+
*/
170+
public long reportingIntervalInMillis() {
171+
return timeunit().toMillis(period());
172+
}
173+
174+
}

0 commit comments

Comments
 (0)