opencensus-ruby icon indicating copy to clipboard operation
opencensus-ruby copied to clipboard

Tag metadata ttl

Open jiren opened this issue 6 years ago • 3 comments

  • Added tag class to store tag metadata
  • Refactor stats and tags code and test cases to manage tag class.

jiren avatar Apr 01 '19 13:04 jiren

@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

jiren avatar Apr 23 '19 16:04 jiren

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?

dazuma avatar Apr 23 '19 23:04 dazuma

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?

Nothing wrong with existing classes. It was just a view.

jiren avatar Apr 24 '19 06:04 jiren