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
@@ -0,0 +1,40 @@
|
||||
using Febe.Core.Collection.Diagnostics;
|
||||
|
||||
namespace Febe.Web.Engine;
|
||||
|
||||
/// <summary>
|
||||
/// The traces of the diagnostic report (issue #39) for «Esporta il rapporto di diagnostica» in Attività: the finished
|
||||
/// ones of the last two weeks and the ones in progress, oldest first. They hold no data value
|
||||
/// (<see cref="SessionTrace"/>).
|
||||
/// </summary>
|
||||
public interface IDiagnosticSource
|
||||
{
|
||||
Task<IReadOnlyList<SessionTrace>> ListAsync(CancellationToken ct);
|
||||
|
||||
/// <summary>
|
||||
/// The traces with what the report must say about itself (damaged lines of the log, errors of the recorder). By
|
||||
/// default the traces of <see cref="ListAsync"/> with nothing lost.
|
||||
/// </summary>
|
||||
async Task<DiagnosticCollection> GatherAsync(CancellationToken ct) =>
|
||||
new(await ListAsync(ct).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
/// <summary>The traces of the recorder of the running Febe (its log in <c>Dati/diagnostica</c>, and what is open).</summary>
|
||||
public sealed class RecordedDiagnosticSource(CollectionDiagnostics diagnostics) : IDiagnosticSource
|
||||
{
|
||||
public Task<IReadOnlyList<SessionTrace>> ListAsync(CancellationToken ct) =>
|
||||
Task.Run(diagnostics.Collect, ct);
|
||||
|
||||
public Task<DiagnosticCollection> GatherAsync(CancellationToken ct) =>
|
||||
Task.Run(diagnostics.Gather, ct);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The default when the composition registers no recorder (tests, a start with a configuration problem, where the
|
||||
/// engine never started): nothing was recorded, so the report has empty lists.
|
||||
/// </summary>
|
||||
public sealed class NoDiagnosticSource : IDiagnosticSource
|
||||
{
|
||||
public Task<IReadOnlyList<SessionTrace>> ListAsync(CancellationToken ct) =>
|
||||
Task.FromResult<IReadOnlyList<SessionTrace>>([]);
|
||||
}
|
||||
Reference in new issue
Block a user