I am using the following function to write tags to a tag manager given a map of tag paths and values:
public class TagValueWriter {
public void writeTagValues(Map<String, Object> tagValues) throws TagWriteException {
try {
for (Map.Entry<String, Object> entry : tagValues.entrySet()) {
GatewayHook.ourProvider.updateValue(entry.getKey(), entry.getValue(), QualityCode.Good);
}
} catch (Exception e) {
throw new TagWriteException("Failed to write tag values", e);
}
}
}
This doesn't seem to be very efficient since it writes each tag individually, calling GatewayHook.ourProvider.updateValue each time. Is there a more optimal way to write all the tags in the map to the tag manager?
Thanks for the response, @Kevin.Herron. So, to clarify, when using a ManagedTagProvider (which I do), there is no way to batch write all the tags or something like that? I am concerned about the performance of my module because, while my data source is updating every second, I am only seeing roughly every third update from my data source in a given tag.
For context, the tag provider has about 30,000 tags.