improve node details and add license for test class
This commit is contained in:
parent
bb3c730e58
commit
2bdc1860a8
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* Copyright © 2016-2021 The Thingsboard Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.thingsboard.server.service.sql;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
@ -46,10 +46,15 @@ import java.util.concurrent.TimeUnit;
|
||||
configClazz = TbMsgTimeseriesNodeConfiguration.class,
|
||||
nodeDescription = "Saves timeseries data",
|
||||
nodeDetails = "Saves timeseries telemetry data based on configurable TTL parameter. Expects messages with 'POST_TELEMETRY_REQUEST' message type. " +
|
||||
"Timestamp in milliseconds will be taken from metadata.ts, otherwise 'now' timestamp will be applied. " +
|
||||
"Allows stopping updating values for incoming keys in the latest ts_kv table if 'skipLatestPersistence' is set to true.",
|
||||
"Timestamp in milliseconds will be taken from metadata.ts, otherwise 'now' message timestamp will be applied. " +
|
||||
"Allows stopping updating values for incoming keys in the latest ts_kv table if 'skipLatestPersistence' is set to true.\n " +
|
||||
"Enable 'ignoreMetadataTs' param to ignore the timestamp that arrives from message metadata. " +
|
||||
"Useful for all sorts of sequential processing if you merge messages from multiple sources (devices, assets, etc).\n" +
|
||||
"For example, if you count number of messages from multiple devices into asset time-series value. " +
|
||||
"Typically, you fetch the previous value of the counter, increment it and then save the value. " +
|
||||
"If you use timestamp of the original message, the value may be ignored, since it has outdated timestamp comparing to the previous message.",
|
||||
uiResources = {"static/rulenode/rulenode-core-config.js"},
|
||||
configDirective = "tbActionNodeTimeseriesConfig!",
|
||||
configDirective = "tbActionNodeTimeseriesConfig",
|
||||
icon = "file_upload"
|
||||
)
|
||||
public class TbMsgTimeseriesNode implements TbNode {
|
||||
@ -102,8 +107,8 @@ public class TbMsgTimeseriesNode implements TbNode {
|
||||
}
|
||||
}
|
||||
|
||||
public static long computeTs(TbMsg msg, boolean saveWithMsgTs) {
|
||||
return saveWithMsgTs ? System.currentTimeMillis() : getTs(msg);
|
||||
public static long computeTs(TbMsg msg, boolean ignoreMetadataTs) {
|
||||
return ignoreMetadataTs ? System.currentTimeMillis() : getTs(msg);
|
||||
}
|
||||
|
||||
public static long getTs(TbMsg msg) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user