Add InfluxDB memory usage chart

This commit is contained in:
emanuele-f 2019-06-07 17:22:02 +02:00
parent f51b0f1cda
commit 08f066637e
5 changed files with 58 additions and 19 deletions

View file

@ -1087,6 +1087,19 @@ end
-- ##############################################
function driver:getMemoryUsage()
local query = 'select LAST(HeapInUse) FROM "_internal".."runtime"'
local data = influx_query(self.url .. "/query?db=_internal", query, self.username, self.password)
if data and data.series and data.series[1] and data.series[1].values[1] then
return data.series[1].values[1][2]
end
return nil
end
-- ##############################################
function driver.getShardGroupDuration(days_retention)
-- https://docs.influxdata.com/influxdb/v1.7/query_language/database_management/#description-of-syntax-1
if days_retention < 2 then