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
}
I have two collections with a metric called
count. When I attempt and calculate a division of the two I always get1back. 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:
However, running this returns the correct value: