File size: 1,087 Bytes
5eaaf83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# progress_check.ps1 - worldfix v2 progress (ASCII-safe, race-tolerant)
$base = Join-Path $PSScriptRoot 'data'
$chunk=[long](2388787200/16); $done=[long]0; $readOK=0
foreach($m in Get-ChildItem $base -Recurse -Filter 'manifest.json' -ErrorAction SilentlyContinue){
  $j=$null
  for($try=0;$try -lt 4 -and -not $j;$try++){
    try{
      $raw=Get-Content $m.FullName -Raw -ErrorAction Stop|ConvertFrom-Json -ErrorAction Stop
      $p=[long]$raw.pos; $h=[long]$raw.hi
      $wid=[int]($m.Directory.Name.Substring(1))
      $lo=[long]($wid*$chunk)
      if($p -ge $lo -and $p -le $h){ $j=@{pos=$p;hi=$h;lo=$lo} }
    }catch{ Start-Sleep -Milliseconds 250 }
  }
  if($j){ $done += [Math]::Min($j.pos,$j.hi) - $j.lo; $readOK++ }
}
$gz=@(Get-ChildItem $base -Recurse -Filter '*.jsonl.gz' -ErrorAction SilentlyContinue)
$gb=[math]::Round(($gz|Measure-Object Length -Sum).Sum/1GB,2)
$pct=[math]::Round($done/2388787200*100,2)
$etaMin=[math]::Round((2388787200-$done)/216000/60)
"PROGRESS: $done / 2388787200 ($pct%) | manifests-read $readOK/16 | shards $($gz.Count) | $gb GB | ETA ~${etaMin}min"