Commit Graph

4 Commits

Author SHA1 Message Date
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
Mark Thomas
94257a258b blackbox: clean up blackbox logging and log more during rage
Summary:
Clean up some of the calls to `ui.log` and how they appear in blackbox logging.

* Make the names of the events consistently use `snake_case`.
* For watchman, only log once for each watchman command.  Include whether or not it failed.
* Unify `fsmonitor` logging under the `fsmonitor` event.
* Omit the second argument when it is empty - it is optional and does nothing when empty.
* Increase the number of blackbox lines included in rage to 100.

Reviewed By: quark-zju

Differential Revision: D14949868

fbshipit-source-id: a9aa8251e71ae7ca556c08116f8f7c61ff472218
2019-04-23 02:48:50 -07:00
Jun Wu
13c490cf4e fsmonitor: use short list when logging notefiles
Summary:
The "fsmonitor returned" file list was made short by D9997658. Do the same
thing for notefiles.

Reviewed By: phillco

Differential Revision: D10865333

fbshipit-source-id: ff31cde04210363e6af04e5578543f1b16310b11
2018-10-29 20:26:34 -07:00
Jun Wu
051e7a99f0 fsmonitor: limit file list being logged to blackbox
Summary:
Sometimes watchman can return a very long list of files. That would make
blackbox rotate too frequently. Truncate that list.

Reviewed By: phillco

Differential Revision: D9997658

fbshipit-source-id: 1314b7c299a5f50ed344e0b85befd4c0525b1da7
2018-09-21 16:51:44 -07:00