提交 15259692 编写于 作者: C Christof Marti

Update on remotes telemetry

上级 63f840ff
...@@ -18,7 +18,7 @@ import { IOptions } from 'vs/workbench/common/options'; ...@@ -18,7 +18,7 @@ import { IOptions } from 'vs/workbench/common/options';
const GitProtocolMatcher = /^git@([^:]+):/; const GitProtocolMatcher = /^git@([^:]+):/;
const SecondLevelDomainMatcher = /[^.]+.[^.]+$/; const SecondLevelDomainMatcher = /[^.]+.[^.]+$/;
const RemoteMatcher = /^\s+url\s+=\s+(.+)$/mg; const RemoteMatcher = /^\s*url\s*=\s*(.+\S)\s*$/mg;
type Tags = { [index: string]: boolean | number }; type Tags = { [index: string]: boolean | number };
...@@ -150,9 +150,13 @@ export class WorkspaceStats { ...@@ -150,9 +150,13 @@ export class WorkspaceStats {
if (match) { if (match) {
return this.stripLowLevelDomains(match[1]); return this.stripLowLevelDomains(match[1]);
} }
let uri = URI.parse(url); try {
if (uri) { let uri = URI.parse(url);
return this.stripLowLevelDomains(uri.authority); if (uri.authority) {
return this.stripLowLevelDomains(uri.authority);
}
} catch (e) {
// ignore
} }
return null; return null;
} }
...@@ -174,10 +178,13 @@ export class WorkspaceStats { ...@@ -174,10 +178,13 @@ export class WorkspaceStats {
content => { content => {
if (content) { if (content) {
let domains = this.getDomainsOfRemotes(content.value); let domains = this.getDomainsOfRemotes(content.value);
this.telemetryService.publicLog('workspce.remotes', domains); this.telemetryService.publicLog('workspace.remotes', domains);
} }
},
err => {
// ignore
} }
); ).then(null, errors.onUnexpectedError);
} }
private reportAzureNode(workspaceUri: URI, tags: Tags): winjs.TPromise<Tags> { private reportAzureNode(workspaceUri: URI, tags: Tags): winjs.TPromise<Tags> {
...@@ -221,9 +228,9 @@ export class WorkspaceStats { ...@@ -221,9 +228,9 @@ export class WorkspaceStats {
return this.reportAzureJava(uri, tags); return this.reportAzureJava(uri, tags);
}).then((tags) => { }).then((tags) => {
if (tags['node'] || tags['java']) { if (tags['node'] || tags['java']) {
this.telemetryService.publicLog('workspce.azure', tags); this.telemetryService.publicLog('workspace.azure', tags);
} }
}); }).then(null, errors.onUnexpectedError);
} }
public reportCloudStats(): void { public reportCloudStats(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册