Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
6a161216
Commit
6a161216
authored
Dec 15, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(influxdb): fixes bug with empty tagColumn for annotations
parent
51c4385c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
23 deletions
+49
-23
public/app/plugins/datasource/influxdb/influx_series.js
+1
-1
public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts
+48
-22
No files found.
public/app/plugins/datasource/influxdb/influx_series.js
View file @
6a161216
...
...
@@ -89,7 +89,7 @@ function (_, TableModel) {
if
(
column
===
'sequence_number'
)
{
return
;
}
if
(
!
titleCol
)
{
titleCol
=
index
;
}
if
(
column
===
self
.
annotation
.
titleColumn
)
{
titleCol
=
index
;
return
;
}
if
(
_
.
includes
(
self
.
annotation
.
tagsColumn
.
replace
(
' '
,
''
).
split
(
","
),
column
))
{
tagsCol
.
push
(
index
);
return
;
}
if
(
_
.
includes
(
(
self
.
annotation
.
tagsColumn
||
''
)
.
replace
(
' '
,
''
).
split
(
","
),
column
))
{
tagsCol
.
push
(
index
);
return
;
}
if
(
column
===
self
.
annotation
.
textColumn
)
{
textCol
=
index
;
return
;
}
});
...
...
public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts
View file @
6a161216
...
...
@@ -208,30 +208,56 @@ describe('when generating timeseries from influxdb response', function() {
});
describe
(
'given annotation response'
,
function
()
{
var
options
=
{
alias
:
''
,
annotation
:
{
tagsColumn
:
'datacenter, source'
},
series
:
[
{
name
:
"logins.count"
,
tags
:
{
datacenter
:
'Africa'
,
server
:
'server2'
},
columns
:
[
"time"
,
"datacenter"
,
"hostname"
,
"source"
,
"value"
],
values
:
[
[
1481549440372
,
"America"
,
"10.1.100.10"
,
"backend"
,
215.7432653659507
],
]
}
]
};
describe
(
'with empty tagsColumn'
,
function
()
{
var
options
=
{
alias
:
''
,
annotation
:
{},
series
:
[
{
name
:
"logins.count"
,
tags
:
{
datacenter
:
'Africa'
,
server
:
'server2'
},
columns
:
[
"time"
,
"datacenter"
,
"hostname"
,
"source"
,
"value"
],
values
:
[
[
1481549440372
,
"America"
,
"10.1.100.10"
,
"backend"
,
215.7432653659507
],
]
}
]
};
it
(
'should multiple tags'
,
function
()
{
var
series
=
new
InfluxSeries
(
options
);
var
annotations
=
series
.
getAnnotations
();
it
(
'should multiple tags'
,
function
()
{
var
series
=
new
InfluxSeries
(
options
);
var
annotations
=
series
.
getAnnotations
(
);
expect
(
annotations
[
0
].
tags
.
length
).
to
.
be
(
0
);
}
);
}
);
expect
(
annotations
[
0
].
tags
.
length
).
to
.
be
(
2
);
expect
(
annotations
[
0
].
tags
[
0
]).
to
.
be
(
'America'
);
expect
(
annotations
[
0
].
tags
[
1
]).
to
.
be
(
'backend'
);
describe
(
'given annotation response'
,
function
()
{
var
options
=
{
alias
:
''
,
annotation
:
{
tagsColumn
:
'datacenter, source'
},
series
:
[
{
name
:
"logins.count"
,
tags
:
{
datacenter
:
'Africa'
,
server
:
'server2'
},
columns
:
[
"time"
,
"datacenter"
,
"hostname"
,
"source"
,
"value"
],
values
:
[
[
1481549440372
,
"America"
,
"10.1.100.10"
,
"backend"
,
215.7432653659507
],
]
}
]
};
it
(
'should multiple tags'
,
function
()
{
var
series
=
new
InfluxSeries
(
options
);
var
annotations
=
series
.
getAnnotations
();
expect
(
annotations
[
0
].
tags
.
length
).
to
.
be
(
2
);
expect
(
annotations
[
0
].
tags
[
0
]).
to
.
be
(
'America'
);
expect
(
annotations
[
0
].
tags
[
1
]).
to
.
be
(
'backend'
);
});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment