提交 60a8b465 编写于 作者: K kieferrm

removing disposingInput and resolvingInput events

上级 09ab2c48
......@@ -13,8 +13,6 @@ import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUt
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { marked } from 'vs/base/common/marked/marked';
import { Schemas } from 'vs/base/common/network';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ILifecycleService, ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle';
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
export class WalkThroughModel extends EditorModel {
......@@ -56,19 +54,15 @@ export class WalkThroughInput extends EditorInput {
private promise: TPromise<WalkThroughModel>;
private resolveTime: number;
private maxTopScroll = 0;
private maxBottomScroll = 0;
constructor(
private options: WalkThroughInputOptions,
@ITelemetryService private telemetryService: ITelemetryService,
@ILifecycleService lifecycleService: ILifecycleService,
@ITextModelService private textModelResolverService: ITextModelService,
@IHashService private hashService: IHashService
) {
super();
this.disposables.push(lifecycleService.onShutdown(e => this.disposeTelemetry(e)));
}
getResource(): URI {
......@@ -110,7 +104,6 @@ export class WalkThroughInput extends EditorInput {
resolve(refresh?: boolean): TPromise<WalkThroughModel> {
if (!this.promise) {
this.resolveTelemetry();
this.promise = this.textModelResolverService.createModelReference(this.options.resource)
.then(ref => {
if (strings.endsWith(this.getResource().path, '.html')) {
......@@ -160,8 +153,6 @@ export class WalkThroughInput extends EditorInput {
this.promise = null;
}
this.disposeTelemetry();
super.dispose();
}
......@@ -169,40 +160,4 @@ export class WalkThroughInput extends EditorInput {
this.maxTopScroll = Math.max(this.maxTopScroll, topScroll);
this.maxBottomScroll = Math.max(this.maxBottomScroll, bottomScroll);
}
private resolveTelemetry() {
if (!this.resolveTime) {
this.resolveTime = Date.now();
/* __GDPR__
"resolvingInput" : {
"target" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryService.publicLog('resolvingInput', {
target: this.getTelemetryFrom(),
});
}
}
private disposeTelemetry(reason?: ShutdownReason) {
if (this.resolveTime) {
/* __GDPR__
"disposingInput" : {
"target" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"timeSpent": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"reason": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"maxTopScroll": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"maxBottomScroll": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryService.publicLog('disposingInput', {
target: this.getTelemetryFrom(),
timeSpent: (Date.now() - this.resolveTime) / 60,
reason: reason ? ShutdownReason[reason] : 'DISPOSE',
maxTopScroll: this.maxTopScroll,
maxBottomScroll: this.maxBottomScroll,
});
this.resolveTime = null;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册