Skip to content

Commit

Permalink
Merge pull request #47 from nichdiekuh/bugfix/list-series
Browse files Browse the repository at this point in the history
Bugfix/list series
  • Loading branch information
bencevans committed Sep 9, 2014
2 parents 8183c23 + 8c8255d commit a2ebc6e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ node_js:
- "0.10"
- "0.8"
env:
- INFLUX=0.5.5
- INFLUX=0.4.0
- INFLUX=0.8.0
before_script:
- wget "http://s3.amazonaws.com/influxdb/influxdb_$(echo $INFLUX)_amd64.deb"
- sudo dpkg -i "influxdb_$(echo $INFLUX)_amd64.deb"
- sleep 15
- sudo service influxdb start
- sleep 5
script: npm run travis-test
after_script:
- cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ InfluxDB.prototype.getSeriesNames = function(databaseName,callback) {
this.request.get({
url: this.url('db/' + databaseName + '/series', {q: 'list series'}),
json: true
}, this._parseCallback(function(err, series) {
}, this._parseCallback(function(err, results) {
if(err) {
return callback(err, series);
return callback(err, results);
}
return callback(err, _.map(series, function(series) { return series.name; }));
return callback(err, _.map(results[0].points, function(series) { return series[1]; }));
}));
};

Expand Down
10 changes: 5 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ describe('InfluxDB', function () {

describe('create client', function () {
it('should create an instance without error', function () {
client = influx({host : info.server.host, port: info.server.port, username: info.server.username, passwort : info.server.password, database : info.db.name});
dbClient = influx({host : info.server.host, port: info.server.port, username: info.server.username, passwort : info.server.password, database : info.db.name});
failClient = influx({host : info.server.host, port: 6543, username: info.server.username, passwort : info.server.password, database : info.db.name});
client = influx({host : info.server.host, port: info.server.port, username: info.server.username, password : info.server.password, database : info.db.name});
dbClient = influx({host : info.server.host, port: info.server.port, username: info.server.username, password : info.server.password, database : info.db.name});
failClient = influx({host : info.server.host, port: 6543, username: info.server.username, password : info.server.password, database : info.db.name});
failoverClient = influx({hosts : [
{host : '192.168.1.1'},
{host : '192.168.1.2'},
Expand All @@ -52,8 +52,8 @@ describe('InfluxDB', function () {

describe('#setRequestTimeout', function () {
it('should set the default request timeout value', function () {
var timeout= failoverClient.setRequestTimeout(2000);
assert.equal(timeout,2000);
var timeout= failoverClient.setRequestTimeout(5000);
assert.equal(timeout,5000);
});
});

Expand Down

0 comments on commit a2ebc6e

Please sign in to comment.