Speicherverbrauchanalyse erweitert, Tests korrigiert

parent f0672047
......@@ -33,6 +33,7 @@ import de.bsvrz.dav.daf.main.config.DataModel;
import de.bsvrz.sys.funclib.losb.exceptions.FailureException;
import de.bsvrz.sys.funclib.losb.exceptions.SenderException;
import de.bsvrz.sys.funclib.losb.kernsoftware.Sender;
import de.bsvrz.sys.funclib.losb.util.Util;
import org.junit.*;
import java.io.IOException;
......@@ -89,6 +90,7 @@ public class TestPidArchiveRequest extends ArchiveTest {
_daf=null;
}
_davTestEnvironment.stop();
Util.deleteDir(am.getArchivePath().toFile());
}
private void sendDataSets(final int i) throws Exception {
......
......@@ -254,8 +254,7 @@ public class ArSCmdInterface {
}
);
subMenu.addCmd(new MemoryDumpCmd("Arbeitsspeicher", "", archMgr));
subMenu.addCmd(new MemoryDumpCmd("Festplattenspeicher", "", archMgr));
subMenu.addCmd(new MemoryDumpCmd("Arbeitsspeicher-Analyse", "", archMgr));
subMenu = new CmdMenu("System Info", "");
root.addNode(subMenu);
......
......@@ -11,6 +11,7 @@ import de.bsvrz.ars.ars.mgmt.datatree.DataIdentNode;
import de.bsvrz.ars.ars.mgmt.datatree.DataIdentTreeIterator;
import de.bsvrz.ars.ars.mgmt.datatree.Stat;
import de.bsvrz.ars.ars.persistence.ContainerFileDir;
import de.bsvrz.ars.ars.persistence.walk.ContainerDirAction;
import de.bsvrz.ars.ars.persistence.walk.ContainerDirCollector;
import de.bsvrz.ars.ars.persistence.walk.ContainerDirWalk;
import de.bsvrz.dav.daf.main.archive.ArchiveDataKindCombination;
......@@ -29,10 +30,11 @@ public class MemoryDumpCmd extends Command {
private final ArchiveManager _archMgr;
/**
* Kommando für {@link CmdInterpreter}
* @param desc die Beschreibung
* @param help der Hilfetext
* @param archMgr
* Kommando für {@link de.bsvrz.sys.funclib.losb.util.cmdinterface.CmdInterpreter}
*
* @param desc die Beschreibung
* @param help der Hilfetext
* @param archMgr Archivmanager
*/
public MemoryDumpCmd(final String desc, final String help, final ArchiveManager archMgr) {
super(desc, help);
......@@ -48,7 +50,9 @@ public class MemoryDumpCmd extends Command {
builder.add(dataIdentNode.getMemoryStats());
}).reduce((a,b) -> new Stat(a.getIndexMem() + b.getIndexMem(), a.getManagementIndexMem() + b.getManagementIndexMem(), a.getCacheMemory() + b.getCacheMemory()));
stat.ifPresent(System.err::println);
if(stat.isPresent()) {
printlnPlain(stat.get().toString());
}
}
}
......@@ -250,7 +250,7 @@ public final class DataIdentNode {
public float getIndexFillRatio(ArchiveDataKind adk) {
ATimeMonotoneIndex idx = getATimeMonoIdx(adk);
return idx != null ? idx.memoryEntries() / idx.memoryCapacity() : -1;
return idx != null ? idx.memoryEntries() / (float)idx.memoryCapacity() : 0;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment