Rapporto di diagnostica della raccolta (#39)
Dopo una prova dal vivo andata male, Alberto deve poter mandare un solo file che spieghi perché, senza che nessuno veda dati di altre persone. Attività ha ora il pulsante «Diagnostica», che scarica il rapporto delle sessioni degli ultimi 14 giorni: pagine aperte e forma degli indirizzi, risposte per tipo, stato e dimensione con ciò che i lettori ne hanno fatto, struttura stretta delle forme sconosciute, ricette, segnali, permessi negati, file in coda e scaricati, e il motivo di ogni arresto. Nel rapporto entrano solo valori da elenchi chiusi, numeri, orari e forme: mai nomi, indirizzi completi, codici, cursori, cookie o pezzi di risposte. Le forme degli indirizzi e la regola delle chiavi-dato passano dalla sonda a Core, e la sonda le richiama. Il registratore non lancia mai eccezioni verso la raccolta e tiene i file in Dati/diagnostica per 14 giorni. Prova che il rapporto non contiene valori, con controlli di mutazione; tre giri di revisione avversaria (25 difetti confermati, tutti corretti). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bf03cb45a5
commit
badd1681a0
55 files changed
+5395
-134
No files matched your search
@@ -8,6 +8,7 @@ using Febe.Browser.Recipes;
|
||||
using Febe.Browser.Targets;
|
||||
using Febe.Core.Abstractions;
|
||||
using Febe.Core.Collection;
|
||||
using Febe.Core.Collection.Diagnostics;
|
||||
using Febe.Core.Collection.Downloads;
|
||||
using Febe.Core.Collection.Readers;
|
||||
using Febe.Core.Collection.Recipes;
|
||||
@@ -127,13 +128,21 @@ internal sealed class CollectionHarness : IAsyncDisposable
|
||||
/// <summary>The engine session the recipes run in (a real row: events refer to it).</summary>
|
||||
public TestSession Session { get; private set; } = new();
|
||||
|
||||
public static async Task<CollectionHarness> CreateAsync(SharedChromium chromium, RecipeOptions? options = null, double factor = 10)
|
||||
/// <summary>The recorder of the diagnostic report, when asked for: what the page does goes to <see cref="Session"/>.</summary>
|
||||
public CollectionDiagnostics? Diagnostics { get; private set; }
|
||||
|
||||
public static async Task<CollectionHarness> CreateAsync(SharedChromium chromium, RecipeOptions? options = null, double factor = 10, bool diagnostics = false)
|
||||
{
|
||||
var site = await SyntheticSite.StartAsync();
|
||||
var temp = new TempFolder("raccolta");
|
||||
var library = await TestLibrary.CreateAsync(temp);
|
||||
var clock = new CompressedClock(factor, TestZones.Rome);
|
||||
var harness = new CollectionHarness(chromium, site, temp, library, clock);
|
||||
if (diagnostics)
|
||||
{
|
||||
harness.Diagnostics = new CollectionDiagnostics(clock, () => harness.Session.SessionId);
|
||||
}
|
||||
|
||||
harness.Pipeline = await CollectionPipeline.StartAsync(new CollectionPipelineOptions
|
||||
{
|
||||
Cdp = chromium.Cdp,
|
||||
@@ -147,6 +156,7 @@ internal sealed class CollectionHarness : IAsyncDisposable
|
||||
Random = new SeededRandom(20261013),
|
||||
StagingFolder = temp.Combine("dati", "temporanei"),
|
||||
Recipes = options ?? new RecipeOptions(),
|
||||
Diagnostics = harness.Diagnostics,
|
||||
});
|
||||
harness.Session = new TestSession((await library.Db.Sessions.StartAsync(clock.Now)).Id);
|
||||
await harness.SignInAsync();
|
||||
|
||||
Reference in new issue
Block a user