Commit Graph

3 Commits

Author SHA1 Message Date
Mark Thomas
e8908fa603 clienttelemetry: announce remote hostname only when stderr is a tty
Summary:
Some tools parse the output of hg, and the addition of the `connected to
hostname` line breaks them.

Fix this by changing the default behaviour of clienttelemetry to output
to stderr, but only when plain and quiet are not set, and when stderr
is a tty.

Differential Revision: D7616326

fbshipit-source-id: 6eb329c75a7e8cf6e5ab43aa5ac36be82d1d2e7d
2018-04-13 21:51:54 -07:00
Mark Thomas
6ea1e7437d clienttelemetry: correctly log full command line
Summary:
The full command line needs to come from the `dispatch.runcommand` function, as
`sys.argv` contains `serve ...` for chg invocations.

Also make sure the correlator remains the same for commands that make multiple
connections to the server.

Reviewed By: quark-zju

Differential Revision: D7443727

fbshipit-source-id: a785e372b7b67fbd0b4ab4d73e7ff914aa5db9c3
2018-04-13 21:51:45 -07:00
Mark Thomas
93b97b7fe1 clienttelemetry: record client details in server telemetry
Summary:
Add a new extension, `clienttelemetry`, which sends information about the
client to the server.  This information is logged by the server, which can use
the `sampling` extension to store this information for later analysis.

Includes a few basic pieces of information by default, including a correlator
which can be used to correlate logs from the client and the server.

Reviewed By: mjpieters

Differential Revision: D7271508

fbshipit-source-id: f152fe177d8bc73179d3a2c4d0d070d468885e2a
2018-04-13 21:51:29 -07:00