mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Renamed src directory to public
This commit is contained in:
38
public/test/specs/influx09-querybuilder-specs.js
Normal file
38
public/test/specs/influx09-querybuilder-specs.js
Normal file
@@ -0,0 +1,38 @@
|
||||
define([
|
||||
'plugins/datasource/influxdb/queryBuilder'
|
||||
], function(InfluxQueryBuilder) {
|
||||
'use strict';
|
||||
|
||||
describe('InfluxQueryBuilder', function() {
|
||||
|
||||
describe('series with mesurement only', function() {
|
||||
var builder = new InfluxQueryBuilder({
|
||||
measurement: 'cpu',
|
||||
});
|
||||
|
||||
var query = builder.build();
|
||||
|
||||
it('should generate correct query', function() {
|
||||
expect(query).to.be('SELECT mean(value) FROM "cpu" WHERE $timeFilter GROUP BY time($interval) ORDER BY asc');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('series with tags only', function() {
|
||||
var builder = new InfluxQueryBuilder({
|
||||
measurement: 'cpu',
|
||||
tags: {'hostname': 'server1'}
|
||||
});
|
||||
|
||||
var query = builder.build();
|
||||
|
||||
it('should generate correct query', function() {
|
||||
expect(query).to.be('SELECT mean(value) FROM "cpu" WHERE hostname = \'server1\'' +
|
||||
' AND $timeFilter GROUP BY time($interval) ORDER BY asc');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user