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
7d2646f6
Commit
7d2646f6
authored
Sep 28, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: moved influxdb specs to plugins folder
parent
1a8bc1dd
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
34 deletions
+43
-34
public/app/plugins/datasource/influxdb/datasource.js
+3
-3
public/app/plugins/datasource/influxdb/influx_series.js
+0
-0
public/app/plugins/datasource/influxdb/query_builder.js
+0
-0
public/app/plugins/datasource/influxdb/query_ctrl.js
+1
-1
public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts
+22
-12
public/app/plugins/datasource/influxdb/specs/query_builder_specs.ts
+6
-7
public/app/plugins/datasource/influxdb/specs/query_ctrl_specs.ts
+11
-11
No files found.
public/app/plugins/datasource/influxdb/datasource.js
View file @
7d2646f6
...
...
@@ -2,10 +2,10 @@ define([
'angular'
,
'lodash'
,
'app/core/utils/datemath'
,
'./influx
S
eries'
,
'./query
B
uilder'
,
'./influx
_s
eries'
,
'./query
_b
uilder'
,
'./directives'
,
'./query
C
trl'
,
'./query
_c
trl'
,
],
function
(
angular
,
_
,
dateMath
,
InfluxSeries
,
InfluxQueryBuilder
)
{
'use strict'
;
...
...
public/app/plugins/datasource/influxdb/influx
S
eries.js
→
public/app/plugins/datasource/influxdb/influx
_s
eries.js
View file @
7d2646f6
File moved
public/app/plugins/datasource/influxdb/query
B
uilder.js
→
public/app/plugins/datasource/influxdb/query
_b
uilder.js
View file @
7d2646f6
File moved
public/app/plugins/datasource/influxdb/query
C
trl.js
→
public/app/plugins/datasource/influxdb/query
_c
trl.js
View file @
7d2646f6
define
([
'angular'
,
'lodash'
,
'./query
B
uilder'
,
'./query
_b
uilder'
,
],
function
(
angular
,
_
,
InfluxQueryBuilder
)
{
'use strict'
;
...
...
public/
test/specs/influxSeries-specs.j
s
→
public/
app/plugins/datasource/influxdb/specs/influx_series_specs.t
s
View file @
7d2646f6
define
([
'app/plugins/datasource/influxdb/influxSeries'
],
function
(
InfluxSeries
)
{
'use strict'
;
///<amd-dependency path="app/plugins/datasource/influxdb/influx_series" name="InfluxSeries"/>
describe
(
'when generating timeseries from influxdb response'
,
function
()
{
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
}
from
'test/lib/common'
;
declare
var
InfluxSeries
:
any
;
describe
(
'when generating timeseries from influxdb response'
,
function
()
{
describe
(
'given multiple fields for series'
,
function
()
{
var
options
=
{
series
:
[
var
options
=
{
alias
:
''
,
series
:
[
{
name
:
'cpu'
,
tags
:
{
app
:
'test'
,
server
:
'server1'
},
columns
:
[
'time'
,
'mean'
,
'max'
,
'min'
],
values
:
[[
1431946625000
,
10
,
11
,
9
],
[
1431946626000
,
20
,
21
,
19
]]
}
]};
]
};
describe
(
'and no alias'
,
function
()
{
it
(
'should generate multiple datapoints for each column'
,
function
()
{
var
series
=
new
InfluxSeries
(
options
);
...
...
@@ -96,7 +100,9 @@ define([
});
describe
(
'given two series'
,
function
()
{
var
options
=
{
series
:
[
var
options
=
{
alias
:
''
,
series
:
[
{
name
:
'cpu'
,
tags
:
{
app
:
'test'
,
server
:
'server1'
},
...
...
@@ -109,7 +115,8 @@ define([
columns
:
[
'time'
,
'mean'
],
values
:
[[
1431946625000
,
15
],
[
1431946626000
,
16
]]
}
]};
]
};
describe
(
'and no alias'
,
function
()
{
...
...
@@ -158,14 +165,17 @@ define([
});
describe
(
'given measurement with dots'
,
function
()
{
var
options
=
{
series
:
[
var
options
=
{
alias
:
''
,
series
:
[
{
name
:
'app.prod.server1.count'
,
tags
:
{},
columns
:
[
'time'
,
'mean'
],
values
:
[[
1431946625000
,
10
],
[
1431946626000
,
12
]]
}
]};
]
};
it
(
'should replace patterns'
,
function
()
{
options
.
alias
=
'alias: $1 -> [[3]]'
;
...
...
@@ -175,6 +185,6 @@ define([
expect
(
result
[
0
].
target
).
to
.
be
(
'alias: prod -> count'
);
});
});
});
});
public/
test/specs/influx09-querybuilder-specs.j
s
→
public/
app/plugins/datasource/influxdb/specs/query_builder_specs.t
s
View file @
7d2646f6
define
([
'app/plugins/datasource/influxdb/queryBuilder'
],
function
(
InfluxQueryBuilder
)
{
'use strict'
;
///<amd-dependency path="app/plugins/datasource/influxdb/query_builder" name="InfluxQueryBuilder"/>
//
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
}
from
'test/lib/common'
;
describe
(
'InfluxQueryBuilder'
,
function
()
{
declare
var
InfluxQueryBuilder
:
any
;
describe
(
'InfluxQueryBuilder'
,
function
()
{
describe
(
'series with mesurement only'
,
function
()
{
it
(
'should generate correct query'
,
function
()
{
...
...
@@ -182,6 +183,4 @@ define([
});
});
});
public/
test/specs/influxdbQueryCtrl-specs.j
s
→
public/
app/plugins/datasource/influxdb/specs/query_ctrl_specs.t
s
View file @
7d2646f6
define
([
'./helpers'
,
'app/plugins/datasource/influxdb/queryCtrl'
,
'app/services/uiSegmentSrv'
],
function
(
helpers
)
{
'use strict'
;
describe
(
'InfluxDBQueryCtrl'
,
function
()
{
///<amd-dependency path="app/plugins/datasource/influxdb/query_ctrl"/>
///<amd-dependency path="app/services/uiSegmentSrv" />
///<amd-dependency path="test/specs/helpers" name="helpers" />
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
,
angularMocks
}
from
'test/lib/common'
;
declare
var
helpers
:
any
;
describe
(
'InfluxDBQueryCtrl'
,
function
()
{
var
ctx
=
new
helpers
.
ControllerTestContext
();
beforeEach
(
module
(
'grafana.controllers'
));
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
angularMocks
.
module
(
'grafana.controllers'
));
beforeEach
(
angularMocks
.
module
(
'grafana.services'
));
beforeEach
(
ctx
.
providePhase
());
beforeEach
(
ctx
.
createControllerPhase
(
'InfluxQueryCtrl'
));
...
...
@@ -184,5 +185,4 @@ define([
});
});
});
});
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