opencensus-ruby
opencensus-ruby copied to clipboard
Tag metadata ttl
- Added tag class to store tag metadata
- Refactor stats and tags code and test cases to manage tag class.
@dazuma I am going to update tag structure for key, value (with metadata - ttl) something like this. Please let me know your suggestions.
class TagMap
# @param [Hash<String,String>, Hash<String,TagValue>] tags
def initialize tags = {}
# Convert value to TagValue
end
# @param [String] key
# @param [String, TagValue] value
def []= key, value
# Convert string to TagValue
end
end
class TagValue
attr_reader :value, :ttl
# @param [String] value
# @param [Integer, nil] ttl
def initialize value, ttl: nil
end
end
I think including the metadata in TagValue is confusing, since that's not how the spec describes the types. What's wrong with the existing classes?
I think including the metadata in
TagValueis confusing, since that's not how the spec describes the types. What's wrong with the existing classes?
Nothing wrong with existing classes. It was just a view.