Skip to content

Commit

Permalink
[HWKMETRICS-788] remove unused, dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanda committed May 4, 2018
1 parent 9101b39 commit 4976c96
Show file tree
Hide file tree
Showing 133 changed files with 30 additions and 12,481 deletions.
Expand Up @@ -40,10 +40,6 @@
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.DEFAULT_TTL;
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.INGEST_MAX_RETRIES;
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.INGEST_MAX_RETRY_DELAY;
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.JMX_REPORTING_ENABLED;
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.METRICS_REPORTING_COLLECTION_INTERVAL;
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.METRICS_REPORTING_ENABLED;
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.METRICS_REPORTING_HOSTNAME;
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.PAGE_SIZE;
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.VERSION_CHECK_DELAY;
import static org.hawkular.metrics.api.jaxrs.config.ConfigurationKey.VERSION_CHECK_MAX_RETRIES;
Expand Down Expand Up @@ -79,20 +75,13 @@

import org.hawkular.metrics.api.jaxrs.config.Configurable;
import org.hawkular.metrics.api.jaxrs.config.ConfigurationProperty;
import org.hawkular.metrics.api.jaxrs.dropwizard.RESTMetrics;
import org.hawkular.metrics.api.jaxrs.log.RestLogger;
import org.hawkular.metrics.api.jaxrs.log.RestLogging;
import org.hawkular.metrics.api.jaxrs.util.JobSchedulerFactory;
import org.hawkular.metrics.api.jaxrs.util.ManifestInformation;
import org.hawkular.metrics.api.jaxrs.util.MetricRegistryProvider;
import org.hawkular.metrics.api.jaxrs.util.SchemaVersionCheckException;
import org.hawkular.metrics.api.jaxrs.util.SchemaVersionChecker;
import org.hawkular.metrics.core.dropwizard.CassandraDriverMetrics;
import org.hawkular.metrics.core.dropwizard.DropWizardReporter;
import org.hawkular.metrics.core.dropwizard.HawkularMetricRegistry;
import org.hawkular.metrics.core.dropwizard.HawkularMetricsRegistryListener;
import org.hawkular.metrics.core.dropwizard.HawkularObjectNameFactory;
import org.hawkular.metrics.core.dropwizard.MetricNameService;
import org.hawkular.metrics.core.jobs.CompressData;
import org.hawkular.metrics.core.jobs.JobsService;
import org.hawkular.metrics.core.jobs.JobsServiceImpl;
Expand All @@ -111,6 +100,7 @@
import org.hawkular.rx.cassandra.driver.RxSessionImpl;

import com.codahale.metrics.JmxReporter;
import com.codahale.metrics.MetricRegistry;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.HostDistance;
import com.datastax.driver.core.JdkSSLOptions;
Expand Down Expand Up @@ -222,11 +212,6 @@ public enum State {
@ConfigurationProperty(DEFAULT_TTL)
private String defaultTTL;

@Inject
@Configurable
@ConfigurationProperty(JMX_REPORTING_ENABLED)
private String jmxReportingEnabled;

@Inject
@Configurable
@ConfigurationProperty(ADMIN_TOKEN)
Expand Down Expand Up @@ -262,21 +247,6 @@ public enum State {
@ConfigurationProperty(COMPRESSION_JOB_ENABLED)
private String compressionJobEnabled;

@Inject
@Configurable
@ConfigurationProperty(METRICS_REPORTING_HOSTNAME)
private String metricsReportingHostname;

@Inject
@Configurable
@ConfigurationProperty(METRICS_REPORTING_ENABLED)
private String metricsReportingEnabled;

@Inject
@Configurable
@ConfigurationProperty(METRICS_REPORTING_COLLECTION_INTERVAL)
private String collectionIntervalConfig;

@Inject
@ServiceReady
Event<ServiceReadyEvent> metricsServiceReady;
Expand All @@ -294,9 +264,6 @@ public enum State {
@ConfigurationProperty(VERSION_CHECK_MAX_RETRIES)
private String versionCheckMaxRetries;

@Inject
RESTMetrics restMetrics;

private volatile State state;
private int connectionAttempts;
private Session session;
Expand Down Expand Up @@ -416,49 +383,15 @@ private void startMetricsService() {
metricsService.setConfigurationService(configurationService);
metricsService.setDefaultTTL(getDefaultTTL());

MetricNameService metricNameService;
if (metricsReportingHostname == null) {
metricNameService = new MetricNameService(adminTenant);
} else {
metricNameService = new MetricNameService(metricsReportingHostname, adminTenant);
}

HawkularMetricRegistry metricRegistry = MetricRegistryProvider.INSTANCE.getMetricRegistry();
metricRegistry.setMetricNameService(metricNameService);

restMetrics.setMetricNameService(metricNameService);
restMetrics.initMetrics();
MetricRegistry metricRegistry = MetricRegistryProvider.INSTANCE.getMetricRegistry();

metricsService.setMetricNameService(metricNameService);
metricsService.startUp(session, keyspace, false, false, metricRegistry);

HawkularMetricsRegistryListener metricsRegistryListener = new HawkularMetricsRegistryListener();
metricsRegistryListener.setMetricNameService(metricNameService);
metricsRegistryListener.setMetricRegistry(metricRegistry);
metricsRegistryListener.setMetricsService(metricsService);
metricRegistry.addListener(metricsRegistryListener);

new CassandraDriverMetrics(session, metricRegistry).registerAll();

initJobsService();

if (Boolean.valueOf(metricsReportingEnabled)) {
DropWizardReporter reporter = new DropWizardReporter(metricRegistry, metricNameService, metricsService);
int interval = Integer.getInteger(collectionIntervalConfig, 180);
reporter.start(interval, SECONDS);
}

initGCGraceSecondsManager();
initTempTablesCleaner();

if (Boolean.parseBoolean(jmxReportingEnabled)) {
HawkularObjectNameFactory JMXObjNameFactory = new HawkularObjectNameFactory(metricRegistry);
JmxReporter jmxReporter = JmxReporter.forRegistry(metricRegistry)
.inDomain("org.hawkular.metrics")
.createsObjectNamesWith(JMXObjNameFactory)
.build();
jmxReporter.start();
}
state = State.STARTED;
log.infoServiceStarted();

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 4976c96

Please sign in to comment.