Skip to content
Snippets Groups Projects
Commit 030b87d6 authored by gwen-soleil's avatar gwen-soleil
Browse files

add debug log

parent abfe2f39
Branches main
No related tags found
No related merge requests found
......@@ -164,10 +164,12 @@ public class TimeseriesDatabase implements IDatabase {
public AttributeValues getValues(String attributeCompleteName, String startDateForApi, String endDateForApi, SamplingType sampling, short samplingValue) {
AttributeValues result;
final Optional<AttributeConfig> attributeConfig = configService.getAttributeConfig(attributeCompleteName);
if (attributeConfig.isPresent()) {
LOGGER.debug("fetching {}", attributeConfig.get());
if (sampling.equals(SamplingType.ALL)) {
final AttributeValueSeries data = fetcherService.getBetween(attributeCompleteName, getTimestamp(startDateForApi), getTimestamp(endDateForApi), false);
LOGGER.debug("fetching {} values for {}", data.getAttributeValues().size(), attributeCompleteName);
LOGGER.debug("fetched {} values for {}", data.getAttributeValues().size(), attributeCompleteName);
result = AttributeValueMapper.mapAttributeValues(attributeCompleteName, data, configService.getAttributeConfig(attributeCompleteName).get());
} else {
String samplingString = "1 hour";
......@@ -189,10 +191,10 @@ public class TimeseriesDatabase implements IDatabase {
AttributeValueSeries data;
if (attributeConfig.get().getType() == TangoConst.Tango_DEV_BOOLEAN) {
data = fetcherService.getWithSampling(attributeCompleteName, samplingString, "bool_or", getTimestamp(startDateForApi), getTimestamp(endDateForApi));
LOGGER.debug("fetching {} sampled boolean with bool_or values for {}", data.getAttributeValues().size(), attributeCompleteName);
LOGGER.debug("fetched {} sampled boolean with bool_or values for {}", data.getAttributeValues().size(), attributeCompleteName);
} else {
data = fetcherService.getWithSampling(attributeCompleteName, samplingString, "min", getTimestamp(startDateForApi), getTimestamp(endDateForApi));
LOGGER.debug("fetching {} sampled values for {}", data.getAttributeValues().size(), attributeCompleteName);
LOGGER.debug("fetched {} sampled values for {}", data.getAttributeValues().size(), attributeCompleteName);
}
result = AttributeValueMapper.mapAttributeValues(attributeCompleteName, data, configService.getAttributeConfig(attributeCompleteName).get());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment