use of org.opennms.netmgt.rrd.RrdRepository in project opennms by OpenNMS.
the class RrdPersistOperationBuilderTest method testCommitWithNoDeclaredAttributes.
@Test
public void testCommitWithNoDeclaredAttributes() throws Exception {
RrdRepository repository = createRrdRepository();
SnmpCollectionAgent agent = getCollectionAgent();
MockDataCollectionConfig dataCollectionConfig = new MockDataCollectionConfig();
OnmsSnmpCollection collection = new OnmsSnmpCollection(agent, new ServiceParameters(new HashMap<String, Object>()), dataCollectionConfig, m_locationAwareSnmpClient);
NodeResourceType resourceType = new NodeResourceType(agent, collection);
CollectionResource resource = new NodeInfo(resourceType, agent);
RrdPersistOperationBuilder builder = new RrdPersistOperationBuilder(m_rrdStrategy, repository, resource, "rrdName", false);
builder.commit();
}
use of org.opennms.netmgt.rrd.RrdRepository in project opennms by OpenNMS.
the class SnmpAttributeTest method createRrdRepository.
private RrdRepository createRrdRepository() throws IOException {
RrdRepository repository = new RrdRepository();
repository.setRrdBaseDir(getSnmpRrdDirectory());
repository.setHeartBeat(600);
repository.setStep(300);
repository.setRraList(Collections.singletonList("RRA:AVERAGE:0.5:1:100"));
return repository;
}
use of org.opennms.netmgt.rrd.RrdRepository in project opennms by OpenNMS.
the class CollectableServiceTest method createRrdRepository.
private RrdRepository createRrdRepository() throws IOException {
RrdRepository repository = new RrdRepository();
repository.setRrdBaseDir(getSnmpRrdDirectory());
repository.setHeartBeat(600);
repository.setStep(300);
repository.setRraList(Collections.singletonList("RRA:AVERAGE:0.5:1:100"));
return repository;
}
use of org.opennms.netmgt.rrd.RrdRepository in project opennms by OpenNMS.
the class CollectorTestUtils method persistCollectionSet.
public static void persistCollectionSet(RrdStrategy<?, ?> rrdStrategy, ResourceStorageDao resourceStorageDao, CollectionSpecification spec, CollectionSet collectionSet) {
RrdRepository repository = spec.getRrdRepository("default");
System.err.println("repository = " + repository);
ServiceParameters params = spec.getServiceParameters();
System.err.println("service parameters = " + params);
RrdPersisterFactory persisterFactory = new RrdPersisterFactory();
persisterFactory.setRrdStrategy(rrdStrategy);
persisterFactory.setResourceStorageDao(resourceStorageDao);
CollectionSetVisitor persister = persisterFactory.createPersister(params, repository);
System.err.println("persister = " + persister);
collectionSet.visit(persister);
}
use of org.opennms.netmgt.rrd.RrdRepository in project opennms by OpenNMS.
the class VmwareDatacollectionConfigDaoJaxb method getRrdRepository.
/**
* Returns the Rrd repository for a given collection name.
*
* @param collectionName the collection's name
* @return the repository
*/
@Override
public RrdRepository getRrdRepository(String collectionName) {
RrdRepository repo = new RrdRepository();
repo.setRrdBaseDir(new File(getRrdPath()));
repo.setRraList(getRRAList(collectionName));
repo.setStep(getStep(collectionName));
repo.setHeartBeat((2 * getStep(collectionName)));
return repo;
}
Aggregations