Skip to main content

JsonProgressReporter

  • Namespace: PPDS.Migration.Progress
  • Assembly: PPDS.Migration
  • Kind: Class
  • Implements: IProgressReporter

Summary

Progress reporter that writes JSON lines to a TextWriter. Used for CLI and VS Code extension integration.

Members

Constructors

JsonProgressReporter(TextWriter writer)

JsonProgressReporter(TextWriter writer)

Initializes a new instance of the PPDS.Migration.Progress.JsonProgressReporter class.

  • Param writer: The text writer to output JSON lines to.

Methods

Complete

void Complete(MigrationResult result)

Reports operation completion.

  • Param result: The migration result.

Error

void Error(Exception exception, string context)

Reports an error.

  • Param exception: The exception that occurred.

  • Param context: Optional context about what was happening.

Report

void Report(ProgressEventArgs args)

Reports a progress update.

  • Param args: The progress event data.

Reset

void Reset()

Resets the progress reporter for a new operation phase. Restarts the internal stopwatch and clears any cached state. Use this between phases (e.g., between export and import in a copy operation).

Properties

OperationName

string OperationName { get; set; }

Gets or sets the operation name for completion messages (e.g., "Export", "Import", "Copy").

ReportInterval

int ReportInterval { get; set; }

Gets or sets the minimum interval between progress reports (in records). Default is 100 to avoid flooding output.