2
0
mirror of synced 2025-01-12 01:24:23 +00:00
This commit is contained in:
Ben 2024-07-24 16:06:45 +02:00
parent 8f16699bab
commit ae4d782566
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
3 changed files with 24 additions and 14 deletions

View File

@ -134,15 +134,16 @@ namespace CodexPlugin
public void LogDiskSpace(string msg) public void LogDiskSpace(string msg)
{ {
try what to do with this?
{ //try
var diskInfo = tools.CreateWorkflow().ExecuteCommand(Container.Containers.Single(), "df", "--sync"); //{
Log($"{msg} - Disk info: {diskInfo}"); // var diskInfo = tools.CreateWorkflow().ExecuteCommand(Container.Containers.Single(), "df", "--sync");
} // Log($"{msg} - Disk info: {diskInfo}");
catch (Exception e) //}
{ //catch (Exception e)
Log("Failed to get disk info: " + e); //{
} // Log("Failed to get disk info: " + e);
//}
} }
public void DeleteRepoFolder() public void DeleteRepoFolder()

View File

@ -24,7 +24,7 @@ namespace CodexTests.ScalabilityTests
var uploadLog = Ci.DownloadLog(hosts[0]); var uploadLog = Ci.DownloadLog(hosts[0]);
var expectedNumberOfBlocks = RoundUp(fileSize.MB().SizeInBytes, 64.KB().SizeInBytes) + 1; // +1 for manifest block. var expectedNumberOfBlocks = RoundUp(fileSize.MB().SizeInBytes, 64.KB().SizeInBytes) + 1; // +1 for manifest block.
var blockCids = uploadLog var blockCids = uploadLog
.FindLinesThatContain("Putting block into network store") .FindLinesThatContain("Block Stored")
.Select(s => .Select(s =>
{ {
var start = s.IndexOf("cid=") + 4; var start = s.IndexOf("cid=") + 4;
@ -44,9 +44,16 @@ namespace CodexTests.ScalabilityTests
var downloadLog = Ci.DownloadLog(client); var downloadLog = Ci.DownloadLog(client);
var host = string.Empty; var host = string.Empty;
var blockCidHostMap = new Dictionary<string, string>(); var blockIndexHostMap = new Dictionary<int, string>();
downloadLog.IterateLines(line => downloadLog.IterateLines(line =>
{ {
// Received blocks from peer
// topics="codex blockexcengine"
// tid=1
// peer=16U*5ULEov
// blocks="treeCid: zDzSvJTfBgds9wsRV6iB8ZVf4fL6Nynxh2hkJSyTH4j8A9QPucyU, index: 1597"
// count=28138
if (line.Contains("peer=") && line.Contains(" len=")) if (line.Contains("peer=") && line.Contains(" len="))
{ {
var start = line.IndexOf("peer=") + 5; var start = line.IndexOf("peer=") + 5;

View File

@ -14,15 +14,17 @@ namespace CodexTests.BasicTests
[Test] [Test]
[Combinatorial] [Combinatorial]
public void MarketplaceExample( public void MarketplaceExample(
[Values(4, 8, 16 /* 1mb */, 32)] int numBlocks, [Values(4, 8, 16 /* 1mb */, 32, 64)] int numBlocks,
[Values(-3, -2, -1, 0, 1, 2, 3)] int plusSizeKb [Values(-3, -2, -1, 0, 1, 2, 3)] int plusSizeKb,
[Values(-3, -2, -1, 0, 1, 2, 3)] int plusSizeBytes
) )
{ {
var hostInitialBalance = 234.TstWei(); var hostInitialBalance = 234.TstWei();
var clientInitialBalance = 100000.TstWei(); var clientInitialBalance = 100000.TstWei();
var fileSize = new ByteSize( var fileSize = new ByteSize(
numBlocks * (64 * 1024) + numBlocks * (64 * 1024) +
plusSizeKb * 1024 plusSizeKb * 1024 +
plusSizeBytes
); );
var geth = Ci.StartGethNode(s => s.IsMiner().WithName("disttest-geth")); var geth = Ci.StartGethNode(s => s.IsMiner().WithName("disttest-geth"));