public NumericAttribute(String group, String name, Number value, AttributeType type, String identifier) { super(group, name, value, type, identifier); if (!type.isNumeric()) { throw new IllegalArgumentException("attribute type " + type + " is not numeric."); } }
public CollectionSetBuilder withAttribute(Resource resource, String group, String name, String value, AttributeType type) { if (value == null) { LOG.info("Ignoring null value for attribute '{}' in group '{}' on resource '{}'", name, group, resource); return this; } else if (type.isNumeric()) { return withNumericAttribute(resource, group, name, NumericAttributeUtils.parseNumericValue(value), type); } else { return withStringAttribute(resource, group, name, value); } }
@Override public void visitAttribute(CollectionAttribute attribute) { if (!attribute.getType().isNumeric()) { context.setVariable(attribute.getName(), attribute.getStringValue()); } }
if (attr.getType().isNumeric()) { JMXDataSource ds = new JMXDataSource(); ds.setName(attr.getAlias());
if (attr.getType().isNumeric()) { JMXDataSource ds = new JMXDataSource(); ds.setName(attr.getAlias());
if (type.isNumeric()) { Number num = null; for (final Locale locale : locales) {
if (type.isNumeric()) { Number num = null; for (final Locale locale : locales) {
/** {@inheritDoc} */ @Override public void visitGroup(AttributeGroup group) { pushShouldPersist(group); if (shouldPersist()) { Map<String, String> dsNamesToRrdNames = new LinkedHashMap<String , String>(); for (CollectionAttribute a : group.getAttributes()) { if (a.getType().isNumeric()) { dsNamesToRrdNames.put(a.getName(), group.getName()); } } setBuilder(createBuilder(group.getResource(), group.getName(), group.getGroupType().getAttributeTypes())); ResourcePath path = ResourceTypeUtils.getResourcePathWithRepository(getRepository(), group.getResource().getPath()); m_resourceStorageDao.updateMetricToResourceMappings(path, dsNamesToRrdNames); } }
@Override public void visitGroup(AttributeGroup group) { pushShouldPersist(group); if (shouldPersist()) { final String resourceId = getResourceId(group.getResource()); final String groupId = resourceId + '/' + group.getName(); LOG.debug("visitGroup: {} = {}", groupId, group.getAttributes().size()); stats.checkNode(group.getResource().getParent().getName()); stats.checkGroup(groupId); stats.checkResource(resourceId); group.getAttributes().forEach(a -> { final String attribId = resourceId + '/' + a.getName(); if (a.getAttributeType().getType().isNumeric()) { LOG.debug("visitGroup: attribute {}", attribId); stats.checkAttribute(attribId, true); stats.markNumericSamplesMeter(); } else { stats.checkAttribute(attribId, false); } }); setBuilder(new EvaluatorPersistOperationBuilder()); } }
if (type.isNumeric()) { builder.withNumericAttribute(nodeResource, vmwareGroup.getName(), attrib.getAlias(), value, type); } else { logger.debug("Storing multi instance value {}[{}='{}' for node {}", attrib.getName(), instance, value, agent.getNodeId()); if (type.isNumeric()) { builder.withNumericAttribute(resources.get(instance), vmwareGroup.getName(), attrib.getAlias(), value, type); } else {
/** {@inheritDoc} */ @Override public void visitGroup(AttributeGroup group) { pushShouldPersist(group); if (shouldPersist()) { Map<String, String> dsNamesToRrdNames = new LinkedHashMap<String , String>(); for (CollectionAttribute a : group.getAttributes()) { if (a.getType().isNumeric()) { dsNamesToRrdNames.put(a.getName(), group.getName()); } } setBuilder(createBuilder(group.getResource(), group.getName(), group.getGroupType().getAttributeTypes())); ResourcePath path = ResourceTypeUtils.getResourcePathWithRepository(getRepository(), group.getResource().getPath()); m_resourceStorageDao.updateMetricToResourceMappings(path, dsNamesToRrdNames); } }
if (type.isNumeric()) { builder.withNumericAttribute(nodeResource, vmwareGroup.getName(), attrib.getAlias(), value, type); } else { logger.debug("Storing multi instance value {}[{}='{}' for node {}", attrib.getName(), instance, value, agent.getNodeId()); if (type.isNumeric()) { builder.withNumericAttribute(resources.get(instance), vmwareGroup.getName(), attrib.getAlias(), value, type); } else {
@Override public void visitAttribute(CollectionAttribute attribute) { pushShouldPersist(attribute); if (shouldPersist()) { final String resourceId = getResourceId(attribute.getResource()); final String attribId = resourceId + '/' + attribute.getName(); LOG.debug("visitAttribute: {}", attribId); stats.checkNode(attribute.getResource().getParent().getName()); stats.checkResource(resourceId); if (attribute.getAttributeType().getType().isNumeric()) { stats.checkAttribute(attribId, true); stats.markNumericSamplesMeter(); } else { stats.checkAttribute(attribId, false); } setBuilder(new EvaluatorPersistOperationBuilder()); } }
if (type.isNumeric()) { Double numericValue = Double.NaN; try {
if (type.isNumeric()) { Double numericValue = Double.NaN; try {
final AttributeType type = attrib.getType(); final String stringValue = prop.getWmiValue().toString(); if (type.isNumeric()) { Double numericValue = Double.NaN; try {
final AttributeType type = attrib.getType(); final String stringValue = prop.getWmiValue().toString(); if (type.isNumeric()) { Double numericValue = Double.NaN; try {