这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@gudmundur
Copy link
Member

@gudmundur gudmundur commented Feb 19, 2017

This change adds serialization_arity and timing_serialization to the canonical log line. I find it a little strange storing this in env[], but don't really have better suggestions.

end

self.class.serializer_class.new(structure).serialize(data)
env['serialization_arity'] = data.respond_to?(:size) ? data.size : 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do pliny.serialization_arity for good env hygiene?

Copy link
Member

@brandur brandur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! And yeah, unfortunately I think the env is the way to go here, although my prefixing things in there we can keep it relatively well organized.

What do you think about a test on a serializer class just to verify that emits information into env in order to fulfill its contract with the log line middleware?


start = Time.now
serializer_class.new(structure).serialize(data).tap do
env['timing_serialization'] = (Time.now - start).to_f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And maybe pliny.serialization_timing here. We can flip the words back around when adding it to the log line.

@gudmundur
Copy link
Member Author

@brandur updated.

@brandur
Copy link
Member

brandur commented Mar 24, 2017

Thanks! Looks good to me.

@gudmundur gudmundur merged commit 3336745 into master May 29, 2017
@gudmundur gudmundur deleted the canonical-log-lines-serializers branch May 29, 2017 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants