From 2f1c14fc98a6598e2a8f225d15efc53f211d50ca Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Thu, 5 Oct 2017 16:30:20 +0300 Subject: [PATCH] graphite-tags: refactor, improve performance - remove unnecessary parseTarget() calls --- public/app/plugins/datasource/graphite/query_ctrl.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/datasource/graphite/query_ctrl.ts b/public/app/plugins/datasource/graphite/query_ctrl.ts index c794d5c15c1..792aa86f6ee 100644 --- a/public/app/plugins/datasource/graphite/query_ctrl.ts +++ b/public/app/plugins/datasource/graphite/query_ctrl.ts @@ -417,8 +417,8 @@ export class GraphiteQueryCtrl extends QueryCtrl { let newTagParam = renderTagString(tag); this.getSeriesByTagFunc().params[tagIndex] = newTagParam; + this.tags[tagIndex] = tag; this.targetChanged(); - this.parseTarget(); } getSeriesByTagFuncIndex() { @@ -439,15 +439,15 @@ export class GraphiteQueryCtrl extends QueryCtrl { let newTag = {key: newTagKey, operator: '=', value: 'select tag value'}; let newTagParam = renderTagString(newTag); this.getSeriesByTagFunc().params.push(newTagParam); + this.tags.push(newTag); this.targetChanged(); - this.parseTarget(); + this.fixTagSegments(); } removeTag(index) { this.getSeriesByTagFunc().params.splice(index, 1); - + this.tags.splice(index, 1); this.targetChanged(); - this.parseTarget(); } fixTagSegments() {