Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <benye@amazon.com>
  • Loading branch information
yeya24 committed Jun 16, 2023
1 parent 8a53847 commit 69edf97
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions integration/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestQuerierWithBlocksStorageRunningInMicroservicesMode(t *testing.T) {
require.NoError(t, storeGateways.WaitSumMetrics(e2e.Equals(2*3), "thanos_store_index_cache_items")) // 2 series both for expanded postings, postings and series cache
require.NoError(t, storeGateways.WaitSumMetrics(e2e.Equals(2*3), "thanos_store_index_cache_items_added_total")) // 2 series both for expanded postings, postings and series cache
} else if testCfg.indexCacheBackend == tsdb.IndexCacheBackendMemcached {
require.NoError(t, storeGateways.WaitSumMetrics(e2e.Equals(11), "thanos_memcached_operations_total")) // 7 gets + 4 sets
require.NoError(t, storeGateways.WaitSumMetrics(e2e.Equals(16), "thanos_memcached_operations_total")) // 12 gets + 4 sets
}

// Query back again the 1st series from storage. This time it should use the index cache.
Expand All @@ -264,7 +264,7 @@ func TestQuerierWithBlocksStorageRunningInMicroservicesMode(t *testing.T) {
require.NoError(t, storeGateways.WaitSumMetrics(e2e.Equals(2*3), "thanos_store_index_cache_items")) // as before
require.NoError(t, storeGateways.WaitSumMetrics(e2e.Equals(2*3), "thanos_store_index_cache_items_added_total")) // as before
} else if testCfg.indexCacheBackend == tsdb.IndexCacheBackendMemcached {
require.NoError(t, storeGateways.WaitSumMetrics(e2e.Equals(11+2), "thanos_memcached_operations_total")) // as before + 2 gets
require.NoError(t, storeGateways.WaitSumMetrics(e2e.Equals(16+2), "thanos_memcached_operations_total")) // as before + 2 gets
}

// Query metadata.
Expand Down Expand Up @@ -475,14 +475,14 @@ func TestQuerierWithBlocksStorageRunningInSingleBinaryMode(t *testing.T) {
assert.Equal(t, expectedVector3, result.(model.Vector))

// Check the in-memory index cache metrics (in the store-gateway).
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64(7*seriesReplicationFactor)), "thanos_store_index_cache_requests_total"))
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64(12*seriesReplicationFactor)), "thanos_store_index_cache_requests_total"))
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(0), "thanos_store_index_cache_hits_total")) // no cache hit cause the cache was empty

if testCfg.indexCacheBackend == tsdb.IndexCacheBackendInMemory {
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64(2*3*seriesReplicationFactor)), "thanos_store_index_cache_items")) // 2 series both for expanded postings, postings and series cache
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64(2*3*seriesReplicationFactor)), "thanos_store_index_cache_items_added_total")) // 2 series both for expanded postings, postings and series cache
} else if testCfg.indexCacheBackend == tsdb.IndexCacheBackendMemcached {
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64(11*seriesReplicationFactor)), "thanos_memcached_operations_total")) // 7 gets + 4 sets
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64(16*seriesReplicationFactor)), "thanos_memcached_operations_total")) // 12 gets + 4 sets
}

// Query back again the 1st series from storage. This time it should use the index cache.
Expand All @@ -498,7 +498,7 @@ func TestQuerierWithBlocksStorageRunningInSingleBinaryMode(t *testing.T) {
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64(2*3*seriesReplicationFactor)), "thanos_store_index_cache_items")) // as before
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64(2*3*seriesReplicationFactor)), "thanos_store_index_cache_items_added_total")) // as before
} else if testCfg.indexCacheBackend == tsdb.IndexCacheBackendMemcached {
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64((11+2)*seriesReplicationFactor)), "thanos_memcached_operations_total")) // as before + 2 gets
require.NoError(t, cluster.WaitSumMetrics(e2e.Equals(float64((16+2)*seriesReplicationFactor)), "thanos_memcached_operations_total")) // as before + 2 gets
}

// Query metadata.
Expand Down

0 comments on commit 69edf97

Please sign in to comment.