Skip to content

Commit

Permalink
feat: Review queries and add new queries
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjjaramillo committed Nov 9, 2023
1 parent 4ccfd52 commit e551e97
Showing 1 changed file with 20 additions and 102 deletions.
122 changes: 20 additions & 102 deletions e2e/test-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,67 +19,26 @@ scenarios:
tests:
nrqls:
# START Failed Pod - Container Pending
- query: "FROM Metric SELECT latest(if(k8s.pod.isReady = 1, 'True', 'False')) as 'Ready' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- query: "FROM Metric SELECT latest(if(k8s.pod.isReady = 1, 'True', 'False')) as 'Ready' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Ready"
value: False
- query: "FROM Metric SELECT latest(if(k8s.pod.isScheduled = 1, 'True', 'False')) as 'Scheduled' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- query: "FROM Metric SELECT latest(if(k8s.pod.isScheduled = 1, 'True', 'False')) as 'Scheduled' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Scheduled"
value: False
- query: "FROM Metric SELECT min(k8s.pod.isReady) as 'Ready' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- query: "FROM Metric SELECT latest(k8s.pod.createdAt) as 'Created At' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Ready"
value: 0
- query: "FROM Metric SELECT min(k8s.pod.isScheduled) as 'Scheduled' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Scheduled"
value: 0
- query: "FROM Metric SELECT average(k8s.pod.netRxBytesPerSecond) / 1000 AS 'Received KBps' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- key: "Created At"
lowerBoundedValue: 0.0
- query: "FROM Metric SELECT latest(k8s.nodeName) as 'Node Name' WHERE metricName = 'k8s.pod.createdAt' AND k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Received KBps"
value: nil
- query: "FROM Metric SELECT average(k8s.pod.netTxBytesPerSecond) / 1000 AS 'Transmitted KBps', average(k8s.pod.netErrorsPerSecond) AS 'Errors / sec' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Transmitted KBps"
value: nil
- query: "FROM Metric SELECT average(k8s.pod.netErrorsPerSecond) AS 'Errors / sec' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Errors / sec"
value: nil
- query: "FROM Metric SELECT average(k8s.container.cpuUsedCores) AS 'CPU usage (cores)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "CPU usage (cores)"
value: nil
- query: "FROM Metric SELECT average(k8s.container.cpuCoresUtilization) / 100 AS 'CPU utilization (%)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "CPU utilization (%)"
value: nil
# commenting out this test - this test is flaky - sometimes it's nil and sometimes it has a positive value
# - query: "FROM Metric SELECT sum(k8s.container.cpuCfsThrottledPeriodsDelta) / sum(k8s.container.cpuCfsPeriodsDelta) AS 'CPU throttling (%)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
# expected_results:
# - key: "CPU throttling (%)"
# value: nil
- query: "FROM Metric SELECT average(k8s.container.memoryWorkingSetBytes) AS 'Memory usage (bytes)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Memory usage (bytes)"
value: nil
- query: "FROM Metric SELECT average(k8s.container.memoryWorkingSetUtilization) / 100 AS 'Memory utilization (%)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Memory utilization (%)"
value: nil
- query: "SELECT max(k8s.container.fsUsedBytes) AS 'Filesystem usage (bytes)' FROM Metric WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Filesystem usage (bytes)"
value: nil
- query: "SELECT max(k8s.container.fsUsedPercent) / 100 AS 'Filesystem utilization (%)' FROM Metric WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Filesystem utilization (%)"
value: nil
- query: "FROM Metric SELECT sum(k8s.container.restartCountDelta) AS 'Restart count' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- key: "Node Name"
value: ""
- query: "FROM Metric SELECT max(k8s.container.restartCountDelta) AS 'Restart count' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Restart count"
value: 0
value: nil
# END Failed Pod - Container Pending
entities: []
metrics:
Expand Down Expand Up @@ -130,67 +89,26 @@ scenarios:
tests:
nrqls:
# START Failed Pod - Container Pending
- query: "FROM Metric SELECT latest(if(k8s.pod.isReady = 1, 'True', 'False')) as 'Ready' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- query: "FROM Metric SELECT latest(if(k8s.pod.isReady = 1, 'True', 'False')) as 'Ready' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Ready"
value: False
- query: "FROM Metric SELECT latest(if(k8s.pod.isScheduled = 1, 'True', 'False')) as 'Scheduled' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- query: "FROM Metric SELECT latest(if(k8s.pod.isScheduled = 1, 'True', 'False')) as 'Scheduled' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Scheduled"
value: False
- query: "FROM Metric SELECT min(k8s.pod.isReady) as 'Ready' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- query: "FROM Metric SELECT latest(k8s.pod.createdAt) as 'Created At' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Ready"
value: 0
- query: "FROM Metric SELECT min(k8s.pod.isScheduled) as 'Scheduled' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Scheduled"
value: 0
- query: "FROM Metric SELECT average(k8s.pod.netRxBytesPerSecond) / 1000 AS 'Received KBps' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- key: "Created At"
lowerBoundedValue: 0.0
- query: "FROM Metric SELECT latest(k8s.nodeName) as 'Node Name' WHERE metricName = 'k8s.pod.createdAt' AND k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Received KBps"
value: nil
- query: "FROM Metric SELECT average(k8s.pod.netTxBytesPerSecond) / 1000 AS 'Transmitted KBps', average(k8s.pod.netErrorsPerSecond) AS 'Errors / sec' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Transmitted KBps"
value: nil
- query: "FROM Metric SELECT average(k8s.pod.netErrorsPerSecond) AS 'Errors / sec' WHERE k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Errors / sec"
value: nil
- query: "FROM Metric SELECT average(k8s.container.cpuUsedCores) AS 'CPU usage (cores)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "CPU usage (cores)"
value: nil
- query: "FROM Metric SELECT average(k8s.container.cpuCoresUtilization) / 100 AS 'CPU utilization (%)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "CPU utilization (%)"
value: nil
# commenting out this test - this test is flaky - sometimes it's nil and sometimes it has a positive value
# - query: "FROM Metric SELECT sum(k8s.container.cpuCfsThrottledPeriodsDelta) / sum(k8s.container.cpuCfsPeriodsDelta) AS 'CPU throttling (%)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
# expected_results:
# - key: "CPU throttling (%)"
# value: nil
- query: "FROM Metric SELECT average(k8s.container.memoryWorkingSetBytes) AS 'Memory usage (bytes)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Memory usage (bytes)"
value: nil
- query: "FROM Metric SELECT average(k8s.container.memoryWorkingSetUtilization) / 100 AS 'Memory utilization (%)' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Memory utilization (%)"
value: nil
- query: "SELECT max(k8s.container.fsUsedBytes) AS 'Filesystem usage (bytes)' FROM Metric WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Filesystem usage (bytes)"
value: nil
- query: "SELECT max(k8s.container.fsUsedPercent) / 100 AS 'Filesystem utilization (%)' FROM Metric WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Filesystem utilization (%)"
value: nil
- query: "FROM Metric SELECT sum(k8s.container.restartCountDelta) AS 'Restart count' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
- key: "Node Name"
value: ""
- query: "FROM Metric SELECT max(k8s.container.restartCountDelta) AS 'Restart count' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Restart count"
value: 0
value: nil
# END Failed Pod - Container Pending
entities: []
metrics:
Expand Down

0 comments on commit e551e97

Please sign in to comment.