mirror of https://github.com/grafana/grafana
Progress on InfluxDB 0.9 support, but will take a break, it is impossible to work on this, cannot get any queries that use tags to work with InfluxDB 0.9rc15, just empty response, #1525
parent
fcac4c057c
commit
b04c50537d
@ -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'); |
||||
}); |
||||
|
||||
}); |
||||
|
||||
}); |
||||
|
||||
}); |
||||
Loading…
Reference in new issue