本文整理汇总了TypeScript中src/shared/parsing/flux/dygraph.fluxTablesToDygraph函数的典型用法代码示例。如果您正苦于以下问题:TypeScript fluxTablesToDygraph函数的具体用法?TypeScript fluxTablesToDygraph怎么用?TypeScript fluxTablesToDygraph使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fluxTablesToDygraph函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('can parse identical series in different results', () => {
const resp = `#group,false,false,false,false,false,false,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
#default,0,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host
,,0,2018-12-10T18:21:52.748859Z,2018-12-10T18:30:00Z,2018-12-10T18:29:58Z,4906213376,active,mem,oox4k.local
,,0,2018-12-10T18:30:00Z,2018-12-10T19:00:00Z,2018-12-10T18:54:08Z,5860683776,active,mem,oox4k.local
#group,false,false,false,false,false,false,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string
#default,1,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,host
,,0,2018-12-10T18:21:52.748859Z,2018-12-10T18:30:00Z,2018-12-10T18:29:48Z,4589981696,active,mem,oox4k.local
,,0,2018-12-10T18:30:00Z,2018-12-10T19:00:00Z,2018-12-10T18:40:18Z,4318040064,active,mem,oox4k.local
`
const fluxTables = parseResponse(resp)
const actual = fluxTablesToDygraph(fluxTables)
expect(actual.dygraphsData).toEqual([
[new Date('2018-12-10T18:29:48.000Z'), null, 4589981696],
[new Date('2018-12-10T18:29:58.000Z'), 4906213376, null],
[new Date('2018-12-10T18:40:18.000Z'), null, 4318040064],
[new Date('2018-12-10T18:54:08.000Z'), 5860683776, null],
])
expect(actual.labels).toEqual([
'time',
'_value[result=0][_field=active][_measurement=mem][host=oox4k.local]',
'_value[result=1][_field=active][_measurement=mem][host=oox4k.local]',
])
})