Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable name clashing in subscription DSL #23

Open
surik opened this issue Jul 28, 2016 · 0 comments
Open

Variable name clashing in subscription DSL #23

surik opened this issue Jul 28, 2016 · 0 comments

Comments

@surik
Copy link
Member

surik commented Jul 28, 2016

For example this module:

defmodule Mapping do
  use Metricman.Subscription

  @reporter expose: [:exometer_report_influxdb]

  scope [:sessions], @reporter do
    map [:total],       [:sessions, :total]
    map [:access_class, '$access_class'], [:sessions, :access_class '$access_class']
  end
end

Will generate get/2 function which works like:

> Mapping.get [:sessions, :access_class, :online], :counter
{:ok, {[:sessions, :online, :access_class], [:value], [expose: [:exometer_report_influxdb]]}}

but it is not was expected. The correct result should looks like:

{:ok, {[:sessions, :access_class, :online], [:value], [expose: [:exometer_report_influxdb]]}}

It happens because we have names clashing: :access_class and '$access_class'.
If we rename '$access_class' to '$class' all works correct.

surik added a commit to surik/metricman that referenced this issue Jul 28, 2016
See xerions#23 for more information
surik added a commit to surik/metricman that referenced this issue Jul 28, 2016
See xerions#23 for more information
surik added a commit to surik/metricman that referenced this issue Jul 28, 2016
There was names clashing issue when we use variables with the same name
that exometer id already has.

See xerions#23
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

No branches or pull requests

1 participant