sapling/tests/test-fsmonitor-blackbox.t
Jun Wu 1145e2541b logging: migrate fsmonitor to new blackbox API
Summary:
The new log is typed and concise.

Old log:

  [fsmonitor]> clock='c:1559600325:3956709:1:34762' len(nonnormal)=0
  [fsmonitor]> setlastclock 'c:1559600325:3956709:1:36405'
  [fsmonitor]> setlastisfresh False
  [fsmonitor]> watchman returned ["x"]
  [fsmonitor]> getlastclock 'c:1559600325:3956709:1:36405'
  [fsmonitor]> set clock='c:1559600325:3956709:1:36405' notefiles=["x"]

New log:

  [fsmonitor] clock: "c:1559600325:3956709:1:34762" -> "c:1559600325:3956709:1:36405"; need check: [] + ["x"]

In JSON form:

  {"fsmonitor":{"new_clock":"c:1559600325:3956709:1:36425","new_files":{"len":1,"short_list":["x"]},"old_clock":"c:1559600325:3956709:1:34762"}

The new logging does not cover every information exposed by the old logging.
For example:

- Non-treestate events like why fsmonitor state gets invalidated.
  Assuming most clients are on treestate now. These are removed.
- "fsmonitor_state = normal | unavailable | fresh" scuba logging. This can be
  inferred, and will be added in a later diff.
- New "notefiles". The next "fsmoniotr" event will log the information.

Reviewed By: markbt

Differential Revision: D15710672

fbshipit-source-id: 5c4cad08c0072c7dc711e5c1e65aa7552940699e
2019-07-06 02:46:17 -07:00

40 lines
623 B
Perl

#require fsmonitor
$ newrepo
$ hg status
$ touch x
$ hg status
? x
$ touch 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
$ hg status
? 1
? 10
? 11
? 12
? 13
? 14
? 15
? 16
? 17
? 18
? 19
? 2
? 20
? 21
? 22
? 23
? 24
? 25
? 3
? 4
? 5
? 6
? 7
? 8
? 9
? x
$ hg blackbox --pattern '{"fsmonitor":"_"}' --no-timestamp --no-sid
[fsmonitor] clock: "c:0:0" -> "*"; need check: [] + all files (glob)
[fsmonitor] clock: "*" -> "*"; need check: [] + ["x"] (glob)
[fsmonitor] clock: "*" -> "*"; need check: ["x"] + [*] and 20 entries (glob)