Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientInfo ¶
type Index ¶
type Index struct {
Generated int64 `json:"generated"`
Entries []IndexEntry `json:"entries"`
}
Index represents the complete index structure
type IndexClientInfo ¶
type IndexClientInfo struct {
Name string `json:"name"`
Type string `json:"type"`
Image string `json:"image"`
Version string `json:"version"`
}
IndexClientInfo represents client information in the index
type IndexEntry ¶
type IndexEntry struct {
RunID string `json:"run_id"`
Timestamp int64 `json:"timestamp"`
Network string `json:"network"`
Labels map[string]string `json:"labels,omitempty"`
ExecutionClientInfo IndexClientInfo `json:"execution_client_info"`
ConsensusClientInfo IndexClientInfo `json:"consensus_client_info"`
SyncInfo IndexSyncInfo `json:"sync_info"`
MainFile string `json:"main_file"`
ProgressFile string `json:"progress_file"`
}
IndexEntry represents a single entry in the index
type IndexService ¶
type IndexService interface {
GenerateIndex(ctx context.Context, reportDir string) (*Index, error)
SaveIndex(ctx context.Context, index *Index, outputPath string) error
}
IndexService defines the interface for index operations
func NewIndexService ¶
func NewIndexService(log logrus.FieldLogger) IndexService
NewIndexService creates a new index service
type IndexSyncInfo ¶
type IndexSyncInfo struct {
Start int64 `json:"start"`
End int64 `json:"end"`
Duration int64 `json:"duration"`
Status string `json:"status,omitempty"`
StatusMessage string `json:"status_message,omitempty"`
Block uint64 `json:"block"`
Slot uint64 `json:"slot"`
EntriesCount int `json:"entries_count"`
LastEntry *SyncProgressEntry `json:"last_entry,omitempty"`
}
IndexSyncInfo represents sync information in the index
type Result ¶
type Result struct {
RunID string `json:"run_id"`
Timestamp int64 `json:"timestamp"`
Network string `json:"network"`
Labels map[string]string `json:"labels,omitempty"`
SyncStatus SyncStatus `json:"sync_status"`
ExecutionClientInfo ClientInfo `json:"execution_client_info"`
ConsensusClientInfo ClientInfo `json:"consensus_client_info"`
SystemInfo *sysinfo.SystemInfo `json:"system_info,omitempty"`
}
type Service ¶
type Service interface {
Start(ctx context.Context) error
AddSyncProgressEntry(ctx context.Context, entry SyncProgressEntry) error
SetConsensusClientInfo(ctx context.Context, info *ClientInfo) error
SetExecutionClientInfo(ctx context.Context, info *ClientInfo) error
SetBlockNumber(ctx context.Context, blockNumber uint64) error
SetSlotNumber(ctx context.Context, slotNumber uint64) error
SetSyncStatus(ctx context.Context, status string, message string) error
SetLabels(ctx context.Context, labels map[string]string) error
SetNetwork(ctx context.Context, network string) error
SetSystemInfo(ctx context.Context, info *sysinfo.SystemInfo) error
SaveReportToFiles(ctx context.Context, baseFilename string, reportDir string) error
Stop(ctx context.Context) error
// Temporary report methods for recovery
SaveTempReport(ctx context.Context, report *Result) error
LoadTempReport(ctx context.Context, network, elClient, clClient string) (*Result, error)
RemoveTempReport(ctx context.Context, network, elClient, clClient string) error
ListTempReports(ctx context.Context) ([]string, error)
// Get current report state
GetCurrentReport(ctx context.Context) (*Result, error)
// Restore report state from recovered data
RestoreReportState(ctx context.Context, restoredReport *Result) error
}
Service defines the interface for report generation
func NewService ¶
func NewService(log logrus.FieldLogger) Service
NewService creates a new report service
type SyncProgressEntry ¶
type SyncProgressEntry struct {
T int64 `json:"t"` // Timestamp
Block uint64 `json:"b"` // Execution client block number
Slot uint64 `json:"s"` // Consensus client slot number
DiskUsageExecutionClient uint64 `json:"de"` // Execution client disk usage (bytes)
DiskUsageConsensusClient uint64 `json:"dc"` // Consensus client disk usage (bytes)
PeersExecutionClient uint64 `json:"pe"` // Execution client peers
PeersConsensusClient uint64 `json:"pc"` // Consensus client peers
}
SyncProgressEntry represents the progress data at a specific timestamp
type SyncStatus ¶
type SyncStatus struct {
Start int64 `json:"start"`
End int64 `json:"end"`
Status string `json:"status"` // "success", "timeout", "cancelled", "error"
StatusMessage string `json:"status_message,omitempty"` // Detailed message about the status
Block uint64 `json:"block"`
Slot uint64 `json:"slot"`
SyncProgress []SyncProgressEntry `json:"sync_progress,omitempty"`
SyncProgressFile string `json:"sync_progress_file,omitempty"`
LastEntry *SyncProgressEntry `json:"last_entry,omitempty"`
EntriesCount int `json:"entries_count"`
ErrorDetails map[string]interface{} `json:"error_details,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.