Last active
May 28, 2020 18:16
-
-
Save bentito/f81d1aa47b6311724331e1a312a63e55 to your computer and use it in GitHub Desktop.
namespace-persistentvolumeclaim-usage report test discrepancy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: metering.openshift.io/v1 | |
kind: ReportQuery | |
metadata: | |
name: "namespace-persistentvolumeclaim-usage" | |
labels: | |
operator-metering: "true" | |
spec: | |
columns: | |
- name: period_start | |
type: timestamp | |
unit: date | |
- name: period_end | |
type: timestamp | |
- name: namespace | |
type: varchar | |
unit: kubernetes_namespace | |
- name: persistentvolumeclaim_usage_bytes | |
type: double | |
unit: bytes | |
inputs: | |
- name: ReportingStart | |
- name: ReportingEnd | |
- name: PersistentvolumeclaimUsageWithPhaseRawDataSourceName | |
type: ReportDataSource | |
default: persistentvolumeclaim-usage-with-phase-raw | |
query: | | |
SELECT | |
timestamp '{| default .Report.ReportingStart .Report.Inputs.ReportingStart| prestoTimestamp |}' AS period_start, | |
timestamp '{| default .Report.ReportingEnd .Report.Inputs.ReportingEnd | prestoTimestamp |}' AS period_end, | |
namespace, | |
avg(persistentvolumeclaim_usage_bytes) | |
FROM {| dataSourceTableName .Report.Inputs.PersistentvolumeclaimUsageWithPhaseRawDataSourceName |} | |
WHERE "timestamp" >= timestamp '{| default .Report.ReportingStart .Report.Inputs.ReportingStart | prestoTimestamp |}' | |
AND "timestamp" < timestamp '{| default .Report.ReportingEnd .Report.Inputs.ReportingEnd | prestoTimestamp |}' | |
AND dt >= '{| default .Report.ReportingStart .Report.Inputs.ReportingStart | prometheusMetricPartitionFormat |}' | |
AND dt <= '{| default .Report.ReportingEnd .Report.Inputs.ReportingEnd | prometheusMetricPartitionFormat |}' | |
GROUP BY namespace |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Re-organized the testdata/report/namespace-persistentvolumeclaim-usage.json data:
The local test results: