(db *badger.DB)
| 336 | } |
| 337 | |
| 338 | func jepsen(db *badger.DB) { |
| 339 | min, max := getMinMax(db, opt.readTs) |
| 340 | fmt.Printf("min=%d. max=%d\n", min, max) |
| 341 | |
| 342 | var ts uint64 |
| 343 | switch opt.jepsen { |
| 344 | case "binary": |
| 345 | ts = findFirstInvalidTxn(db, min, max) |
| 346 | case "linear": |
| 347 | ts = findFirstValidTxn(db) |
| 348 | } |
| 349 | fmt.Println() |
| 350 | if ts == 0 { |
| 351 | fmt.Println("Nothing found. Exiting.") |
| 352 | return |
| 353 | } |
| 354 | showAllPostingsAt(db, ts) |
| 355 | seekTotal(db, ts-1) |
| 356 | |
| 357 | for range 5 { |
| 358 | // Get a few previous commits. |
| 359 | _, ts = getMinMax(db, ts-1) |
| 360 | showAllPostingsAt(db, ts) |
| 361 | seekTotal(db, ts-1) |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | func history(lookup []byte, itr *badger.Iterator) { |
| 366 | var buf bytes.Buffer |
no test coverage detected