Introduce a set of gauges for various network statistics as reported by nstat.

This commit is contained in:
Jon Chambers
2021-03-04 16:41:15 -05:00
committed by Jon Chambers
parent 58210141f4
commit fde1b49729
4 changed files with 149 additions and 3 deletions

View File

@@ -110,6 +110,7 @@ import org.whispersystems.textsecuregcm.metrics.MaxFileDescriptorGauge;
import org.whispersystems.textsecuregcm.metrics.MetricsApplicationEventListener;
import org.whispersystems.textsecuregcm.metrics.NetworkReceivedGauge;
import org.whispersystems.textsecuregcm.metrics.NetworkSentGauge;
import org.whispersystems.textsecuregcm.metrics.NstatCounters;
import org.whispersystems.textsecuregcm.metrics.OperatingSystemMemoryGauge;
import org.whispersystems.textsecuregcm.metrics.PushLatencyManager;
import org.whispersystems.textsecuregcm.metrics.TrafficSource;
@@ -221,7 +222,7 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
{
SharedMetricRegistries.add(Constants.METRICS_NAME, environment.metrics());
Metrics.addRegistry(new WavefrontMeterRegistry(new WavefrontConfig() {
final WavefrontConfig wavefrontConfig = new WavefrontConfig() {
@Override
public String get(final String key) {
return null;
@@ -236,7 +237,9 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
public int batchSize() {
return config.getMicrometerConfiguration().getBatchSize();
}
}, Clock.SYSTEM) {
};
Metrics.addRegistry(new WavefrontMeterRegistry(wavefrontConfig, Clock.SYSTEM) {
@Override
protected DistributionStatisticConfig defaultHistogramConfig() {
return DistributionStatisticConfig.builder()
@@ -492,6 +495,8 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
BufferPoolGauges.registerMetrics();
GarbageCollectionGauges.registerMetrics();
new NstatCounters().registerMetrics(recurringJobExecutor, wavefrontConfig.step());
}
private void registerExceptionMappers(Environment environment, WebSocketEnvironment<Account> webSocketEnvironment, WebSocketEnvironment<Account> provisioningEnvironment) {