-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional periodic watcher health check
Summary: Adds the ability to periodically check the health of the filesystem watcher by writing a temporary file to the project and waiting for it to be observed. This is off by default and does not generally need to be turned on by end users. It's primarily useful for debugging/monitoring the reliability of the underlying watcher or filesystem. Implementation approach: * The `Watcher` class (new in D39891465 (dc02eac)) now has a `checkHealth` method that returns a machine-readable description of the result of a health check (success, timeout or error, plus some metadata). * The `Watcher` class hides health check files from `HasteMap`; it excludes them from crawl results and doesn't forward notifications about them. * If health checks are enabled, `HasteMap` performs one as soon as a watch is established, and sets an interval to run checks periodically. * `HasteMap` emits `healthCheck` events with health check results. * `DependencyGraph` converts `healthCheck` events to `ReportableEvent`s and logs them via the current `reporter`. * `TerminalReporter` prints a human-readable version of the health check result when there is a relevant change. Changelog: * **[Feature]**: Add configurable watcher health check that is off by default. Reviewed By: robhogan Differential Revision: D40352039 fbshipit-source-id: 75ed4bd845b7919cfee4f64223a24444c98d1735
- Loading branch information
1 parent
0006a7e
commit 7adf468
Showing
15 changed files
with
329 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow strict | ||
* @format | ||
*/ | ||
|
||
// An incomplete definition for Node's builtin `perf_hooks` module. | ||
|
||
declare module 'perf_hooks' { | ||
declare export var performance: { | ||
clearMarks(name?: string): void, | ||
mark(name?: string): void, | ||
measure(name: string, startMark?: string, endMark?: string): void, | ||
nodeTiming: mixed /* FIXME */, | ||
now(): number, | ||
timeOrigin: number, | ||
timerify<TArgs: Iterable<mixed>, TReturn>( | ||
f: (...TArgs) => TReturn, | ||
): (...TArgs) => TReturn, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.