Adds performance logging

This commit is contained in:
Eric Amodio
2017-09-14 22:45:23 -04:00
parent aacf7cc2b5
commit 0fdf856c27
3 changed files with 14 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import { Annotations, endOfLineIndex } from './annotations';
import { FileAnnotationType } from './annotationController';
import { AnnotationProviderBase } from './annotationProvider';
import { GitService, GitUri } from '../gitService';
import { Logger } from '../logger';
export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
@@ -20,6 +21,8 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
const diff = await this.git.getDiffForFile(this.uri, commit.previousSha);
if (diff === undefined) return false;
const start = process.hrtime();
const cfg = this._config.annotations.file.recentChanges;
const dateFormat = this._config.defaultDateFormat;
@@ -62,6 +65,9 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
this.editor.setDecorations(this.highlightDecoration!, decorators);
const duration = process.hrtime(start);
Logger.log(`${(duration[0] * 1000) + Math.floor(duration[1] / 1000000)} ms to compute recent changes annotations`);
return true;
}