Disables metrics in scalability test. Downloads container log when retry attempt failed too quickly to be a timeout.
This commit is contained in:
parent
18a02b1717
commit
5ffff1ed07
|
@ -196,8 +196,10 @@ namespace CodexPlugin
|
|||
|
||||
private void Investigate(ILog log, Failure failure, ITimeSet timeSet)
|
||||
{
|
||||
log.Log($"Retry {failure.TryNumber} took {Time.FormatDuration(failure.Duration)}. (HTTP timeout = {Time.FormatDuration(timeSet.HttpCallTimeout())}) " +
|
||||
$"Checking if node responds to debug/info...");
|
||||
log.Log($"Retry {failure.TryNumber} took {Time.FormatDuration(failure.Duration)} and failed with '{failure.Exception}'. " +
|
||||
$"(HTTP timeout = {Time.FormatDuration(timeSet.HttpCallTimeout())}) " +
|
||||
$"Checking if node responds to debug/info...");
|
||||
|
||||
try
|
||||
{
|
||||
var debugInfo = GetDebugInfo();
|
||||
|
@ -218,6 +220,13 @@ namespace CodexPlugin
|
|||
DownloadLog();
|
||||
Throw(failure);
|
||||
}
|
||||
|
||||
if (failure.Duration < timeSet.HttpCallTimeout())
|
||||
{
|
||||
log.Log("Retry failed within HTTP timeout duration.");
|
||||
DownloadLog();
|
||||
Throw(failure);
|
||||
}
|
||||
}
|
||||
|
||||
private void Throw(Failure failure)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using CodexPlugin;
|
||||
using MetricsPlugin;
|
||||
using DistTestCore;
|
||||
using FileUtils;
|
||||
using NUnit.Framework;
|
||||
|
@ -28,7 +27,7 @@ public class ScalabilityTests : CodexDistTest
|
|||
|
||||
var bootstrap = StartCodex(s => s.WithLogLevel(logLevel));
|
||||
var nodes = StartCodex(numberOfNodes - 1, s => s
|
||||
.EnableMetrics()
|
||||
//.EnableMetrics()
|
||||
.WithBootstrapNode(bootstrap)
|
||||
.WithLogLevel(logLevel)
|
||||
.WithStorageQuota((fileSizeInMb + 50).MB())
|
||||
|
@ -36,15 +35,15 @@ public class ScalabilityTests : CodexDistTest
|
|||
|
||||
var uploader = nodes.PickOneRandom();
|
||||
var downloader = nodes.PickOneRandom();
|
||||
var metrics = Ci.GetMetricsFor(uploader, downloader);
|
||||
//var metrics = Ci.GetMetricsFor(uploader, downloader);
|
||||
|
||||
var testFile = GenerateTestFile(fileSizeInMb.MB());
|
||||
|
||||
LogNodeStatus(uploader, metrics[0]);
|
||||
var contentId = uploader.UploadFile(testFile, f => LogNodeStatus(uploader, metrics[0]));
|
||||
LogNodeStatus(uploader);
|
||||
var contentId = uploader.UploadFile(testFile, f => LogNodeStatus(uploader));
|
||||
|
||||
LogNodeStatus(downloader, metrics[1]);
|
||||
var downloadedFile = downloader.DownloadContent(contentId, f => LogNodeStatus(downloader, metrics[1]));
|
||||
LogNodeStatus(downloader);
|
||||
var downloadedFile = downloader.DownloadContent(contentId, f => LogNodeStatus(downloader));
|
||||
|
||||
downloadedFile!.AssertIsEqual(testFile);
|
||||
|
||||
|
|
|
@ -104,8 +104,7 @@ namespace CodexTests
|
|||
public void LogNodeStatus(ICodexNode node, IMetricsAccess? metrics = null)
|
||||
{
|
||||
Log("Status for " + node.GetName() + Environment.NewLine +
|
||||
GetBasicNodeStatus(node) +
|
||||
GetNodeMetrics(metrics));
|
||||
GetBasicNodeStatus(node));
|
||||
}
|
||||
|
||||
private string GetBasicNodeStatus(ICodexNode node)
|
||||
|
@ -114,13 +113,14 @@ namespace CodexTests
|
|||
node.Space().ToString() + Environment.NewLine;
|
||||
}
|
||||
|
||||
private string GetNodeMetrics(IMetricsAccess? metrics)
|
||||
{
|
||||
if (metrics == null) return "No metrics enabled";
|
||||
var m = metrics.GetAllMetrics();
|
||||
if (m == null) return "No metrics received";
|
||||
return m.AsCsv();
|
||||
}
|
||||
// Disabled for now: Makes huge log files!
|
||||
//private string GetNodeMetrics(IMetricsAccess? metrics)
|
||||
//{
|
||||
// if (metrics == null) return "No metrics enabled";
|
||||
// var m = metrics.GetAllMetrics();
|
||||
// if (m == null) return "No metrics received";
|
||||
// return m.AsCsv();
|
||||
//}
|
||||
|
||||
protected virtual void OnCodexSetup(ICodexSetup setup)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue