Skip to content

Commit 7539504

Browse files
nlfisaacs
authored andcommitted
remove the metrics sender
PR-URL: #2382 Credit: @nlf Close: #2382 Reviewed-by: @isaacs
1 parent 0ad958f commit 7539504

File tree

12 files changed

+0
-193
lines changed

12 files changed

+0
-193
lines changed

docs/content/using-npm/config.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -744,13 +744,6 @@ Commit message which is used by `npm version` when creating version commit.
744744

745745
Any "%s" in the message will be replaced with the version number.
746746

747-
#### metrics-registry
748-
749-
* Default: The value of `registry` (which defaults to "https://registry.npmjs.org/")
750-
* Type: String
751-
752-
The registry you want to send cli metrics to if `send-metrics` is true.
753-
754747
#### node-options
755748

756749
* Default: null
@@ -1089,16 +1082,6 @@ searches.
10891082
The age of the cache, in seconds, before another registry request is made if
10901083
using legacy search endpoint.
10911084

1092-
#### send-metrics
1093-
1094-
* Default: false
1095-
* Type: Boolean
1096-
1097-
If true, success/failure metrics will be reported to the registry stored in
1098-
`metrics-registry`. These requests contain the number of successful and
1099-
failing runs of the npm CLI and the time period over which those counts were
1100-
gathered. No identifying information is included in these requests.
1101-
11021085
#### shell
11031086

11041087
* Default: SHELL environment variable, or "bash" on Posix, or "cmd" on

lib/npm.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ const npm = module.exports = new class extends EventEmitter {
207207

208208
this.projectScope = this.config.get('scope') ||
209209
getProjectScope(this.prefix)
210-
211-
startMetrics()
212210
}
213211

214212
get flatOptions () {
@@ -297,7 +295,6 @@ const npm = module.exports = new class extends EventEmitter {
297295

298296
const log = require('npmlog')
299297
const { promisify } = require('util')
300-
const startMetrics = require('./utils/metrics.js').start
301298

302299
const which = promisify(require('which'))
303300

lib/utils/config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ const defaults = {
120120
long: false,
121121
maxsockets: 50,
122122
message: '%s',
123-
'metrics-registry': null,
124123
'node-options': null,
125124
'node-version': process.version,
126125
noproxy: null,
@@ -159,7 +158,6 @@ const defaults = {
159158
searchlimit: 20,
160159
searchopts: '',
161160
searchstaleness: 15 * 60,
162-
'send-metrics': false,
163161
shell,
164162
shrinkwrap: true,
165163
'sign-git-commit': false,
@@ -273,7 +271,6 @@ const types = {
273271
long: Boolean,
274272
maxsockets: Number,
275273
message: String,
276-
'metrics-registry': [null, String],
277274
'node-options': [null, String],
278275
'node-version': [null, semver],
279276
noproxy: [null, String, Array],
@@ -312,7 +309,6 @@ const types = {
312309
searchlimit: Number,
313310
searchopts: String,
314311
searchstaleness: Number,
315-
'send-metrics': Boolean,
316312
shell: String,
317313
shrinkwrap: Boolean,
318314
'sign-git-commit': Boolean,

lib/utils/error-handler.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ let wroteLogFile = false
77
let exitCode = 0
88
const errorMessage = require('./error-message.js')
99
const replaceInfo = require('./replace-info.js')
10-
const stopMetrics = require('./metrics.js').stop
1110

1211
const cacheFile = require('./cache-file.js')
1312

@@ -43,9 +42,6 @@ process.on('exit', code => {
4342
}
4443
}
4544

46-
// kill any outstanding stats reporter if it hasn't finished yet
47-
stopMetrics()
48-
4945
if (code)
5046
itWorked = false
5147
if (itWorked)

lib/utils/flat-options.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ const flatten = obj => ({
5050
cache: join(obj.cache, '_cacache'),
5151
global: obj.global,
5252

53-
metricsRegistry: obj['metrics-registry'] || obj.registry,
54-
sendMetrics: obj['send-metrics'],
5553
registry: obj.registry,
5654
scope: obj.scope,
5755
access: obj.access,

lib/utils/metrics-launch.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

lib/utils/metrics.js

Lines changed: 0 additions & 80 deletions
This file was deleted.

tap-snapshots/test-lib-utils-config.js-TAP.test.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ Object {
8282
"long": false,
8383
"maxsockets": 50,
8484
"message": "%s",
85-
"metrics-registry": null,
8685
"node-options": null,
8786
"node-version": "v14.8.0",
8887
"noproxy": null,
@@ -120,7 +119,6 @@ Object {
120119
"searchlimit": 20,
121120
"searchopts": "",
122121
"searchstaleness": 900,
123-
"send-metrics": false,
124122
"shell": "cmd.exe",
125123
"shrinkwrap": true,
126124
"sign-git-commit": false,
@@ -423,10 +421,6 @@ Object {
423421
"long": "{Boolean TYPE}",
424422
"maxsockets": "{Number TYPE}",
425423
"message": "{String TYPE}",
426-
"metrics-registry": Array [
427-
null,
428-
"{String TYPE}",
429-
],
430424
"node-options": Array [
431425
null,
432426
"{String TYPE}",
@@ -509,7 +503,6 @@ Object {
509503
"searchlimit": "{Number TYPE}",
510504
"searchopts": "{String TYPE}",
511505
"searchstaleness": "{Number TYPE}",
512-
"send-metrics": "{Boolean TYPE}",
513506
"shell": "{String TYPE}",
514507
"shrinkwrap": "{Boolean TYPE}",
515508
"sign-git-commit": "{Boolean TYPE}",
@@ -616,7 +609,6 @@ Object {
616609
"long": false,
617610
"maxsockets": 50,
618611
"message": "%s",
619-
"metrics-registry": null,
620612
"node-options": null,
621613
"node-version": "v14.8.0",
622614
"noproxy": null,
@@ -654,7 +646,6 @@ Object {
654646
"searchlimit": 20,
655647
"searchopts": "",
656648
"searchstaleness": 900,
657-
"send-metrics": false,
658649
"shell": "cmd.exe",
659650
"shrinkwrap": true,
660651
"sign-git-commit": false,
@@ -957,10 +948,6 @@ Object {
957948
"long": "{Boolean TYPE}",
958949
"maxsockets": "{Number TYPE}",
959950
"message": "{String TYPE}",
960-
"metrics-registry": Array [
961-
null,
962-
"{String TYPE}",
963-
],
964951
"node-options": Array [
965952
null,
966953
"{String TYPE}",
@@ -1043,7 +1030,6 @@ Object {
10431030
"searchlimit": "{Number TYPE}",
10441031
"searchopts": "{String TYPE}",
10451032
"searchstaleness": "{Number TYPE}",
1046-
"send-metrics": "{Boolean TYPE}",
10471033
"shell": "{String TYPE}",
10481034
"shrinkwrap": "{Boolean TYPE}",
10491035
"sign-git-commit": "{Boolean TYPE}",
@@ -1150,7 +1136,6 @@ Object {
11501136
"long": false,
11511137
"maxsockets": 50,
11521138
"message": "%s",
1153-
"metrics-registry": null,
11541139
"node-options": null,
11551140
"node-version": "v14.8.0",
11561141
"noproxy": null,
@@ -1188,7 +1173,6 @@ Object {
11881173
"searchlimit": 20,
11891174
"searchopts": "",
11901175
"searchstaleness": 900,
1191-
"send-metrics": false,
11921176
"shell": "/usr/local/bin/bash",
11931177
"shrinkwrap": true,
11941178
"sign-git-commit": false,
@@ -1493,10 +1477,6 @@ Object {
14931477
"long": "{Boolean TYPE}",
14941478
"maxsockets": "{Number TYPE}",
14951479
"message": "{String TYPE}",
1496-
"metrics-registry": Array [
1497-
null,
1498-
"{String TYPE}",
1499-
],
15001480
"node-options": Array [
15011481
null,
15021482
"{String TYPE}",
@@ -1579,7 +1559,6 @@ Object {
15791559
"searchlimit": "{Number TYPE}",
15801560
"searchopts": "{String TYPE}",
15811561
"searchstaleness": "{Number TYPE}",
1582-
"send-metrics": "{Boolean TYPE}",
15831562
"shell": "{String TYPE}",
15841563
"shrinkwrap": "{Boolean TYPE}",
15851564
"sign-git-commit": "{Boolean TYPE}",

tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Object {
5454
"log": Object {},
5555
"long": undefined,
5656
"message": "message",
57-
"metricsRegistry": "metrics-registry",
5857
"nodeBin": "/path/to/some/node",
5958
"nodeVersion": "1.2.3",
6059
"noProxy": "noproxy",
@@ -100,7 +99,6 @@ Object {
10099
},
101100
"staleness": "searchstaleness",
102101
},
103-
"sendMetrics": "send-metrics",
104102
"shell": undefined,
105103
"signGitCommit": "sign-git-commit",
106104
"signGitTag": "sign-git-tag",

0 commit comments

Comments
 (0)