Skip to content

Conflicting metric keys #146

Description

@orweinberger

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
      }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions