Support isEmptyValue flag for metrics query. (#10616)

This commit is contained in:
Wan Kai 2023-03-30 14:46:07 +08:00 committed by GitHub
parent 7168f6d7e9
commit ec2ca354ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 661 additions and 196 deletions

View File

@ -22,6 +22,8 @@
* Fix possible NPE when initialize `IntList`.
* Support parse PromQL expression has empty labels in the braces for metadata query.
* Support alarm metric OP `!=`.
* Support metrics query indicates whether value == 0 represents actually zero or no data.
* Fix `NPE` when query the not exist series indexes in ElasticSearch storage.
#### UI
* Revert: cpm5d function. This feature is cancelled from backend.

View File

@ -25,6 +25,7 @@ import org.apache.skywalking.oap.server.core.query.input.Duration;
import org.apache.skywalking.oap.server.core.query.input.MetricsCondition;
import org.apache.skywalking.oap.server.core.query.type.HeatMap;
import org.apache.skywalking.oap.server.core.query.type.MetricsValues;
import org.apache.skywalking.oap.server.core.query.type.NullableValue;
import org.apache.skywalking.oap.server.core.storage.StorageModule;
import org.apache.skywalking.oap.server.core.storage.annotation.ValueColumnMetadata;
import org.apache.skywalking.oap.server.core.storage.query.IMetricsQueryDAO;
@ -50,7 +51,7 @@ public class MetricsQueryService implements Service {
/**
* Read metrics single value in the duration of required metrics
*/
public long readMetricsValue(MetricsCondition condition, Duration duration) throws IOException {
public NullableValue readMetricsValue(MetricsCondition condition, Duration duration) throws IOException {
return getMetricQueryDAO().readMetricsValue(
condition, ValueColumnMetadata.INSTANCE.getValueCName(condition.getName()), duration);
}

View File

@ -19,6 +19,7 @@
package org.apache.skywalking.oap.server.core.query.type;
import io.vavr.collection.Stream;
import io.vavr.control.Option;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
@ -31,16 +32,25 @@ public class IntValues {
values.add(e);
}
public long findValue(String id, int defaultValue) {
/**
* Return defaultValue if absent.
*/
public KVInt findValue(String id, int defaultValue) {
for (KVInt value : values) {
if (value.getId().equals(id)) {
return value.getValue();
return value;
}
}
return defaultValue;
return new KVInt(id, defaultValue, true);
}
public long latestValue(int defaultValue) {
return Stream.ofAll(values).map(KVInt::getValue).findLast(v -> v != defaultValue).getOrElse((long) defaultValue);
public NullableValue latestValue(int defaultValue) {
Option<KVInt> kvInt = Stream.ofAll(values).findLast(v -> !v.isEmptyValue());
if (kvInt.isEmpty()) {
return new NullableValue(defaultValue, true);
} else {
return new NullableValue(kvInt.get().getValue(), kvInt.get().isEmptyValue());
}
}
}

View File

@ -27,4 +27,13 @@ public class KVInt {
private String id;
private long value;
private boolean isEmptyValue;
public KVInt(String id, long value, boolean isEmptyValue) {
this.id = id;
this.value = value;
this.isEmptyValue = isEmptyValue;
}
public KVInt() {
}
}

View File

@ -24,4 +24,12 @@ import lombok.Data;
public class NullableValue {
private long value;
private boolean isEmptyValue;
public NullableValue() {
}
public NullableValue(long value, boolean isEmptyValue) {
this.value = value;
this.isEmptyValue = isEmptyValue;
}
}

View File

@ -24,7 +24,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.TreeSet;
import java.util.stream.Collectors;
import org.apache.skywalking.oap.server.core.analysis.metrics.DataTable;
@ -34,6 +33,7 @@ import org.apache.skywalking.oap.server.core.query.type.HeatMap;
import org.apache.skywalking.oap.server.core.query.type.IntValues;
import org.apache.skywalking.oap.server.core.query.type.KVInt;
import org.apache.skywalking.oap.server.core.query.type.MetricsValues;
import org.apache.skywalking.oap.server.core.query.type.NullableValue;
import org.apache.skywalking.oap.server.core.storage.DAO;
import org.apache.skywalking.oap.server.core.storage.annotation.ValueColumnMetadata;
@ -45,7 +45,7 @@ import static java.util.stream.Collectors.toList;
* @since 8.0.0
*/
public interface IMetricsQueryDAO extends DAO {
long readMetricsValue(MetricsCondition condition, String valueColumnName, Duration duration) throws IOException;
NullableValue readMetricsValue(MetricsCondition condition, String valueColumnName, Duration duration) throws IOException;
MetricsValues readMetricsValues(MetricsCondition condition,
String valueColumnName,
@ -66,10 +66,7 @@ public interface IMetricsQueryDAO extends DAO {
IntValues intValues = new IntValues();
expectedOrder.forEach(id -> {
KVInt e = new KVInt();
e.setId(id);
e.setValue(origin.findValue(id, defaultValue));
intValues.addKVInt(e);
intValues.addKVInt(origin.findValue(id, defaultValue));
});
return intValues;
@ -93,7 +90,6 @@ public interface IMetricsQueryDAO extends DAO {
*/
public static List<MetricsValues> composeLabelValue(final MetricsCondition condition,
final List<String> labels,
final List<String> ids,
final Map<String, DataTable> idMap) {
List<String> allLabels;
if (Objects.isNull(labels) || labels.size() < 1 || labels.stream().allMatch(Strings::isNullOrEmpty)) {
@ -105,12 +101,16 @@ public interface IMetricsQueryDAO extends DAO {
}
final int defaultValue = ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName());
List<LabeledValue> labeledValues = new TreeSet<>(allLabels).stream()
.flatMap(label -> ids.stream().map(id ->
.flatMap(label -> idMap.entrySet().stream().map(kv -> Objects.nonNull(kv.getValue().get(label)) ?
new LabeledValue(
label,
id,
Optional.ofNullable(idMap.getOrDefault(id, new DataTable()).get(label)).orElse((long) defaultValue))))
.collect(toList());
kv.getKey(),
kv.getValue().get(label), false) :
new LabeledValue(
label,
kv.getKey(),
defaultValue, true)
)).collect(toList());
MetricsValues current = new MetricsValues();
List<MetricsValues> result = new ArrayList<>();
for (LabeledValue each : labeledValues) {
@ -131,12 +131,9 @@ public interface IMetricsQueryDAO extends DAO {
private final String label;
private final KVInt kv;
public LabeledValue(String label, String id, long value) {
public LabeledValue(String label, String id, long value, boolean isEmptyValue) {
this.label = label;
KVInt kv = new KVInt();
kv.setId(id);
kv.setValue(value);
this.kv = kv;
this.kv = new KVInt(id, value, isEmptyValue);
}
}
}

View File

@ -81,14 +81,14 @@ public class MetricsQueryUtilTest {
of("202007291425", new DataTable("200,1|400,2"), "202007291426", new DataTable("200,3|400,8")),
"[{\"label\":\"200\",\"values\":{\"values\":[{\"id\":\"202007291425\",\"value\":1,\"isEmptyValue\":false},{\"id\":\"202007291426\",\"value\":3,\"isEmptyValue\":false}]}}," +
"{\"label\":\"400\",\"values\":{\"values\":[{\"id\":\"202007291425\",\"value\":2,\"isEmptyValue\":false},{\"id\":\"202007291426\",\"value\":8,\"isEmptyValue\":false}]}}," +
"{\"label\":\"500\",\"values\":{\"values\":[{\"id\":\"202007291425\",\"value\":" + DEFAULT_VALUE + ",\"isEmptyValue\":false},{\"id\":\"202007291426\",\"value\":" + DEFAULT_VALUE + ",\"isEmptyValue\":false}]}}]"
"{\"label\":\"500\",\"values\":{\"values\":[{\"id\":\"202007291425\",\"value\":" + DEFAULT_VALUE + ",\"isEmptyValue\":true},{\"id\":\"202007291426\",\"value\":" + DEFAULT_VALUE + ",\"isEmptyValue\":true}]}}]"
},
{
asList("200", "400"),
asList("202007291425", "202007291426"),
of("202007291425", new DataTable("200,1|400,2")),
"[{\"label\":\"200\",\"values\":{\"values\":[{\"id\":\"202007291425\",\"value\":1,\"isEmptyValue\":false},{\"id\":\"202007291426\",\"value\":" + DEFAULT_VALUE + ",\"isEmptyValue\":false}]}}," +
"{\"label\":\"400\",\"values\":{\"values\":[{\"id\":\"202007291425\",\"value\":2,\"isEmptyValue\":false},{\"id\":\"202007291426\",\"value\":" + DEFAULT_VALUE + ",\"isEmptyValue\":false}]}}]"
"[{\"label\":\"200\",\"values\":{\"values\":[{\"id\":\"202007291425\",\"value\":1,\"isEmptyValue\":false},{\"id\":\"202007291426\",\"value\":" + DEFAULT_VALUE + ",\"isEmptyValue\":true}]}}," +
"{\"label\":\"400\",\"values\":{\"values\":[{\"id\":\"202007291425\",\"value\":2,\"isEmptyValue\":false},{\"id\":\"202007291426\",\"value\":" + DEFAULT_VALUE + ",\"isEmptyValue\":true}]}}]"
},
});
}
@ -108,7 +108,10 @@ public class MetricsQueryUtilTest {
final String expectedResult) {
MetricsCondition condition = new MetricsCondition();
condition.setName(MODULE_NAME);
List<MetricsValues> result = IMetricsQueryDAO.Util.composeLabelValue(condition, queryConditionLabels, datePoints, valueColumnData);
List<MetricsValues> result = IMetricsQueryDAO.Util.sortValues(
IMetricsQueryDAO.Util.composeLabelValue(condition, queryConditionLabels, valueColumnData),
datePoints, DEFAULT_VALUE
);
assertThat(new Gson().toJson(result)).isEqualTo(expectedResult);
}

View File

@ -35,7 +35,6 @@ import org.apache.skywalking.oap.server.core.query.type.HeatMap;
import org.apache.skywalking.oap.server.core.query.type.IntValues;
import org.apache.skywalking.oap.server.core.query.type.KVInt;
import org.apache.skywalking.oap.server.core.query.type.MetricsValues;
import org.apache.skywalking.oap.server.core.query.type.NullableValue;
import org.apache.skywalking.oap.server.core.query.type.Thermodynamic;
import org.apache.skywalking.oap.server.library.module.ModuleManager;
@ -93,14 +92,6 @@ public class MetricQuery implements GraphQLQueryResolver {
return metricsValues.getValues();
}
public NullableValue readNullableMetricsValue(MetricsCondition condition, Duration duration) {
// TODO default implantation
final NullableValue nullableValue = new NullableValue();
nullableValue.setValue(0);
nullableValue.setEmptyValue(true);
return nullableValue;
}
public List<IntValues> getMultipleLinearIntValues(final MetricCondition metrics, final int numOfLinear,
final Duration duration) throws IOException {
MetricsCondition condition = new MetricsCondition();

View File

@ -42,6 +42,7 @@ import org.apache.skywalking.oap.server.core.query.input.TopNCondition;
import org.apache.skywalking.oap.server.core.query.type.HeatMap;
import org.apache.skywalking.oap.server.core.query.type.KVInt;
import org.apache.skywalking.oap.server.core.query.type.MetricsValues;
import org.apache.skywalking.oap.server.core.query.type.NullableValue;
import org.apache.skywalking.oap.server.core.query.type.Record;
import org.apache.skywalking.oap.server.core.query.type.SelectedRecord;
import org.apache.skywalking.oap.server.library.module.ModuleManager;
@ -122,6 +123,13 @@ public class MetricsQuery implements GraphQLQueryResolver {
if (!condition.senseScope() || !condition.getEntity().isValid()) {
return 0;
}
return getMetricsQueryService().readMetricsValue(condition, duration).getValue();
}
public NullableValue readNullableMetricsValue(MetricsCondition condition, Duration duration) throws IOException {
if (!condition.senseScope() || !condition.getEntity().isValid()) {
return new NullableValue(0, true);
}
return getMetricsQueryService().readMetricsValue(condition, duration);
}
@ -139,6 +147,7 @@ public class MetricsQuery implements GraphQLQueryResolver {
final KVInt kvInt = new KVInt();
kvInt.setId(id);
kvInt.setValue(0);
kvInt.setEmptyValue(true);
values.getValues().addKVInt(kvInt);
});
return values;
@ -177,6 +186,7 @@ public class MetricsQuery implements GraphQLQueryResolver {
final KVInt kvInt = new KVInt();
kvInt.setId(id);
kvInt.setValue(0);
kvInt.setEmptyValue(true);
values.getValues().addKVInt(kvInt);
});
values.setLabel(label);

View File

@ -44,6 +44,7 @@ import org.apache.skywalking.oap.server.core.query.type.HeatMap;
import org.apache.skywalking.oap.server.core.query.type.IntValues;
import org.apache.skywalking.oap.server.core.query.type.KVInt;
import org.apache.skywalking.oap.server.core.query.type.MetricsValues;
import org.apache.skywalking.oap.server.core.query.type.NullableValue;
import org.apache.skywalking.oap.server.core.storage.annotation.ValueColumnMetadata;
import org.apache.skywalking.oap.server.core.storage.query.IMetricsQueryDAO;
import org.apache.skywalking.oap.server.storage.plugin.banyandb.BanyanDBStorageClient;
@ -58,7 +59,7 @@ public class BanyanDBMetricsQueryDAO extends AbstractBanyanDBDAO implements IMet
}
@Override
public long readMetricsValue(MetricsCondition condition, String valueColumnName, Duration duration) throws IOException {
public NullableValue readMetricsValue(MetricsCondition condition, String valueColumnName, Duration duration) throws IOException {
String modelName = condition.getName();
MetadataRegistry.Schema schema = MetadataRegistry.INSTANCE.findMetadata(modelName, duration.getStep());
if (schema == null) {
@ -88,9 +89,9 @@ public class BanyanDBMetricsQueryDAO extends AbstractBanyanDBDAO implements IMet
});
for (DataPoint dataPoint : resp.getDataPoints()) {
return ((Number) dataPoint.getFieldValue(valueColumnName)).longValue();
return new NullableValue(((Number) dataPoint.getFieldValue(valueColumnName)).longValue(), false);
}
return defaultValue;
return new NullableValue(defaultValue, true);
}
private void buildAggregationQuery(MeasureQuery query, String valueColumnName, Function function) {
@ -125,12 +126,12 @@ public class BanyanDBMetricsQueryDAO extends AbstractBanyanDBDAO implements IMet
String id = ts.id(entityID);
KVInt kvInt = new KVInt();
kvInt.setId(id);
kvInt.setValue(0);
if (idMap.containsKey(ts.getPoint())) {
DataPoint dataPoint = idMap.get(ts.getPoint());
kvInt.setValue(extractFieldValue(schema, valueColumnName, dataPoint));
} else {
kvInt.setValue(ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName()));
kvInt.setEmptyValue(true);
}
intValues.addKVInt(kvInt);
}
@ -171,7 +172,7 @@ public class BanyanDBMetricsQueryDAO extends AbstractBanyanDBDAO implements IMet
}
return Util.sortValues(
Util.composeLabelValue(condition, labels, ids, dataTableMap),
Util.composeLabelValue(condition, labels, dataTableMap),
ids,
ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName())
);

View File

@ -18,6 +18,7 @@
package org.apache.skywalking.oap.server.storage.plugin.elasticsearch.query;
import java.util.Objects;
import org.apache.skywalking.library.elasticsearch.requests.search.BoolQueryBuilder;
import org.apache.skywalking.library.elasticsearch.requests.search.Query;
import org.apache.skywalking.library.elasticsearch.requests.search.RangeQueryBuilder;
@ -117,18 +118,19 @@ public class AggregationQueryEsDAO extends EsDAO implements IAggregationQueryDAO
duration.getEndTimeBucketInSec()), search.build());
final List<SelectedRecord> topNList = new ArrayList<>();
final Map<String, Object> idTerms =
(Map<String, Object>) response.getAggregations().get(Metrics.ENTITY_ID);
final List<Map<String, Object>> buckets =
(List<Map<String, Object>>) idTerms.get("buckets");
for (Map<String, Object> termsBucket : buckets) {
SelectedRecord record = new SelectedRecord();
record.setId((String) termsBucket.get("key"));
Map<String, Object> value = (Map<String, Object>) termsBucket.get(realValueColumn);
record.setValue(String.valueOf(((Number) value.get("value")).longValue()));
topNList.add(record);
if (Objects.nonNull(response.getAggregations())) {
final Map<String, Object> idTerms =
(Map<String, Object>) response.getAggregations().get(Metrics.ENTITY_ID);
final List<Map<String, Object>> buckets =
(List<Map<String, Object>>) idTerms.get("buckets");
for (Map<String, Object> termsBucket : buckets) {
SelectedRecord record = new SelectedRecord();
record.setId((String) termsBucket.get("key"));
Map<String, Object> value = (Map<String, Object>) termsBucket.get(realValueColumn);
record.setValue(String.valueOf(((Number) value.get("value")).longValue()));
topNList.add(record);
}
}
return topNList;
}
}

View File

@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.skywalking.library.elasticsearch.requests.search.Query;
@ -45,6 +46,7 @@ import org.apache.skywalking.oap.server.core.query.type.HeatMap;
import org.apache.skywalking.oap.server.core.query.type.IntValues;
import org.apache.skywalking.oap.server.core.query.type.KVInt;
import org.apache.skywalking.oap.server.core.query.type.MetricsValues;
import org.apache.skywalking.oap.server.core.query.type.NullableValue;
import org.apache.skywalking.oap.server.core.storage.annotation.ValueColumnMetadata;
import org.apache.skywalking.oap.server.core.storage.query.IMetricsQueryDAO;
import org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient;
@ -60,9 +62,9 @@ public class MetricsQueryEsDAO extends EsDAO implements IMetricsQueryDAO {
}
@Override
public long readMetricsValue(final MetricsCondition condition,
final String valueColumnName,
final Duration duration) {
public NullableValue readMetricsValue(final MetricsCondition condition,
final String valueColumnName,
final Duration duration) {
final String realValueColumn = IndexController.LogicIndicesRegister.getPhysicalColumnName(condition.getName(), valueColumnName);
final SearchBuilder sourceBuilder = buildQuery(condition, duration);
int defaultValue = ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName());
@ -87,16 +89,18 @@ public class MetricsQueryEsDAO extends EsDAO implements IMetricsQueryDAO {
duration.getStartTimeBucketInSec(),
duration.getEndTimeBucketInSec()), sourceBuilder.build());
final Map<String, Object> idTerms =
(Map<String, Object>) response.getAggregations().get(Metrics.ENTITY_ID);
final List<Map<String, Object>> buckets =
(List<Map<String, Object>>) idTerms.get("buckets");
if (Objects.nonNull(response.getAggregations())) {
final Map<String, Object> idTerms =
(Map<String, Object>) response.getAggregations().get(Metrics.ENTITY_ID);
final List<Map<String, Object>> buckets =
(List<Map<String, Object>>) idTerms.get("buckets");
for (Map<String, Object> idBucket : buckets) {
final Map<String, Object> agg = (Map<String, Object>) idBucket.get(realValueColumn);
return ((Number) agg.get("value")).longValue();
for (Map<String, Object> idBucket : buckets) {
final Map<String, Object> agg = (Map<String, Object>) idBucket.get(realValueColumn);
return new NullableValue(((Number) agg.get("value")).longValue(), false);
}
}
return defaultValue;
return new NullableValue(defaultValue, true);
}
@Override
@ -130,14 +134,16 @@ public class MetricsQueryEsDAO extends EsDAO implements IMetricsQueryDAO {
for (String id : ids) {
KVInt kvInt = new KVInt();
kvInt.setId(id);
kvInt.setValue(0);
if (idMap.containsKey(id)) {
Map<String, Object> source = idMap.get(id);
kvInt.setValue(((Number) source.getOrDefault(realValueColumn, 0)).longValue());
} else {
kvInt.setValue(ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName()));
if (source.get(realValueColumn) != null) {
kvInt.setValue(((Number) source.get(realValueColumn)).longValue());
} else {
kvInt.setValue(ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName()));
kvInt.setEmptyValue(true);
}
intValues.addKVInt(kvInt);
}
intValues.addKVInt(kvInt);
}
}
metricsValues.setValues(
@ -177,14 +183,16 @@ public class MetricsQueryEsDAO extends EsDAO implements IMetricsQueryDAO {
if (response.isPresent()) {
for (final Document document : response.get()) {
idMap.put(
document.getId(),
new DataTable((String) document.getSource().getOrDefault(realValueColumn, ""))
);
if (document.getSource().get(realValueColumn) != null) {
idMap.put(
document.getId(),
new DataTable((String) document.getSource().get(realValueColumn))
);
}
}
}
return Util.sortValues(
Util.composeLabelValue(condition, labels, ids, idMap),
Util.composeLabelValue(condition, labels, idMap),
ids,
ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName())
);

View File

@ -22,6 +22,7 @@ import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import org.apache.skywalking.library.elasticsearch.requests.search.BoolQueryBuilder;
import org.apache.skywalking.library.elasticsearch.requests.search.Query;
@ -77,16 +78,19 @@ public class TagAutoCompleteQueryDAO extends EsDAO implements ITagAutoCompleteQu
),
search.build()
);
Map<String, Object> terms =
(Map<String, Object>) response.getAggregations().get(TagAutocompleteData.TAG_KEY);
List<Map<String, Object>> buckets = (List<Map<String, Object>>) terms.get("buckets");
Set<String> tagKeys = new HashSet<>();
for (Map<String, Object> bucket : buckets) {
String tagKey = (String) bucket.get("key");
if (StringUtil.isEmpty(tagKey)) {
continue;
if (Objects.nonNull(response.getAggregations())) {
Map<String, Object> terms =
(Map<String, Object>) response.getAggregations().get(TagAutocompleteData.TAG_KEY);
List<Map<String, Object>> buckets = (List<Map<String, Object>>) terms.get("buckets");
for (Map<String, Object> bucket : buckets) {
String tagKey = (String) bucket.get("key");
if (StringUtil.isEmpty(tagKey)) {
continue;
}
tagKeys.add(tagKey);
}
tagKeys.add(tagKey);
}
return tagKeys;
}

View File

@ -23,6 +23,7 @@ import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import org.apache.skywalking.library.elasticsearch.requests.search.BoolQueryBuilder;
import org.apache.skywalking.library.elasticsearch.requests.search.Query;
@ -219,16 +220,17 @@ public class ZipkinQueryEsDAO extends EsDAO implements IZipkinQueryDAO {
TimeBucket.getRecordTimeBucket(startTimeMillis),
TimeBucket.getRecordTimeBucket(endTimeMillis)
), search.build());
final Map<String, Object> idTerms =
(Map<String, Object>) traceIdResponse.getAggregations().get(ZipkinSpanRecord.TRACE_ID);
final List<Map<String, Object>> buckets =
(List<Map<String, Object>>) idTerms.get("buckets");
Set<String> traceIds = new HashSet<>();
for (Map<String, Object> idBucket : buckets) {
traceIds.add((String) idBucket.get("key"));
}
if (Objects.nonNull(traceIdResponse.getAggregations())) {
final Map<String, Object> idTerms =
(Map<String, Object>) traceIdResponse.getAggregations().get(ZipkinSpanRecord.TRACE_ID);
final List<Map<String, Object>> buckets =
(List<Map<String, Object>>) idTerms.get("buckets");
for (Map<String, Object> idBucket : buckets) {
traceIds.add((String) idBucket.get("key"));
}
}
return getTraces(traceIds);
}

View File

@ -28,6 +28,7 @@ import org.apache.skywalking.oap.server.core.query.sql.Function;
import org.apache.skywalking.oap.server.core.query.type.HeatMap;
import org.apache.skywalking.oap.server.core.query.type.KVInt;
import org.apache.skywalking.oap.server.core.query.type.MetricsValues;
import org.apache.skywalking.oap.server.core.query.type.NullableValue;
import org.apache.skywalking.oap.server.core.storage.annotation.ValueColumnMetadata;
import org.apache.skywalking.oap.server.core.storage.query.IMetricsQueryDAO;
import org.apache.skywalking.oap.server.library.client.jdbc.hikaricp.JDBCClient;
@ -46,9 +47,9 @@ public class JDBCMetricsQueryDAO extends JDBCSQLExecutor implements IMetricsQuer
@Override
@SneakyThrows
public long readMetricsValue(final MetricsCondition condition,
String valueColumnName,
final Duration duration) {
public NullableValue readMetricsValue(final MetricsCondition condition,
String valueColumnName,
final Duration duration) {
final var tables = tableHelper.getTablesForRead(
condition.getName(),
duration.getStartTimeBucket(),
@ -91,21 +92,25 @@ public class JDBCMetricsQueryDAO extends JDBCSQLExecutor implements IMetricsQuer
parameters.add(condition.getName());
sql.append(" group by " + Metrics.ENTITY_ID);
results.add(jdbcClient.executeQuery(
jdbcClient.executeQuery(
sql.toString(),
resultSet -> {
if (resultSet.next()) {
return resultSet.getLong("result");
results.add(resultSet.getLong("result"));
}
return (long) defaultValue;
return null;
},
parameters.toArray(new Object[0])
));
);
}
if (results.size() == 0) {
return new NullableValue(defaultValue, true);
}
if (op.equals("avg")) {
return results.stream().mapToLong(it -> it).sum() / results.size();
return new NullableValue(results.stream().mapToLong(it -> it).sum() / results.size(), false);
}
return results.stream().mapToLong(it -> it).sum();
return new NullableValue(results.stream().mapToLong(it -> it).sum(), false);
}
protected StringBuilder buildMetricsValueSql(String op, String valueColumnName, String conditionName) {
@ -215,7 +220,7 @@ public class JDBCMetricsQueryDAO extends JDBCSQLExecutor implements IMetricsQuer
}
return Util.sortValues(
Util.composeLabelValue(condition, labels, ids, idMap),
Util.composeLabelValue(condition, labels, idMap),
ids,
ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName())
);

View File

@ -18,6 +18,12 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}
{{- end }}

View File

@ -13,7 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
{{- contains . }}
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ gt .value 0 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ gt .value 0 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ gt .value 0 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -18,30 +18,60 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 1
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 2
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 3
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 4
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- key: 2022-01-26
value: 200
value:
value: 200
isemptyvalue: false
- key: 2022-01-27
value: 0
value:
value: 0
isemptyvalue: true

View File

@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- key: 2022-01-26
value: 400
value:
value: 400
isemptyvalue: false
- key: 2022-01-27
value: 0
value:
value: 0
isemptyvalue: true

View File

@ -14,12 +14,22 @@
# limitations under the License.
- key: 2022-01-26 01
value: 0
value:
value: 0
isemptyvalue: true
- key: 2022-01-26 02
value: 0
value:
value: 0
isemptyvalue: true
- key: 2022-01-26 03
value: 200
value:
value: 200
isemptyvalue: false
- key: 2022-01-26 04
value: 0
value:
value: 0
isemptyvalue: true
- key: 2022-01-26 05
value: 0
value:
value: 0
isemptyvalue: true

View File

@ -14,12 +14,22 @@
# limitations under the License.
- key: 2022-01-26 01
value: 0
value:
value: 0
isemptyvalue: true
- key: 2022-01-26 02
value: 0
value:
value: 0
isemptyvalue: true
- key: 2022-01-26 03
value: 400
value:
value: 400
isemptyvalue: false
- key: 2022-01-26 04
value: 0
value:
value: 0
isemptyvalue: true
- key: 2022-01-26 05
value: 0
value:
value: 0
isemptyvalue: true

View File

@ -14,8 +14,14 @@
# limitations under the License.
- key: 2022-01-26 0259
value: 0
value:
value: 0
isemptyvalue: true
- key: 2022-01-26 0300
value: 200
value:
value: 200
isemptyvalue: false
- key: 2022-01-26 0301
value: 0
value:
value: 0
isemptyvalue: true

View File

@ -14,8 +14,14 @@
# limitations under the License.
- key: 2022-01-26 0309
value: 0
value:
value: 0
isemptyvalue: true
- key: 2022-01-26 0310
value: 200
value:
value: 200
isemptyvalue: false
- key: 2022-01-26 0311
value: 0
value:
value: 0
isemptyvalue: true

View File

@ -18,30 +18,60 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 1
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 2
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 3
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 4
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 2 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -18,6 +18,12 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -18,6 +18,12 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -18,30 +18,60 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 1
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 2
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 3
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 4
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -18,6 +18,12 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}

View File

@ -13,7 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
{{- contains . }}
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -18,30 +18,60 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 1
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 2
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 3
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
- key: 4
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -0,0 +1,17 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
value: 0
isemptyvalue: true

View File

@ -0,0 +1,17 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
value: 10000
isemptyvalue: false

View File

@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
10000

View File

@ -57,6 +57,12 @@ cases:
)
expected: expected/trace-users-detail.yml
# service metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics single --name=service_sla --service-name=e2e-service-provider
expected: expected/metrics-single-sla.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics nullable --name=service_sla --service-name=e2e-service-provider
expected: expected/metrics-nullable-single-sla.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics nullable --name=service_sla --service-name=e2e-service-provider --start "2023-01-08" --end "2023-01-09"
expected: expected/metrics-nullable-single-sla-empty.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics sorted --name service_apdex 5
expected: expected/metrics-top-service.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics top --name service_sla 5

View File

@ -13,7 +13,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
{{- range . }}
- key: {{ notEmpty .key }}
value: 0
{{- end }}
value: 0
isemptyvalue: true

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -25,5 +25,5 @@
# verify metrics has been deleted
- query: |
sleep 30;
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_resp_time --service-id=ZTJlLXRlc3QtZGVzdC1zZXJ2aWNl.1 --start="-193h" --end="-191h" |yq e 'to_entries' -
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics nullable --name=service_resp_time --service-id=ZTJlLXRlc3QtZGVzdC1zZXJ2aWNl.1 --start="-193h" --end="-191h"
expected: expected/metrics-has-no-value.yml

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ gt .value 0 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -18,6 +18,12 @@
value:
{{- contains .value }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}
{{- end }}

View File

@ -15,5 +15,11 @@
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -13,7 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
{{- contains . }}
{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
value:
value: 0
isemptyvalue: true
- key: {{ notEmpty .key }}
value:
value: {{ ge .value.value 1 }}
isemptyvalue: false
{{- end }}

View File

@ -25,4 +25,4 @@ SW_KUBERNETES_COMMIT_SHA=b670c41d94a82ddefcf466d54bab5c492d88d772
SW_ROVER_COMMIT=fc8d074c6d34ecfee585a7097cbd5aef1ca680a5
SW_BANYANDB_COMMIT=adbd3e87df7f84e5d1904fcf40476d2e81842058
SW_CTL_COMMIT=f3eed66ee2ff330e3218fdc995b6f9952901e37c
SW_CTL_COMMIT=23debb3b77426edd70192095a5fe9b0fc9031068