Skip to content

Conversation

@pabloem
Copy link
Member

@pabloem pabloem commented Jan 31, 2018

Let me know if this looks good!

r: @robertwb
cc: @lukecwik @kennknowles

metrics.cells.DistributionData.from_runner_api(
proto.distribution_data))
for step, step_metric in step_metrics.items():
print step
Copy link
Contributor

Choose a reason for hiding this comment

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

debugging

message User {

// A key for identifying a metric at the most granular level.
message MetricKey {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably be calling this a MetricName to avoid confusion with the MetricKey class in Java/Python that contains a step id.

metrics.cells.DistributionData.from_runner_api(
proto.distribution_data))
for step, step_metric in step_metrics.items():
print step
Copy link
Member Author

Choose a reason for hiding this comment

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

robertwb wrote:
debugging

Uff. Sorry about that. Removed.

message User {

// A key for identifying a metric at the most granular level.
message MetricKey {
Copy link
Member Author

Choose a reason for hiding this comment

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

robertwb wrote:
We should probably be calling this a MetricName to avoid confusion with the MetricKey class in Java/Python that contains a step id.

In that case, I've moved the runner translations to the MetricName class. Let me know what you think. I named it metric_name, because within it there's another name field.

}

// Data associated with a counter metric.
message CounterData {
Copy link
Member

Choose a reason for hiding this comment

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

Incidentally, these make sense at the top level and I have a slight preference for keeping as many things toplevel as possible unless these is a compelling reason to do otherwise. There is usually no downside.

Here it is a particular readability problem:

  • User is very misleading if not fully qualified, versus e.g. MetricData
  • great distance between the start of the message and the fields

Copy link
Member

Choose a reason for hiding this comment

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

(and is MetricData the same as the existing MetricUpdate? Luke and I chatted and I came away unsure)

Copy link
Member

@lukecwik lukecwik Jan 31, 2018

Choose a reason for hiding this comment

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

Moving stuff to not be nested is an independent change to what was asked. @kennknowles, if you would like to take on that change, feel free to do so.

Copy link
Member

Choose a reason for hiding this comment

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

I might, depending on how much this proto enters my life. But we should fix the misleading name either way.

Copy link
Member

Choose a reason for hiding this comment

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

BTW I don't know of a public discussion where I could gain context on this change. Can you link to that and/or public design doc on user-defined metrics in portability?

Anyhow I'm just providing drive-by feedback on the protos since I tried to use them and it isn't really clear why they are the way they are. I'm sure I can power through and make it work, but it isn't great for people not in our office.


def to_runner_api(self):
return beam_fn_api_pb2.Metrics.User.DistributionData(
return beam_fn_api_pb2.Metrics.PTransform.User.DistributionData(
Copy link
Member

Choose a reason for hiding this comment

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

I'm just the peanut gallery, of course, but this doesn't seem clearer at all than beam_fn_api_pb2.DistributionData(...)

Copy link
Contributor

@robertwb robertwb left a comment

Choose a reason for hiding this comment

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

LGTM. Could you squash your commits?

[beam_fn_api_pb2.Metrics.User(
key=beam_fn_api_pb2.Metrics.User.MetricKey(
step=self.step_name, namespace=k.namespace, name=k.name),
metric_name=beam_fn_api_pb2.Metrics.User.MetricName(
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps use k.to_runner_api() here?

@pabloem
Copy link
Member Author

pabloem commented Feb 2, 2018

Thanks Robert. Done.

@pabloem
Copy link
Member Author

pabloem commented Feb 5, 2018

Retest this please.

@pabloem
Copy link
Member Author

pabloem commented Feb 5, 2018

Ready to merge : )

@kennknowles
Copy link
Member

Known flake in gradle build. I don't think we should hold up the proto changes for that.

@kennknowles kennknowles merged commit b812fa0 into apache:master Feb 5, 2018
@pabloem pabloem deleted the change-fn-metrics branch February 5, 2018 22:57
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.

5 participants