Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Tag metadata ttl #103

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jiren
Copy link
Contributor

@jiren jiren commented Apr 1, 2019

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

- refactor stats and tags code to accommodate tag class
- updated test cases
lib/opencensus/tags/tag.rb Outdated Show resolved Hide resolved
lib/opencensus/tags/tag_map.rb Outdated Show resolved Hide resolved
lib/opencensus/tags/formatters/binary.rb Outdated Show resolved Hide resolved
lib/opencensus/tags/tag_map.rb Outdated Show resolved Hide resolved
@jiren
Copy link
Contributor Author

jiren commented Apr 23, 2019

@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

@dazuma
Copy link
Member

dazuma commented Apr 23, 2019

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?

@jiren
Copy link
Contributor Author

jiren commented Apr 24, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants