Skip to content

Commit

Permalink
Make values easier to comprehend
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Häusler <794584+corvus-ch@users.noreply.github.com>
  • Loading branch information
bastjan and corvus-ch committed Dec 22, 2022
1 parent 7d00c6e commit 68928e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
10 changes: 2 additions & 8 deletions pkg/db/seeds/promtest/appuio_cloud_loadbalancer.jsonnet
Expand Up @@ -41,14 +41,11 @@ local baseCalculatedLabels = {

c.test('unrelated kube_namespace_labels changes do not throw errors - there is an overlap since series go stale only after a few missed scrapes',
baseSeries {
testprojectNamespaceOrgLabel+: {
values: '1x10 _x10 stale',
},
testprojectNamespaceOrgLabelUpdated: self.testprojectNamespaceOrgLabel {
_labels+:: {
custom_appuio_io_myid: '672004be-a86b-44e0-b446-1255a1f8b340',
},
values: '_x5 1x15',
values: '_x5 1x5',
},
},
query,
Expand All @@ -59,17 +56,14 @@ local baseCalculatedLabels = {

c.test('organization changes do not throw many-to-many errors - there is an overlap since series go stale only after a few missed scrapes',
baseSeries {
testprojectNamespaceOrgLabel+: {
values: '1x7 _x10 stale',
},
testprojectNamespaceOrgLabelUpdated: self.testprojectNamespaceOrgLabel {
_labels+:: {
label_appuio_io_organization: 'carrot-pickers-inc',
},
// We cheat here and use an impossible value.
// Since we use min() and bottomk() in the query this priotizes this series less than the other.
// It's ugly but it prevents flaky tests since otherwise one of the series gets picked randomly.
values: '_x2 2x15',
values: '_x2 2x8',
},
},
query,
Expand Down
6 changes: 2 additions & 4 deletions pkg/db/seeds/promtest/appuio_cloud_memory.jsonnet
Expand Up @@ -230,9 +230,6 @@ local subQueryTests = [

c.test('organization changes do not throw many-to-many errors - there is an overlap since series go stale only after a few missed scrapes',
baseSeries {
testprojectNamespaceOrgLabel+: {
values: '1x7 _x10 stale',
},
testprojectNamespaceOrgLabelUpdated: self.testprojectNamespaceOrgLabel {
_labels+:: {
label_appuio_io_organization: 'carrot-pickers-inc',
Expand All @@ -241,13 +238,14 @@ local subQueryTests = [
// Since we use min() and bottomk() in the query this priotizes this series less than the other.
// It's ugly but it prevents flaky tests since otherwise one of the series gets picked randomly.
// Does not influence the result. The result is flored to a minimum of 128MiB.
values: '_x2 2x15',
values: '_x2 2x8',
},
},
query,
[
{
labels: c.formatLabels(baseCalculatedLabels),
// TODO Identify why this is the case.
// Same as above it's 11*128 other queries don't have this problem
value: 128 * 9,
},
Expand Down
12 changes: 3 additions & 9 deletions pkg/db/seeds/promtest/appuio_cloud_persistent_storage.jsonnet
Expand Up @@ -80,14 +80,11 @@ local baseCalculatedLabels = {

c.test('unrelated kube_namespace_labels changes do not throw errors - there is an overlap since series go stale only after a few missed scrapes',
baseSeries {
testprojectNamespaceOrgLabel+: {
values: '1x10 _x10 stale',
},
testprojectNamespaceOrgLabelUpdated: self.testprojectNamespaceOrgLabel {
_labels+:: {
custom_appuio_io_myid: '672004be-a86b-44e0-b446-1255a1f8b340',
},
values: '_x5 1x15',
values: '_x5 1x5',
},
},
query,
Expand All @@ -98,18 +95,15 @@ local baseCalculatedLabels = {

c.test('organization changes do not throw many-to-many errors - there is an overlap since series go stale only after a few missed scrapes',
baseSeries {
testprojectNamespaceOrgLabel+: {
values: '1x7 _x10 stale',
},
testprojectNamespaceOrgLabelUpdated: self.testprojectNamespaceOrgLabel {
_labels+:: {
label_appuio_io_organization: 'carrot-pickers-inc',
},
// We cheat here and use an impossible value.
// Since we use min() and bottomk() in the query this priotizes this series less than the other.
// It's ugly but it prevents flaky tests since otherwise one of the series gets picked randomly.
// Does not influence the result. The result is flored to a minimum of 1GiB.
values: '_x2 2x15',
// Does not influence the result. The result is floored to a minimum of 1GiB.
values: '_x2 2x8',
},
},
query,
Expand Down

0 comments on commit 68928e4

Please sign in to comment.