use of com.hazelcast.config.MetricsManagementCenterConfig in project hazelcast by hazelcast.
the class MetricsConfigHelper method overrideMemberMetricsConfig.
/**
* Overrides the {@link MetricsConfig} in the provided {@link Config}
* with the metrics system properties if present.
* See the {@link MetricsConfig} javadoc for the links between metrics
* configuration fields and the system properties.
*
* @param config The configuration
*/
public static void overrideMemberMetricsConfig(Config config, ILogger logger) {
MetricsConfig metricsConfig = config.getMetricsConfig();
MetricsManagementCenterConfig managementCenterConfig = metricsConfig.getManagementCenterConfig();
MetricsJmxConfig jmxConfig = metricsConfig.getJmxConfig();
// MetricsConfig.enabled
tryOverride(ClusterProperty.METRICS_ENABLED, config::getProperty, prop -> metricsConfig.setEnabled(Boolean.parseBoolean(prop)), () -> Boolean.toString(metricsConfig.isEnabled()), "MetricsConfig.enabled", logger);
// MetricsManagementCenterConfig.enabled
tryOverride(ClusterProperty.METRICS_MC_ENABLED, config::getProperty, prop -> managementCenterConfig.setEnabled(Boolean.parseBoolean(prop)), () -> Boolean.toString(managementCenterConfig.isEnabled()), "MetricsManagementCenterConfig.enabled", logger);
// MetricsManagementCenterConfig.retentionSeconds
tryOverride(ClusterProperty.METRICS_MC_RETENTION, config::getProperty, prop -> managementCenterConfig.setRetentionSeconds(Integer.parseInt(prop)), () -> Integer.toString(managementCenterConfig.getRetentionSeconds()), "MetricsManagementCenterConfig.retentionSeconds", logger);
// MetricsJmxConfig.enabled
tryOverride(ClusterProperty.METRICS_JMX_ENABLED, config::getProperty, prop -> jmxConfig.setEnabled(Boolean.parseBoolean(prop)), () -> Boolean.toString(jmxConfig.isEnabled()), "MetricsJmxConfig.enabled", logger);
// MetricsConfig.collectionFrequencySeconds
tryOverride(ClusterProperty.METRICS_COLLECTION_FREQUENCY, config::getProperty, prop -> metricsConfig.setCollectionFrequencySeconds(Integer.parseInt(prop)), () -> Integer.toString(metricsConfig.getCollectionFrequencySeconds()), "MetricsConfig.collectionFrequencySeconds", logger);
}
use of com.hazelcast.config.MetricsManagementCenterConfig in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method handleMetricsManagementCenter.
private void handleMetricsManagementCenter(Node node) {
MetricsManagementCenterConfig managementCenterConfig = config.getMetricsConfig().getManagementCenterConfig();
NamedNodeMap attributes = node.getAttributes();
for (int a = 0; a < attributes.getLength(); a++) {
Node att = attributes.item(a);
if (matches("enabled", att.getNodeName())) {
boolean enabled = getBooleanValue(getAttribute(node, "enabled"));
managementCenterConfig.setEnabled(enabled);
}
for (Node child : childElements(node)) {
String nodeName = cleanNodeName(child);
if (matches("retention-seconds", nodeName)) {
managementCenterConfig.setRetentionSeconds(Integer.parseInt(getTextContent(child)));
}
}
}
}
Aggregations