Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #102 from sergeylanzman/fix-support-influxdb
Browse files Browse the repository at this point in the history
Fix support InfluxDB version 0.9.4.1
  • Loading branch information
obfuscurity committed Oct 16, 2015
2 parents 99af047 + 8518651 commit 3342f1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -195,7 +195,7 @@ Tasseo can also be configured to fetch metrics from an [InfluxDB](http://influxd
The formats of these variables are:

```
INFLUXDB_URL=http://sandbox.influxdb.org:9061/db/<database>
INFLUXDB_URL=http://sandbox.influxdb.org:8086
INFLUXDB_AUTH=<username>:<password>
```

Expand All @@ -212,7 +212,8 @@ var metrics =
return value / 1024;
},
// minimum y axis value will equal minimum metric y value (instead of 0)
scale: true
scale: true,
db: "points"
}
]
```
Expand Down
8 changes: 4 additions & 4 deletions lib/tasseo/public/j/tasseo.js
Expand Up @@ -276,10 +276,10 @@ TasseoInfluxDBDatasource.prototype = {
dataType: 'json',
error: function(xhr, textStatus, errorThrown) { console.log(errorThrown); },
success: function(metricResult) {
var datapoints = metricResult[0].points;
var datapoints = metricResult.results[0].series[0].values;
var newDatapoints = _.map(datapoints, function(datapoint) {
return { x: datapoint[0], y: datapoint[datapoint.length - 1] }
})
return { x: new Date(datapoint[0]).getTime()/1000.0, y: parseFloat(datapoint[datapoint.length - 1]) }
});
metric.update(newDatapoints)
}
})
Expand All @@ -293,7 +293,7 @@ TasseoInfluxDBDatasource.prototype = {
query += ' and (' + metric.where + ')';
}

return this.url + '/series?time_precision=s&u=' + self.user + '&p=' + self.pass + '&q=' + escape(query)
return this.url + '/query?&time_precision=s&q=' + escape(query) + '&db=' + metric.db + '&u=' + self.user + '&p=' + self.pass;
}
}

Expand Down

0 comments on commit 3342f1b

Please sign in to comment.