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

Conflicting metric keys #146

Open
orweinberger opened this issue Nov 9, 2014 · 0 comments
Open

Conflicting metric keys #146

orweinberger opened this issue Nov 9, 2014 · 0 comments
Assignees
Labels

Comments

@orweinberger
Copy link
Member

I have two collections with a metric called count. When I attempt and calculate a division of the two I always get 1 back. This happens becuase Joola gets the same metric value even if two different collections are defined if the metric key is identical.

For example, running this will return 1:

query: {
          timeframe: 'last_day',
          interval: 'hour',
          dimensions: ['timestamp'],
          metrics: [
            {
              key:'avgTxBlock',
              formula: {
                dependsOn: [
                  {
                    key: 'count',
                    collection: 'tx'
                  },
                  {
                    key: 'count',
                    collection: 'block'
                  }
                ],
                run: 'function(tx,block) { return tx/block }'
              }
            }
          ],
          realtime: true
      }

However, running this returns the correct value:

query: {
          timeframe: 'last_day',
          interval: 'hour',
          dimensions: ['timestamp'],
          metrics: [
            {
              key:'avgTxBlock',
              formula: {
                dependsOn: [
                  {
                    key: 'count',
                    collection: 'tx'
                  },
                  {
                    key: '_count',
                    dependsOn: ['count'],
                    collection: 'block'
                  }
                ],
                run: 'function(tx,block) { return tx/block }'
              }
            }
          ],
          realtime: true
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants