mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Timeseries datasource (work in progress)
This commit is contained in:
parent
fad9ce6542
commit
c787a9d956
5 changed files with 152 additions and 3 deletions
31
scripts/lua/datasources/sample_table.lua
Normal file
31
scripts/lua/datasources/sample_table.lua
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
--
|
||||
-- (C) 2020 - ntop.org
|
||||
--
|
||||
|
||||
dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require("lua_utils")
|
||||
local datasources_utils = require("datasources_utils")
|
||||
local datamodel = require("datamodel_utils")
|
||||
|
||||
local function reportError(msg)
|
||||
print(json.encode({ error = msg, success = false, csrf = ntop.getRandomCSRFValue() }))
|
||||
end
|
||||
|
||||
local ifid = _GET["ifid"]
|
||||
local key_ip = _GET["key_ip"]
|
||||
local key_mac = _GET["key_mac"]
|
||||
local key_asn = _GET["key_asn"]
|
||||
local key_metric = _GET["key_metric"]
|
||||
|
||||
local m = datamodel:create({"C1", "C2"})
|
||||
local when = 0
|
||||
|
||||
local dataset = "Traffic"
|
||||
|
||||
for i=1,3 do
|
||||
m:appendRow(when, dataset, {i, i})
|
||||
end
|
||||
|
||||
return(m)
|
||||
Loading…
Add table
Add a link
Reference in a new issue