| - | - | recordDataTTL|The lifecycle of record data. Record data includes traces, top n sampled records, and logs. Unit is day. Minimal value is 2.|SW_CORE_RECORD_DATA_TTL|3|
| - | - | recordDataTTL|The lifecycle of record data. Record data includes traces, top n sampled records, and logs. Unit is day. Minimal value is 2.|SW_CORE_RECORD_DATA_TTL|3|
| - | - | metricsDataTTL|The lifecycle of metrics data, including the metadata. Unit is day. Recommend metricsDataTTL >= recordDataTTL. Minimal value is 2.| SW_CORE_METRICS_DATA_TTL|7|
| - | - | metricsDataTTL|The lifecycle of metrics data, including the metadata. Unit is day. Recommend metricsDataTTL >= recordDataTTL. Minimal value is 2.| SW_CORE_METRICS_DATA_TTL|7|
| - | - | l1FlushPeriod| The period of L1 aggregation flush to L2 aggregation. Unit is ms. | SW_CORE_L1_AGGREGATION_FLUSH_PERIOD | 500 |
| - | - | l1FlushPeriod| The period of L1 aggregation flush to L2 aggregation. Unit is ms. | SW_CORE_L1_AGGREGATION_FLUSH_PERIOD | 500 |
| - | - | storageSessionTimeout| The threshold of session time. Unit is ms. Default value is 70s. | SW_CORE_STORAGE_SESSION_TIMEOUT | 70000 |
| - | - | enableDatabaseSession|Cache metrics data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute.|SW_CORE_ENABLE_DATABASE_SESSION|true|
| - | - | enableDatabaseSession|Cache metrics data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute.|SW_CORE_ENABLE_DATABASE_SESSION|true|
| - | - | topNReportPeriod|The execution period of top N sampler, which saves sampled data into the storage. Unit is minute|SW_CORE_TOPN_REPORT_PERIOD|10|
| - | - | topNReportPeriod|The execution period of top N sampler, which saves sampled data into the storage. Unit is minute|SW_CORE_TOPN_REPORT_PERIOD|10|
| - | - | activeExtraModelColumns|Append the names of entity, such as service name, into the metrics storage entities.|SW_CORE_ACTIVE_EXTRA_MODEL_COLUMNS|false|
| - | - | activeExtraModelColumns|Append the names of entity, such as service name, into the metrics storage entities.|SW_CORE_ACTIVE_EXTRA_MODEL_COLUMNS|false|
@@ -50,13 +50,14 @@ public abstract class Metrics extends StreamData implements StorageData {
...
@@ -50,13 +50,14 @@ public abstract class Metrics extends StreamData implements StorageData {
* Time in the cache, only work when MetricsPersistentWorker#enableDatabaseSession == true.
* Time in the cache, only work when MetricsPersistentWorker#enableDatabaseSession == true.
*/
*/
@Getter
@Getter
privatelongsurvivalTime=0L;
privatelonglastUpdateTimestamp=0L;
/**
/**
* Merge the given metrics instance, these two must be the same metrics type.
* Merge the given metrics instance, these two must be the same metrics type.
*
*
* @param metrics to be merged
* @param metrics to be merged
* @return {@code true} if the combined metrics should be continuously processed. {@code false} means it should be abandoned, and the implementation needs to keep the data unaltered in this case.
* @return {@code true} if the combined metrics should be continuously processed. {@code false} means it should be
* abandoned, and the implementation needs to keep the data unaltered in this case.
*/
*/
publicabstractbooleancombine(Metricsmetrics);
publicabstractbooleancombine(Metricsmetrics);
...
@@ -80,12 +81,21 @@ public abstract class Metrics extends StreamData implements StorageData {
...
@@ -80,12 +81,21 @@ public abstract class Metrics extends StreamData implements StorageData {
publicabstractMetricstoDay();
publicabstractMetricstoDay();
/**
/**
* Extend the {@link #survivalTime}
* Set the last update timestamp
*
*
* @param value to extend
* @param timestamp last update timestamp
*/
*/
publicvoidextendSurvivalTime(longvalue){
publicvoidsetLastUpdateTimestamp(longtimestamp){
survivalTime+=value;
lastUpdateTimestamp=timestamp;
}
/**
* @param timestamp of current time
* @param expiredThreshold represents the duration between last update time and the time point removing from cache.
* @return true means this metrics should be removed from cache.