@Test public void testResourceCounterData() throws Exception { initFactories("/threshd-configuration.xml", "/test-thresholds-counters.xml"); ThresholdingVisitor visitor = createVisitor(); CollectionAgent agent = createCollectionAgent(); NodeResourceType resourceType = createNodeResourceType(agent); MibObject mibObject = createMibObject("counter", "myCounter", "0"); SnmpAttributeType attributeType = new NumericAttributeType(resourceType, "default", mibObject, new AttributeGroupType("mibGroup", "ignore")); addHighThresholdEvent(1, 10, 5, 15, "Unknown", null, "myCounter", null, null); addHighRearmEvent(1, 10, 5, 2, "Unknown", null, "myCounter", null, null); long baseDate = new Date().getTime(); visitor.visitCollectionSet(createAnonymousCollectionSet(baseDate)); SnmpCollectionResource resource = new NodeInfo(resourceType, agent); resource.setAttributeValue(attributeType, SnmpUtils.getValueFactory().getCounter32(1000)); resource.visit(visitor); visitor.visitCollectionSet(createAnonymousCollectionSet(baseDate+300000)); resource = new NodeInfo(resourceType, agent); resource.setAttributeValue(attributeType, SnmpUtils.getValueFactory().getCounter32(5500)); resource.visit(visitor); visitor.visitCollectionSet(createAnonymousCollectionSet(baseDate+600000)); resource = new NodeInfo(resourceType, agent); resource.setAttributeValue(attributeType, SnmpUtils.getValueFactory().getCounter32(6100)); resource.visit(visitor); EasyMock.verify(agent); verifyEvents(0); }
@Override public void visitCollectionSet(CollectionSet set) { m_collectionTimestamp = set.getCollectionTimestamp(); }
ThresholdingVisitor extends AbstractCollectionSetVisitor { @Override public void visitCollectionSet(CollectionSet set) { m_collectionTimestamp = set.getCollectionTimestamp(); } }
ThresholdingVisitor extends AbstractCollectionSetVisitor { @Override public void visitCollectionSet(CollectionSet set) { m_collectionTimestamp = set.getCollectionTimestamp(); } protected  ThresholdingVisitor(CollectorThresholdingSet thresholdingSet); }
ThresholdingVisitor extends AbstractCollectionSetVisitor { @Override public void visitCollectionSet(CollectionSet set) { m_collectionTimestamp = set.getCollectionTimestamp(); } protected  ThresholdingVisitor(CollectorThresholdingSet thresholdingSet); static ThresholdingVisitor create(int nodeId, String hostAddress, String serviceName, RrdRepository repo, ServiceParameters svcParams); boolean hasThresholds(); @Override void visitCollectionSet(CollectionSet set); void reload(); void reloadScheduledOutages(); boolean isNodeInOutage(); @Override void visitResource(CollectionResource resource); @Override void visitAttribute(CollectionAttribute attribute); @Override void completeResource(CollectionResource resource); Date getCollectionTimestamp(); @Override String toString(); }
ThresholdingVisitor extends AbstractCollectionSetVisitor { @Override public void visitCollectionSet(CollectionSet set) { m_collectionTimestamp = set.getCollectionTimestamp(); } protected  ThresholdingVisitor(CollectorThresholdingSet thresholdingSet); static ThresholdingVisitor create(int nodeId, String hostAddress, String serviceName, RrdRepository repo, ServiceParameters svcParams); boolean hasThresholds(); @Override void visitCollectionSet(CollectionSet set); void reload(); void reloadScheduledOutages(); boolean isNodeInOutage(); @Override void visitResource(CollectionResource resource); @Override void visitAttribute(CollectionAttribute attribute); @Override void completeResource(CollectionResource resource); Date getCollectionTimestamp(); @Override String toString();  }