Skip to content

Commit

Permalink
Add test cases for total and count aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoog committed Apr 29, 2024
1 parent fc0f24a commit 7cc4f44
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions x-pack/metricbeat/module/azure/data_test.go
Expand Up @@ -71,6 +71,8 @@ func TestMapToKeyValuePoints(t *testing.T) {
{name: metricName, min: &minValue, timestamp: timestamp},
{name: metricName, max: &maxValue, timestamp: timestamp},
{name: metricName, avg: &avgValue, timestamp: timestamp},
{name: metricName, total: &totalValue, timestamp: timestamp},
{name: metricName, count: &countValue, timestamp: timestamp},
},
TimeGrain: timeGrain,
ResourceId: resourceId,
Expand Down Expand Up @@ -110,6 +112,26 @@ func TestMapToKeyValuePoints(t *testing.T) {
ResourceSubId: resourceSubId,
Dimensions: map[string]interface{}{},
},
{
Key: fmt.Sprintf("%s.%s", metricName, "total"),
Value: &totalValue,
Namespace: namespace,
TimeGrain: timeGrain,
Timestamp: timestamp,
ResourceId: resourceId,
ResourceSubId: resourceSubId,
Dimensions: map[string]interface{}{},
},
{
Key: fmt.Sprintf("%s.%s", metricName, "count"),
Value: &countValue,
Namespace: namespace,
TimeGrain: timeGrain,
Timestamp: timestamp,
ResourceId: resourceId,
ResourceSubId: resourceSubId,
Dimensions: map[string]interface{}{},
},
}

assert.Equal(t, expected, actual)
Expand Down

0 comments on commit 7cc4f44

Please sign in to comment.