/** {@inheritDoc} */ @Override public Number getNumericValue() { return m_wrapped.getNumericValue(); }
/** * Add/Update required attributes for thresholds on m_attributeMap. * This is used because {@link CollectionResource} does not have direct reference to their attributes. * (The way to get attribute is against {@link AttributeGroup} object contained on {@link CollectionResource} * implementations). */ @Override public void visitAttribute(CollectionAttribute attribute) { if (m_thresholdingSet.hasThresholds(attribute)) { String name = attribute.getName(); m_attributesMap.put(name, attribute); LOG.debug("visitAttribute: storing value {} for attribute named {}", attribute.getNumericValue() != null ? attribute.getNumericValue() : attribute.getStringValue(), name); } }
@Override public void visitAttribute(CollectionAttribute attribute) { strings.add(String.format("%s/%s/%s[%s,%s]", resource.getPath(), group.getName(), attribute.getName(),attribute.getStringValue(),attribute.getNumericValue())); } });
@Override public void visitAttribute(CollectionAttribute attribute) { strings.add(String.format("%s/%s/%s[%s,%s]", resource.getPath(), group.getName(), attribute.getName(),attribute.getStringValue(),attribute.getNumericValue())); } });
return null; Number numValue = m_attributes.get(ds).getNumericValue(); if (numValue == null) { LOG.info("getAttributeValue: can't find numeric value for {} on {}", ds, m_resource);
/** {@inheritDoc} */ @Override public void persistNumericAttribute(CollectionAttribute attribute) { boolean shouldIgnorePersist = isIgnorePersist() && AttributeType.COUNTER.equals(attribute.getType()); LOG.debug("Persisting {} {}", attribute, (shouldIgnorePersist ? ". Ignoring value because of sysUpTime changed." : "")); Number value = shouldIgnorePersist ? Double.NaN : attribute.getNumericValue(); m_builder.setAttributeValue(attribute.getAttributeType(), value); m_builder.setAttributeMetadata(attribute.getMetricIdentifier(), attribute.getName()); }
@Override public void visitAttribute(CollectionAttribute attribute) { if (attribute.getType().equals(AttributeType.STRING)) { CollectionSetProtos.StringAttribute.Builder attributeBuilder = CollectionSetProtos.StringAttribute .newBuilder(); attributeBuilder.setValue(attribute.getStringValue()); attributeBuilder.setName(attribute.getName()); collectionSetResourceBuilder.addString(attributeBuilder); } else { CollectionSetProtos.NumericAttribute.Builder attributeBuilder = CollectionSetProtos.NumericAttribute .newBuilder(); attributeBuilder.setGroup(lastGroupName); attributeBuilder.setName(attribute.getName()); attributeBuilder.setValue(attribute.getNumericValue().longValue()); attributeBuilder.setType((attribute.getType() == AttributeType.GAUGE) ? Type.GAUGE : Type.COUNTER); collectionSetResourceBuilder.addNumeric(attributeBuilder); } }
@Override public void visitAttribute(CollectionAttribute attribute) { if (attribute.getType().equals(AttributeType.STRING)) { CollectionSetProtos.StringAttribute.Builder attributeBuilder = CollectionSetProtos.StringAttribute .newBuilder(); attributeBuilder.setValue(attribute.getStringValue()); attributeBuilder.setName(attribute.getName()); collectionSetResourceBuilder.addString(attributeBuilder); } else { CollectionSetProtos.NumericAttribute.Builder attributeBuilder = CollectionSetProtos.NumericAttribute .newBuilder(); attributeBuilder.setGroup(lastGroupName); attributeBuilder.setName(attribute.getName()); attributeBuilder.setValue(attribute.getNumericValue().longValue()); attributeBuilder.setType((attribute.getType() == AttributeType.GAUGE) ? Type.GAUGE : Type.COUNTER); collectionSetResourceBuilder.addNumeric(attributeBuilder); } }