本文整理汇总了TypeScript中app/core/logs_model.makeSeriesForLogs函数的典型用法代码示例。如果您正苦于以下问题:TypeScript makeSeriesForLogs函数的具体用法?TypeScript makeSeriesForLogs怎么用?TypeScript makeSeriesForLogs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了makeSeriesForLogs函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: mergeStreamsToLogs
return Promise.all(queries).then((results: any[]) => {
const allStreams: LogsStream[] = [];
for (let i = 0; i < results.length; i++) {
const result = results[i];
const query = queryTargets[i];
// add search term to stream & add to array
if (result.data) {
for (const stream of (result.data.streams || [])) {
stream.search = query.regexp;
allStreams.push(stream);
}
}
}
// check resultType
if (options.targets[0].resultFormat === 'time_series') {
const logs = mergeStreamsToLogs(allStreams, this.maxLines);
logs.series = makeSeriesForLogs(logs.rows, options.intervalMs);
return { data: logs.series };
} else {
return { data: allStreams };
}
});
示例2: mergeStreams
mergeStreams(streams: LogsStream[], intervalMs: number): LogsModel {
const logs = mergeStreamsToLogs(streams);
logs.series = makeSeriesForLogs(logs.rows, intervalMs);
return logs;
}