diff --git a/Documentation/index.md b/Documentation/index.md index 8c9c977ab..84a1cdd3d 100644 --- a/Documentation/index.md +++ b/Documentation/index.md @@ -29,7 +29,7 @@ Custom Resources: - [Reports](report.md) - [Roll-up Reports](rollup-reports.md) -- [ReportGenerationQueries](reportgenerationqueries.md) +- [ReportQueries](reportqueries.md) - [ReportDataSources](reportdatasources.md) - [StorageLocations](storagelocations.md) diff --git a/Documentation/metering-architecture.md b/Documentation/metering-architecture.md index 60faf4923..e96de193d 100644 --- a/Documentation/metering-architecture.md +++ b/Documentation/metering-architecture.md @@ -31,8 +31,8 @@ There are 6 custom resources that Operator Metering defines that you need to be - `PrestoTables`: Defines a table in Presto. A PrestoTable can be "unmanaged" to expose a table that already exists, or "managed" to instruct metering to create a table as a result of the resource being created. - `HiveTables`: Defines a table in Hive. When created, it instructs metering to create the table in Hive which causes the table to be available to Presto. - `ReportDataSources`: Controls what data is available (Prometheus data, AWS billing data, Presto tables, views into other tables). -- `ReportGenerationQueries`: Controls how we query the data available within ReportDataSources. If referenced by a `Report` it will manage what it will be reporting on when the report is run. If it's referenced by a `ReportDataSource` it will instruct metering to create a view within Presto based on the rendered query. -- `Reports`: Causes reports to be generated using the configured `ReportGenerationQuery` resource. This is the primary resource an end-user of Operator Metering would interact with. Can be configured to run on a schedule. +- `ReportQueries`: Controls how we query the data available within ReportDataSources. If referenced by a `Report` it will manage what it will be reporting on when the report is run. If it's referenced by a `ReportDataSource` it will instruct metering to create a view within Presto based on the rendered query. +- `Reports`: Causes reports to be generated using the configured `ReportQuery` resource. This is the primary resource an end-user of Operator Metering would interact with. Can be configured to run on a schedule. In the sections below, we will cover the resources described above in more detail. @@ -55,7 +55,7 @@ There are many types of ReportDataSources, with the most common being a "Prometh A PrometheusMetricsImporter ReportDataSource instructs the reporting-operator to create a database table for storing Prometheus metric data and to being the process of importing Prometheus metrics. You can also define a AWSBilling ReportDataSource to create table pointing at an existing S3 bucket containing AWS Cost and Usage reports. -Additionally, there are GenerationQueryView ReportDataSource's which create views in Presto, and PrestoTable ReportDataSource's which just expose an existing PrestoTable as a ReportDataSource. +Additionally, there are ReportQueryView ReportDataSource's which create views in Presto, and PrestoTable ReportDataSource's which just expose an existing PrestoTable as a ReportDataSource. #### PrometheusMetricsImporter ReportDataSources @@ -99,14 +99,14 @@ By default, Operator Metering has an section in the `Metering` resource for conf For more details on configuring this read the [AWS billing correlation section in the Metering Configuration doc][metering-aws-billing-conf]. -#### ReportGenerationQueryView View ReportDataSources +#### ReportReportQueryView View ReportDataSources -A `ReportGenerationQuery` ReportDataSource configures the reporting-operator to create a Presto view based on the query specified. +A `ReportQuery` ReportDataSource configures the reporting-operator to create a Presto view based on the query specified. When the ReportDataSource is created, the reporting-operator: - Checks if the `ReportDataSource` has a view created for it yet by checking the `status.tableRef` field. -- If it field is empty, it creates a view by creating a `PrestoTable` resource with `spec.view` set to true, and `spec.query` set the rendered value of the ReportGenerationQuery's spec.query field. +- If it field is empty, it creates a view by creating a `PrestoTable` resource with `spec.view` set to true, and `spec.query` set the rendered value of the ReportQuery's spec.query field. - It then waits for the PrestoTable's `spec.tableName` to be set, and updates the ReportDataSource's `spec.tableRef` to indicate the view was created successfully. #### PrestoTable ReportDataSources @@ -118,11 +118,11 @@ When the ReportDataSource is created, the reporting-operator: - Lookups the `PrestoTable` resource and verifies it's `status.tableName` is set. - If the `status.tableName` is set then it will update the ReportDataSource's `spec.tableRef` to the tableName. -### ReportGenerationQuery +### ReportQuery -For user-docs containing a description of the fields, and examples, see [ReportGenerationQueries][reportgenerationqueries]. +For user-docs containing a description of the fields, and examples, see [ReportQueries][reportqueries]. -When the metering operator sees a new `ReportGenerationQuery` in its namespace, it will reprocess anything that depends on it (ReportDataSources or Reports). +When the metering operator sees a new `ReportQuery` in its namespace, it will reprocess anything that depends on it (ReportDataSources or Reports). ### Report @@ -130,10 +130,10 @@ For user-docs containing a description of the fields, and examples, see [Reports When a `Report` is created, and it sees the creation event, it does the following to generate the results: -- Retrieve the `ReportGenerationQuery` for the Report. -- For each `ReportGenerationQuery`, `ReportDataSource` and `Report` input in the `spec.inputs`, retrieve and validate them, and any of their dependencies. +- Retrieve the `ReportQuery` for the Report. +- For each `ReportQuery`, `ReportDataSource` and `Report` input in the `spec.inputs`, retrieve and validate them, and any of their dependencies. - Update the Report status to indicate we're beginning to generate the report. -- Evaluate the `ReportGenerationQuery` template, passing the StartPeriod & EndPeriod into the template context. +- Evaluate the `ReportQuery` template, passing the StartPeriod & EndPeriod into the template context. - Create a database table using Hive named after the Report. This table is either configured to use HDFS or S3 based on the Report's StorageLocation. - Execute the query using Presto. - Update the Report status that everything succeeded. @@ -145,5 +145,5 @@ When a `Report` is created, and it sees the creation event, it does the followin [metering-aws-billing-conf]: metering-config.md#aws-billing-correlation [storagelocations]: storagelocations.md [reportdatasources]: reportdatasources.md -[reportgenerationqueries]: reportgenerationqueries.md +[reportqueries]: reportqueries.md [reports]: report.md diff --git a/Documentation/report.md b/Documentation/report.md index ec745a095..63f0ee3c2 100644 --- a/Documentation/report.md +++ b/Documentation/report.md @@ -21,7 +21,7 @@ kind: Report metadata: name: pod-cpu-request-hourly spec: - generationQuery: "pod-cpu-request" + query: "pod-cpu-request" reportingStart: "2018-07-01T00:00:00Z" schedule: period: "hourly" @@ -41,22 +41,22 @@ kind: Report metadata: name: pod-cpu-request-hourly spec: - generationQuery: "pod-cpu-request" + query: "pod-cpu-request" reportingStart: "2018-07-01T00:00:00Z" reportingEnd: "2018-07-31T00:00:00Z" ``` -### generationQuery +### query -Names the `ReportGenerationQuery` used to generate the report. -The generation query controls the schema of the report as well how the results are processed. +Names the `ReportQuery` used to generate the report. +The report query controls the schema of the report as well how the results are processed. -*`generationQuery` is a required field.* +*`query` is a required field.* -Use `kubectl` to obtain a list of available `ReportGenerationQuery` objects: +Use `kubectl` to obtain a list of available `ReportQuery` objects: ``` - kubectl -n $METERING_NAMESPACE get reportgenerationqueries + kubectl -n $METERING_NAMESPACE get reportqueries NAME AGE cluster-cpu-capacity 23m cluster-cpu-capacity-raw 23m @@ -105,7 +105,7 @@ pod-memory-usage 23m pod-memory-usage-raw 23m ``` -ReportGenerationQueries with the `-raw` suffix are used by other ReportGenerationQueries to build more complex queries, and should not be used directly for reports. +ReportQueries with the `-raw` suffix are used by other ReportQueries to build more complex queries, and should not be used directly for reports. `namespace-` prefixed queries aggregate Pod CPU/memory requests by namespace, providing a list of namespaces and their overall usage based on resource requests. @@ -120,11 +120,11 @@ The `aws-ec2-billing-data` report is used by other queries, and should not be us For a complete list of fields each report query produces, use `kubectl` to get the object as JSON, and check the `columns` field: ``` -kubectl -n $METERING_NAMESPACE get reportgenerationqueries namespace-memory-request -o json +kubectl -n $METERING_NAMESPACE get reportqueries namespace-memory-request -o json { "apiVersion": "metering.openshift.io/v1alpha1", - "kind": "ReportGenerationQuery", + "kind": "ReportQuery", "metadata": { "name": "namespace-memory-request", "namespace": "metering" @@ -220,7 +220,7 @@ kind: Report metadata: name: pod-cpu-request-hourly spec: - generationQuery: "pod-cpu-request" + query: "pod-cpu-request" schedule: period: "hourly" reportingStart: "2018-01-01T00:00:00Z" @@ -242,7 +242,7 @@ kind: Report metadata: name: pod-cpu-request-hourly spec: - generationQuery: "pod-cpu-request" + query: "pod-cpu-request" schedule: period: "weekly" reportingStart: "2018-07-01T00:00:00Z" @@ -256,7 +256,7 @@ For reports with a schedule set, it will not wait for each period's reportingEnd ### Inputs -The `spec.inputs` field of a Report can be used to override or set values defined in a [ReportGenerationQuery's spec.input field][query-inputs]. +The `spec.inputs` field of a Report can be used to override or set values defined in a [ReportQuery's spec.input field][query-inputs]. It is a list of name-value pairs: @@ -273,8 +273,8 @@ For an example of how this can be used, see it in action [in a roll-up report](r Report data is stored in the database much like metrics themselves, and can thus be used in aggregated or roll-up reports. A simple use case for a roll-up report is to spread the time required to produce a report over a longer period of time: instead of requiring a monthly report to query and add all data over an entire month, the task can be split into daily reports that each run over a thirtieth of the data. -A custom roll-up report requires a custom generation query. -The ReportGenerationQuery template processor provides a function: `reportTableName` that can get the necessary table name [from a report name](rollup-reports.md#2-create-the-aggregation-query). +A custom roll-up report requires a custom report query. +The ReportQuery template processor provides a function: `reportTableName` that can get the necessary table name [from a report name](rollup-reports.md#2-create-the-aggregation-query). Below is an snippet taken from a built-in query: @@ -305,7 +305,7 @@ spec: ``` # aggregated-report.yaml spec: - generationQuery: "namespace-cpu-usage" + query: "namespace-cpu-usage" inputs: - name: "NamespaceCPUUsageReportName" value: "namespace-cpu-usage-hourly" @@ -323,4 +323,4 @@ The `status` field of a `Report` currently has two fields: - `lastReportTime`: Indicates the time Metering has collected data up to. [rfc3339]: https://tools.ietf.org/html/rfc3339#section-5.8 -[query-inputs]: reportgenerationqueries.md#query-inputs +[query-inputs]: reportqueries.md#query-inputs diff --git a/Documentation/reportdatasources.md b/Documentation/reportdatasources.md index 996c7d29e..7a2f4f7e6 100644 --- a/Documentation/reportdatasources.md +++ b/Documentation/reportdatasources.md @@ -2,7 +2,7 @@ A `ReportDataSource` is a custom resource that represents how to store data, such as where it should be stored, and in some cases, how the data is to be collected. -There are currently four types of ReportDataSource's: `prometheusMetricsImporter`, `awsBilling`, `generationQueryView` and `prestoTable`. +There are currently four types of ReportDataSource's: `prometheusMetricsImporter`, `awsBilling`, `reportQueryView` and `prestoTable`. Each has a corresponding configuration section within the `spec` of a `ReportDataSource`. The main effect that creating a ReportDataSource has is that it causes the metering operator to create a table in Presto or Hive. Depending on the type of ReportDataSource it then may do other additional tasks. @@ -23,9 +23,9 @@ To read more details on how the different ReportDataSources work, read the [mete - `bucket`: Bucket name to store data into. - `prefix`: Path within the bucket where to store data. - `region`: The region where bucket is located. -- `generationQueryView`: If this section is present, then the `ReportDataSource` will be configured to create a View in Presto using the rendered `spec.query` as the query for the view. - - `queryName`: The name of a [ReportGenerationQuery][reportgenerationquery] to create a view from. - - `inputs`: A list of inputs this report query accepts to control its behavior. For more in depth details, see the [ReportGenerationQuery query inputs][query-inputs] documentation. +- `reportQueryView`: If this section is present, then the `ReportDataSource` will be configured to create a View in Presto using the rendered `spec.query` as the query for the view. + - `queryName`: The name of a [ReportQuery][reportquery] to create a view from. + - `inputs`: A list of inputs this report query accepts to control its behavior. For more in depth details, see the [ReportQuery query inputs][query-inputs] documentation. - `storage`: This section controls the `StorageLocation` options, allowing you to control on a per ReportDataSource level, where data is stored. - `storageLocationName`: The name of the `StorageLocation` resource to use. - `prestoTable`: If present, then the `ReportDataSource` will simply make it possible to reference a database table within Presto as a ReportDataSource. @@ -75,16 +75,16 @@ spec: url: http://custom-prometheus-instance:9090 ``` -## ReportGenerationQuery View Datasource +## ReportQuery View Datasource -For ReportDataSources with a `spec.generationQueryView` present, a Presto view will be created using the rendered output of a specified [ReportGenerationQuery][reportgenerationquery]'s `spec.query` field. +For ReportDataSources with a `spec.reportQueryView` present, a Presto view will be created using the rendered output of a specified [ReportQuery][reportquery]'s `spec.query` field. This enables abstracting away the details of more complex queries by exposing them as a database table whose content is based on the result of of the query the view is based on. It also enables re-use by allowing you to create a view containing the complexities of a query allowing other queries to simply query it as a regular table. -### Example ReportGenerationQuery View Datasource +### Example ReportQuery View Datasource -This example exposes the `pod-memory-request-raw` ReportGenerationQuery as a view. -The schema is based on the `spec.columns` of the ReportGenerationQuery. +This example exposes the `pod-memory-request-raw` ReportQuery as a view. +The schema is based on the `spec.columns` of the ReportQuery. ``` apiVersion: metering.openshift.io/v1alpha1 @@ -94,7 +94,7 @@ metadata: labels: operator-metering: "true" spec: - generationQueryView: + reportQueryView: queryName: pod-memory-request-raw ``` @@ -145,7 +145,7 @@ spec: [default-storage-location]: storagelocations.md#default-storagelocation [architecture]: metering-architecture.md [presto-types]: https://prestodb.io/docs/current/language/types.html -[reportgenerationqueries]: reportgenerationqueries.md -[reportgenerationquery]: reportgenerationqueries.md [query-inputs]: reportgenerationqueries.md#query-inputs +[reportquery]: reportqueries.md +[query-inputs]: reportqueries.md#query-inputs [prestotables]: prestotables.md diff --git a/Documentation/reportgenerationqueries.md b/Documentation/reportqueries.md similarity index 78% rename from Documentation/reportgenerationqueries.md rename to Documentation/reportqueries.md index 073efc2eb..3623a5a7a 100644 --- a/Documentation/reportgenerationqueries.md +++ b/Documentation/reportqueries.md @@ -1,9 +1,9 @@ -# Report Generation Queries +# Report Queries -Customizing how Operator Metering generates reports is done using a custom resource called a `ReportGenerationQuery`. +Customizing how Operator Metering generates reports is done using a custom resource called a `ReportQuery`. -These `ReportGenerationQuery` resources control the SQL queries that can be used to produce a report. -When writing a [report](report.md) you can specify the query it will use by setting the `spec.generationQuery` field to `metadata.name` of any `ReportGenerationQuery` in the reporting-operator's namespace. +These `ReportQuery` resources control the SQL queries that can be used to produce a report. +When writing a [report](report.md) you can specify the query it will use by setting the `spec.query` field to `metadata.name` of any `ReportQuery` in the reporting-operator's namespace. ## Fields @@ -16,14 +16,14 @@ When writing a [report](report.md) you can specify the query it will use by sett - `inputs`: A list of inputs this report query accepts to control its behavior. For more in depth details, see the [query inputs](#query-inputs) section. - `name`: The name used to refer to the input in the `Report` or `ScheduledReport` `spec.inputs` and within the queries template variables (see below). - `required`: A boolean indicating if this input is required for the query to run. Defaults to false. - - `type`: An optional type indicating what data type this input takes. Available options are `string`, `time`, and `int`, `ReportDataSource`, `ReportGenerationQuery`, and `Report`. If left empty, it defaults to `string`. For more details, see the [query input types](#query-input-types) section. + - `type`: An optional type indicating what data type this input takes. Available options are `string`, `time`, and `int`, `ReportDataSource`, `ReportQuery`, and `Report`. If left empty, it defaults to `string`. For more details, see the [query input types](#query-input-types) section. - `default`: An optional default value to use if unspecified. ## Templating -Because much of the type of analysis being done depends on user-input, and because we want to enable users to re-use queries with copying & pasting things around, Operator Metering supports the [go templating language][go-templates] to dynamically generate the SQL statements contained within the `spec.query` field of `ReportGenerationQuery`. +Because much of the type of analysis being done depends on user-input, and because we want to enable users to re-use queries with copying & pasting things around, Operator Metering supports the [go templating language][go-templates] to dynamically generate the SQL statements contained within the `spec.query` field of `ReportQuery`. For example, when generating a report, the query needs to know what time range to consider when producing a report, so this is information is exposed within the template context as variables you can use and reference with various [template functions](#template-functions). -Most of these functions are for referring to other resources such as `ReportDataSources` or `ReportGenerationQueries` as either tables, views, or sub-queries, and for formatting various types for use within the SQL query. +Most of these functions are for referring to other resources such as `ReportDataSources` or `ReportQueries` as either tables, views, or sub-queries, and for formatting various types for use within the SQL query. ### Template variables @@ -34,18 +34,18 @@ Most of these functions are for referring to other resources such as `ReportData #### Query Inputs -Within the template context, the `.Report.Inputs` template variable contains a map where each key is the name of an input defined by the ReportGenerationQueries `spec.inputs`. +Within the template context, the `.Report.Inputs` template variable contains a map where each key is the name of an input defined by the ReportQuery's `spec.inputs`. The value of an input depends on a if the user specified a value in their `Report` or `ReportDataSource`, or if there is a default value defined. -- Depending on what is referencing the ReportGenerationQuery: The value comes from a `Report`'s `spec.inputs` or from a `ReportDataSource`'s `spec.generationQueryView.inputs`. -- If not provided, it will use the `default` value as defined the the ReportGenerationQueries `spec.inputs`, if one exists. +- Depending on what is referencing the ReportQuery: The value comes from a `Report`'s `spec.inputs` or from a `ReportDataSource`'s `spec.reportQueryView.inputs`. +- If not provided, it will use the `default` value as defined the ReportQuery's `spec.inputs`, if one exists. - Otherwise: the zero value for the type, according to Go's zero value rules. ##### Query Input types Each input can have a different `type`, which determines how the input should be processed. -Available options are `string`, `time`, and `int`, `ReportDataSource`, `ReportGenerationQuery`, and `Report`. +Available options are `string`, `time`, and `int`, `ReportDataSource`, `ReportQuery`, and `Report`. If left empty, it defaults to `string`. For each of these types, the behavior varies: @@ -54,7 +54,7 @@ For each of these types, the behavior varies: - `time`: A string value is parsed as an RFC3339 timestamp. Within the template context, the variable with be a Go [time.Time][go-time] object. - `int`: An int value is passed through as a Go [int][https://golang.org/pkg/builtin/#int]. - `ReportDataSource`: A string value referencing the name of a [ReportDataSource][reportdatasource] within the same namespace as the query. When this query is referenced by a Report or ReportDataSource, all `ReportDataSource` inputs are validated by checking that all the ReportDataSources specified exist. -- `ReportGenerationQuery`: A string value referencing the name of a [ReportGenerationQuery][reportgenerationquery] within the same namespace as the query. When this query is referenced by a Report or ReportDataSource, all `ReportGenerationQuery` inputs are validated by checking that all the ReportGenerationQuerys specified exist. +- `ReportQuery`: A string value referencing the name of a [ReportQuery][reportquery] within the same namespace as the query. When this query is referenced by a Report or ReportDataSource, all `ReportQuery` inputs are validated by checking that all the ReportQueries specified exist. - `Report`: A string value referencing the name of a [Report][report] within the same namespace as the query. When this query is referenced by a Report or ReportDataSource, all `Report` inputs are validated by checking that all the Reports specified exist. ### Template functions @@ -63,30 +63,30 @@ Below is a list of the available template functions and descriptions on what the - `dataSourceTableName`: Takes a one argument, a string referencing a `ReportDataSource` by name, and outputs a string which is the corresponding table name of the `ReportDataSource` specified. - `reportTableName`: Takes a one argument, a string referencing a `Report` by name, and outputs a string which is the corresponding table name of the `Report` specified. -- `renderReportGenerationQuery`: Takes two arguments, a string referencing a `ReportGenerationQuery` by name, the template context (usually this is just `.` in the template), and returns a string containing the specified `ReportGenerationQuery` in its rendered form, using the 2nd argument as the context for the template rendering. +- `renderReportQuery`: Takes two arguments, a string referencing a `ReportQuery` by name, the template context (usually this is just `.` in the template), and returns a string containing the specified `ReportQuery` in its rendered form, using the 2nd argument as the context for the template rendering. - `prestoTimestamp`: Takes a [time.Time][go-time] object as the argument, and outputs a string timestamp. Usually this is used on `.Report.ReportingStart` and `.Report.ReportingEnd`. - `prometheusMetricPartitionFormat`: Takes a [time.Time][go-time] object as the argument, and outputs a string in the form of `year-month-day`, eg: `2006-01-02`. Usually this is used on `.Report.ReportingStart` and `.Report.ReportingEnd`. - `billingPeriodFormat`: Takes a [time.Time][go-time] object as the argument, and outputs a string timestamp that can be used for comparing to `awsBilling` an ReportDataSource's `partition_start` and `partition_stop` columns. In addition to the above functions, the reporting-operator includes all of the functions from [Sprig - useful template functions for Go templates.][sprig]. -## Example ReportGenerationQueries +## Example ReportQueries -Before going into examples, there's an important convention that all the built-in `ReportGenerationQueries` follow that is worth calling out, as these examples will demonstrate them heavily. +Before going into examples, there's an important convention that all the built-in `ReportQueries` follow that is worth calling out, as these examples will demonstrate them heavily. -The convention I am referring to is the fact that there are quite a few ReportGenerationQueries suffixed with `-raw` in their `metadata.name`. +The convention I am referring to is the fact that there are quite a few ReportQueries suffixed with `-raw` in their `metadata.name`. These queries are not intended to be used by Reports, but are intended to be purely for re-use. Currently, these queries suffixed with `-raw` in their name are generally have no filtering and are used by [ReportDataSources to create views][view-datasources]. -Additionally, `-raw` queries often expose complex types (array, maps) which are incompatible with `Reports`, which is why the `ReportGenerationQueries` that are _not_ suffixed in `-raw` never expose those types in their columns list. +Additionally, `-raw` queries often expose complex types (array, maps) which are incompatible with `Reports`, which is why the `ReportQueries` that are _not_ suffixed in `-raw` never expose those types in their columns list. -The example below is a built-in `ReportGenerationQuery` that is installed with Operator Metering by default. -The query is not intended to be used by Reports, but instead is intended to be re-used by other `ReportGenerationQueries`, which is why it only does simple extraction of fields, and calculations. +The example below is a built-in `ReportQuery` that is installed with Operator Metering by default. +The query is not intended to be used by Reports, but instead is intended to be re-used by other `ReportQueries`, which is why it only does simple extraction of fields, and calculations. The important things to note with this query is that it's querying a database table containing Prometheus metric data for the `pod-request-memory-bytes` `ReportDataSource`, and it's getting the table name using the `dataSourceTableName` template function. ```yaml apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-memory-request-raw labels: @@ -137,12 +137,12 @@ spec: WHERE element_at(labels, 'node') IS NOT NULL ``` -This next example is also one of the built-in `ReportGenerationQueries`. +This next example is also one of the built-in `ReportQueries`. This example, unlike the previous is designed to be used with Reports. ## Modifying Columns For Report Display -You can modify the ReportGenerationQuery to display all columns or to hide or show columns as needed. The full endpoint displays all columns. +You can modify the ReportQuery to display all columns or to hide or show columns as needed. The full endpoint displays all columns. To query report results using the reporting-operator API for full endpoint the api call is: `http://127.0.0.1:8001/api/v1/namespaces/metering/services/http:reporting-operator:http/proxy/api/v2/reports/metering/namespace-cpu-request/full?format=json` This example is showing the `namespace-cpu-request` query in JSON format. @@ -160,8 +160,8 @@ To query report results using the reporting-operator API for tableHidden endpoin [go-templates]: https://golang.org/pkg/text/template/ [go-time]: https://golang.org/pkg/time/#Time [sprig]: https://masterminds.github.io/sprig/ -[view-datasources]: datasources.md#ReportGenerationQuery-View-Datasource +[view-datasources]: datasources.md#ReportQuery-View-Datasource [storagelocations]: storagelocations.md [reportdatasources]: reportdatasources.md -[reportgenerationqueries]: reportgenerationqueries.md +[reportqueries]: reportqueries.md [reports]: report.md diff --git a/Documentation/rollup-reports.md b/Documentation/rollup-reports.md index 6ca1e5916..7109d1d1a 100644 --- a/Documentation/rollup-reports.md +++ b/Documentation/rollup-reports.md @@ -15,7 +15,7 @@ kind: Report metadata: name: namespace-cpu-usage-hourly spec: - generationQuery: "namespace-cpu-usage" + query: "namespace-cpu-usage" reportingStart: '2018-10-09T00:00:00Z' schedule: period: "hourly" @@ -29,7 +29,7 @@ It contains a few a custom inputs: most importantly, `NamespaceCPUUsageReportNam ``` apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: namespace-cpu-usage labels: @@ -96,7 +96,7 @@ Note the use of the macro `reportTableName`, which will automatically get the pr ## 3. Create the aggregator report We now have a sub-report and a query that can read data from other reports. -We can create a `Report` that uses that custom generation query with the sub-report: +We can create a `Report` that uses that custom report query with the sub-report: ``` apiVersion: metering.openshift.io/v1alpha1 @@ -104,7 +104,7 @@ kind: Report metadata: name: namespace-cpu-usage-daily spec: - generationQuery: "namespace-cpu-usage" + query: "namespace-cpu-usage" inputs: - name: "NamespaceCPUUsageReportName" value: "namespace-cpu-usage-hourly" diff --git a/Documentation/using-metering.md b/Documentation/using-metering.md index 33854896a..d7db33959 100644 --- a/Documentation/using-metering.md +++ b/Documentation/using-metering.md @@ -9,14 +9,14 @@ If you want a guide on how to extend Metering with custom queries and reports, r First, read the [Reports][report-md] guide for a list of available options. -Select a `ReportGenerationQuery` and a `reportingStart` and `reportingEnd`. -Use 'kubectl' to query the Metering namespace for a list of available `ReportGenerationQueries`: +Select a `ReportQuery` and a `reportingStart` and `reportingEnd`. +Use 'kubectl' to query the Metering namespace for a list of available `ReportQueries`: ``` -kubectl get reportgenerationqueries -n $METERING_NAMESPACE +kubectl get reportqueries -n $METERING_NAMESPACE ``` -Each ReportGenerationQuery is designed to report on a specific resource, usually a `pod`, `namespace` or `node`, and on a specific metric, like `cpu` or `memory`, on a specific resource. Some reports correlate several of these metrics in a single report. See the [Reports][report-md] guide for more information on the returns provided by each report query. +Each ReportQuery is designed to report on a specific resource, usually a `pod`, `namespace` or `node`, and on a specific metric, like `cpu` or `memory`, on a specific resource. Some reports correlate several of these metrics in a single report. See the [Reports][report-md] guide for more information on the returns provided by each report query. ## Creating a report @@ -33,7 +33,7 @@ metadata: spec: reportingStart: '2018-01-01T00:00:00Z' reportingEnd: '2018-12-30T23:59:59Z' - generationQuery: "namespace-cpu-request" + query: "namespace-cpu-request" runImmediately: true ``` diff --git a/Documentation/writing-custom-queries.md b/Documentation/writing-custom-queries.md index d3ba789bf..8fffa8817 100644 --- a/Documentation/writing-custom-queries.md +++ b/Documentation/writing-custom-queries.md @@ -1,13 +1,13 @@ -# Writing Custom Report Prometheus Queries and Report Generation Queries +# Writing Custom Report Prometheus Queries and Report Queries One of the main goals of Operator Metering is to be flexible, and extensible. The way this has been done is to use Kubernetes Custom Resources as a way of letting users add to, or expand upon the built-in reports and metrics that the operator already has. -The primary Custom Resources that allow this are the [ReportDataSource][reportdatasources], and the [ReportGenerationQuery][reportgenerationqueries]. +The primary Custom Resources that allow this are the [ReportDataSource][reportdatasources], and the [ReportQuery][reportqueries]. It's highly recommended you read the documentation on each of these resources before continuing. A ReportDataSource can be configured to cause Operator Metering to collect additional Prometheus Metrics by allowing users to write custom Prometheus queries and store the metrics collected. -Once this is done a ReportGenerationQuery can be used to analyze the metrics. +Once this is done a ReportQuery can be used to analyze the metrics. This guide is going to be structured such that you begin by collecting new Prometheus Metrics, and by the end you will be writing custom SQL queries that analyze these metrics. @@ -187,25 +187,25 @@ ORDER BY total_replica_unready_seconds DESC, avg_replica_unready_seconds DESC, n LIMIT 10; ``` -## Writing a ReportGenerationQuery +## Writing a ReportQuery -Now that we have our final query, the time has come to put it into a [ReportGenerationQuery][reportgenerationqueries] resource. +Now that we have our final query, the time has come to put it into a [ReportQuery][reportqueries] resource. -The basic things you need to know when creating a `ReportGenerationQuery` is the query you're going to use, the schema for that query, and the `ReportDataSources` or `ReportGenerationQueries` your query depends on. +The basic things you need to know when creating a `ReportQuery` is the query you're going to use, the schema for that query, and the `ReportDataSources` or `ReportQueries` your query depends on. For our example, we will add the `unready-deployment-replicas` `ReportDataSources` to the `spec.ReportDataSource`, and we'll add the query to `spec.query`. The schema, which is defined in the `spec.columns` field, is basically a list of the columns from the `SELECT` query and their SQL data types. The column information is what the operator uses to create the table when a report is being generated. If this doesn't match the query, there will be issues when running the query and trying to store the data into the database. -Below is an example of our final query from the steps above put into a `ReportGenerationQuery`. +Below is an example of our final query from the steps above put into a `ReportQuery`. One thing to note is we replaced `FROM datasource_your_namespace_unready_deployment_replicas` with `{| dataSourceTableName .Report.Inputs.UnreadyDeploymentReplicasDataSourceName |}` and added an `inputs` configuration to avoid hard coding the table name. By using inputs, we can override the default ReportDataSource used and by marking it as `type: ReportDataSource`, it will be considered a dependency and will ensure it exists before running. The format of the table names could change in the future, so always use the `dataSourceTableName` template function to ensure it's always using the correct table name. ``` apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: "unready-deployment-replicas" spec: @@ -240,7 +240,7 @@ However, the above example is missing one crucial bit, and that's the ability to To handle this, the `.Report` variable is accessible within templates and contains a `.Report.StartPeriod` and `.Report.EndPeriod` field which will be filled in with values corresponding to the Report's reporting period. We can use these variables in a `WHERE` clause within our query to filter the results to those time ranges. -The `WHERE` clause generally looks the same for all `ReportGenerationQueries` that expect to be used by a Report: +The `WHERE` clause generally looks the same for all `ReportQueries` that expect to be used by a Report: ``` WHERE "timestamp" >= timestamp '{| default .Report.ReportingStart .Report.Inputs.ReportingStart | prestoTimestamp |}' @@ -249,7 +249,7 @@ AND "timestamp" < timestamp '{| default .Report.ReportingEnd .Report.Inputs.Repo Queries should be [left-closed and right-open](https://en.wikipedia.org/wiki/Interval_(mathematics)#Classification_of_intervals); that is, we should collect data with timestamps equal to or greater than the start time and less than the end time, as seen in the example above. -In addition to the query time constraints, we often want to be able to track the time period for each row of data. In order to do this, we can append two columns to the above schema definition: `period_start` and `period_end` and remove "timestamp", since we're looking at a range of time rather than an instant in time. Both of these columns will be of type `timestamp`, which requires us to add an additional field, `spec.input`, to our `ReportGenerationQuery` as this is a custom input. To see more about `spec.inputs`, `ReportingStart`, and `ReportingEnd` see [reports.md.](https://github.com/operator-framework/operator-metering/blob/master/Documentation/report.md#reportingstart) +In addition to the query time constraints, we often want to be able to track the time period for each row of data. In order to do this, we can append two columns to the above schema definition: `period_start` and `period_end` and remove "timestamp", since we're looking at a range of time rather than an instant in time. Both of these columns will be of type `timestamp`, which requires us to add an additional field, `spec.input`, to our `ReportQuery` as this is a custom input. To see more about `spec.inputs`, `ReportingStart`, and `ReportingEnd` see [reports.md.](https://github.com/operator-framework/operator-metering/blob/master/Documentation/report.md#reportingstart) Lastly, we need to update the SELECT portion of the `spec.query` field: ``` @@ -261,12 +261,12 @@ query: | ... ``` -Once we add these columns filters to our query we get the final version of our ReportGenerationQuery. -Save the snippet below into a file named `unready-deployment-replicas-reportgenerationquery.yaml`: +Once we add these columns filters to our query we get the final version of our ReportQuery. +Save the snippet below into a file named `unready-deployment-replicas-reportquery.yaml`: ``` apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: "unready-deployment-replicas" spec: @@ -306,10 +306,10 @@ spec: ORDER BY total_replica_unready_seconds DESC, avg_replica_unready_seconds DESC, namespace ASC, deployment ASC ``` -Next, let's create the `ReportGenerationQuery` so it can be used by Reports: +Next, let's create the `ReportQuery` so it can be used by Reports: ``` -kubectl create -n "$METERING_NAMESPACE" -f unready-deployment-replicas-reportgenerationquery.yaml +kubectl create -n "$METERING_NAMESPACE" -f unready-deployment-replicas-reportquery.yaml ``` ## Creating a Report @@ -324,7 +324,7 @@ metadata: spec: reportingStart: '2019-01-01T00:00:00Z' reportingEnd: '2019-12-31T23:59:59Z' - generationQuery: "unready-deployment-replicas" + query: "unready-deployment-replicas" runImmediately: true ``` @@ -378,12 +378,12 @@ Here's a summary of what we did in this guide: - We wrote a Prometheus query that collects metrics on unready deployment replicas. - We created a `ReportDataSource` that gave us a Presto table containing the metrics from our Prometheus query. - We wrote a Presto SQL query that calculates the average and total number of seconds that pods are unready for each deployment. -- We wrote a `ReportGenerationQuery` that does our calculation, and handles filtering the results to a Report's configured time range. -- We created a `Report` that uses our `ReportGenerationQuery`. +- We wrote a `ReportQuery` that does our calculation, and handles filtering the results to a Report's configured time range. +- We created a `Report` that uses our `ReportQuery`. - We checked that the Report finished, and then fetched the results from the metering operator HTTP API. [reportdatasources]: reportdatasources.md -[reportgenerationqueries]: reportgenerationqueries.md +[reportqueries]: reportqueries.md [reports]: report.md [install-metering]: install-metering.md [presto-cli-exec]: dev/debugging.md#query-presto-using-presto-cli diff --git a/LICENSE b/LICENSE index 7a4a3ea24..d64569567 100644 --- a/LICENSE +++ b/LICENSE @@ -199,4 +199,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/charts/openshift-metering/templates/roles.yaml b/charts/openshift-metering/templates/roles.yaml index 4150cd843..0767dcfa1 100644 --- a/charts/openshift-metering/templates/roles.yaml +++ b/charts/openshift-metering/templates/roles.yaml @@ -35,7 +35,7 @@ rules: resources: - reports - reports/export - - reportgenerationqueries + - reportqueries - reportdatasources - prestotables - storagelocations @@ -54,7 +54,7 @@ rules: resources: - reports - reports/export - - reportgenerationqueries + - reportqueries - reportdatasources - prestotables - storagelocations diff --git a/charts/openshift-reporting/templates/datasources.yaml b/charts/openshift-reporting/templates/datasources.yaml index 835ed7550..363f2feb5 100644 --- a/charts/openshift-reporting/templates/datasources.yaml +++ b/charts/openshift-reporting/templates/datasources.yaml @@ -40,6 +40,6 @@ metadata: {{- block "extraMetadata" . }} {{- end }} spec: - generationQueryView: + reportQueryView: queryName: "aws-ec2-billing-data-raw-raw" {{- end }} diff --git a/charts/openshift-reporting/templates/report-queries/aws-billing.yaml b/charts/openshift-reporting/templates/report-queries/aws-billing.yaml index 395525ce9..8a82ec066 100644 --- a/charts/openshift-reporting/templates/report-queries/aws-billing.yaml +++ b/charts/openshift-reporting/templates/report-queries/aws-billing.yaml @@ -1,6 +1,6 @@ {{- if .Values.spec.awsBillingReportDataSource.enabled -}} apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: aws-ec2-billing-data-raw labels: @@ -47,7 +47,7 @@ spec: AND lineItem_UsageEndDate IS NOT NULL --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: aws-ec2-billing-data labels: @@ -111,7 +111,7 @@ spec: AND (usage_end_date >= timestamp '{| default .Report.ReportingStart .Report.Inputs.ReportingStart | prestoTimestamp |}' AND usage_start_date <= timestamp '{| default .Report.ReportingEnd .Report.Inputs.ReportingEnd | prestoTimestamp |}') --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: aws-ec2-cluster-cost labels: @@ -132,11 +132,11 @@ spec: - name: ReportingEnd type: time - name: AwsEc2BillingDataQueryName - type: ReportGenerationQuery + type: ReportQuery default: aws-ec2-billing-data query: | WITH aws_billing_filtered AS ( - {| renderReportGenerationQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} + {| renderReportQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} ) SELECT min(usage_start_date) as data_start, diff --git a/charts/openshift-reporting/templates/report-queries/cluster-capacity.yaml b/charts/openshift-reporting/templates/report-queries/cluster-capacity.yaml index cd42edd21..615a39801 100644 --- a/charts/openshift-reporting/templates/report-queries/cluster-capacity.yaml +++ b/charts/openshift-reporting/templates/report-queries/cluster-capacity.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-cpu-capacity-raw labels: @@ -34,7 +34,7 @@ spec: GROUP BY "timestamp", dt --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-cpu-capacity labels: @@ -90,7 +90,7 @@ spec: {|- end |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-memory-capacity-raw labels: @@ -125,7 +125,7 @@ spec: GROUP BY "timestamp", dt --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-memory-capacity labels: diff --git a/charts/openshift-reporting/templates/report-queries/cluster-usage.yaml b/charts/openshift-reporting/templates/report-queries/cluster-usage.yaml index 8fb50b82b..b39659276 100644 --- a/charts/openshift-reporting/templates/report-queries/cluster-usage.yaml +++ b/charts/openshift-reporting/templates/report-queries/cluster-usage.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-cpu-usage-raw labels: @@ -34,7 +34,7 @@ spec: GROUP BY "timestamp", dt --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-cpu-usage labels: @@ -90,7 +90,7 @@ spec: {|- end |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-memory-usage-raw labels: @@ -125,7 +125,7 @@ spec: GROUP BY "timestamp", dt --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-memory-usage labels: diff --git a/charts/openshift-reporting/templates/report-queries/cluster-utilization.yaml b/charts/openshift-reporting/templates/report-queries/cluster-utilization.yaml index b439dbe00..01f7a32fe 100644 --- a/charts/openshift-reporting/templates/report-queries/cluster-utilization.yaml +++ b/charts/openshift-reporting/templates/report-queries/cluster-utilization.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-cpu-utilization labels: @@ -46,10 +46,10 @@ spec: - name: ClusterCpuUsageReportName type: Report - name: ClusterCpuCapacityQueryName - type: ReportGenerationQuery + type: ReportQuery default: cluster-cpu-capacity - name: ClusterCpuUsageQueryName - type: ReportGenerationQuery + type: ReportQuery default: cluster-cpu-usage query: | {|/* Handle aggregating a sub-report */|} @@ -73,9 +73,9 @@ spec: {|- fail "input ClusterCpuCapacityReportName and ClusterCpuUsageReportName must both be set" -|} {|- end -|} WITH cluster_cpu_capacity AS ( - {| renderReportGenerationQuery .Report.Inputs.ClusterCpuCapacityQueryName . |} + {| renderReportQuery .Report.Inputs.ClusterCpuCapacityQueryName . |} ), cluster_cpu_usage AS ( - {| renderReportGenerationQuery .Report.Inputs.ClusterCpuUsageQueryName . |} + {| renderReportQuery .Report.Inputs.ClusterCpuUsageQueryName . |} ) SELECT timestamp '{| default .Report.ReportingStart .Report.Inputs.ReportingStart| prestoTimestamp |}' AS period_start, @@ -95,7 +95,7 @@ spec: {|- end -|} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-memory-utilization labels: @@ -142,10 +142,10 @@ spec: - name: ClusterMemoryUsageReportName type: Report - name: ClusterMemoryCapacityQueryName - type: ReportGenerationQuery + type: ReportQuery default: cluster-memory-capacity - name: ClusterMemoryUsageQueryName - type: ReportGenerationQuery + type: ReportQuery default: cluster-memory-usage query: | {|/* Handle aggregating a sub-report */|} @@ -170,9 +170,9 @@ spec: {|- fail "input ClusterMemoryCapacityReportName and ClusterMemoryUsageReportName must both be set" -|} {|- end -|} WITH cluster_memory_capacity AS ( - {| renderReportGenerationQuery .Report.Inputs.ClusterMemoryCapacityQueryName . |} + {| renderReportQuery .Report.Inputs.ClusterMemoryCapacityQueryName . |} ), cluster_memory_usage AS ( - {| renderReportGenerationQuery .Report.Inputs.ClusterMemoryUsageQueryName . |} + {| renderReportQuery .Report.Inputs.ClusterMemoryUsageQueryName . |} ) SELECT timestamp '{| default .Report.ReportingStart .Report.Inputs.ReportingStart| prestoTimestamp |}' AS period_start, diff --git a/charts/openshift-reporting/templates/report-queries/node-cpu.yaml b/charts/openshift-reporting/templates/report-queries/node-cpu.yaml index 7bad64030..bcc4e19b6 100644 --- a/charts/openshift-reporting/templates/report-queries/node-cpu.yaml +++ b/charts/openshift-reporting/templates/report-queries/node-cpu.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-cpu-capacity-raw labels: @@ -46,7 +46,7 @@ spec: FROM {| dataSourceTableName .Report.Inputs.NodeCapacityCpuCoresDataSourceName |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-cpu-capacity labels: @@ -92,7 +92,7 @@ spec: GROUP BY node, resource_id --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-cpu-allocatable-raw labels: @@ -139,7 +139,7 @@ spec: FROM {| dataSourceTableName .Report.Inputs.NodeAllocatableCpuCoresDataSourceName |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-cpu-allocatable labels: @@ -185,7 +185,7 @@ spec: GROUP BY node, resource_id --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-cpu-utilization labels: diff --git a/charts/openshift-reporting/templates/report-queries/node-memory.yaml b/charts/openshift-reporting/templates/report-queries/node-memory.yaml index b92505c75..7080026be 100644 --- a/charts/openshift-reporting/templates/report-queries/node-memory.yaml +++ b/charts/openshift-reporting/templates/report-queries/node-memory.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-memory-capacity-raw labels: @@ -47,7 +47,7 @@ spec: FROM {| dataSourceTableName .Report.Inputs.NodeCapacityMemoryBytesDataSourceName |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-memory-capacity labels: @@ -93,7 +93,7 @@ spec: GROUP BY node, resource_id --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-memory-allocatable-raw labels: @@ -141,7 +141,7 @@ spec: FROM {| dataSourceTableName .Report.Inputs.NodeAllocatableMemoryBytesDataSourceName |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-memory-allocatable labels: @@ -187,7 +187,7 @@ spec: GROUP BY node, resource_id --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: node-memory-utilization labels: diff --git a/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-capacity.yaml b/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-capacity.yaml index c64abe448..c33a5d694 100644 --- a/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-capacity.yaml +++ b/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-capacity.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: persistentvolumeclaim-capacity-raw labels: @@ -46,7 +46,7 @@ spec: FROM {| dataSourceTableName .Report.Inputs.PersistentvolumeclaimCapacityBytesDataSourceName |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: persistentvolumeclaim-capacity labels: diff --git a/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-request.yaml b/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-request.yaml index 71571637a..82066a806 100644 --- a/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-request.yaml +++ b/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-request.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: persistentvolumeclaim-request-raw labels: @@ -56,7 +56,7 @@ spec: WHERE element_at(labels, 'volumename') IS NOT NULL --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: persistentvolumeclaim-request labels: @@ -120,7 +120,7 @@ spec: ORDER BY persistentvolumeclaim, namespace, persistentvolume, storageclass ASC, volume_request_storage_byte_seconds DESC --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: namespace-persistentvolumeclaim-request labels: @@ -172,7 +172,7 @@ spec: ORDER BY volume_request_storage_byte_seconds DESC --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: cluster-persistentvolumeclaim-request labels: diff --git a/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-usage.yaml b/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-usage.yaml index 71e627480..1fdbf667d 100644 --- a/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-usage.yaml +++ b/charts/openshift-reporting/templates/report-queries/persistentvolumeclaim-usage.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: persistentvolumeclaim-phase-raw labels: @@ -44,7 +44,7 @@ spec: FROM {| dataSourceTableName .Report.Inputs.PersistentvolumeclaimPhaseDataSourceName |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: persistentvolumeclaim-usage-raw labels: @@ -91,7 +91,7 @@ spec: FROM {| dataSourceTableName .Report.Inputs.PersistentvolumeclaimUsageBytesDataSourceName |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: persistentvolumeclaim-usage-with-phase-raw labels: @@ -135,7 +135,7 @@ spec: GROUP BY phase.timestamp, phase.dt, phase.namespace, phase.persistentvolumeclaim --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: persistentvolumeclaim-usage labels: @@ -183,7 +183,7 @@ spec: --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: "namespace-persistentvolumeclaim-usage" labels: diff --git a/charts/openshift-reporting/templates/report-queries/pod-cpu-aws.yaml b/charts/openshift-reporting/templates/report-queries/pod-cpu-aws.yaml index 8cf488037..990b8a963 100644 --- a/charts/openshift-reporting/templates/report-queries/pod-cpu-aws.yaml +++ b/charts/openshift-reporting/templates/report-queries/pod-cpu-aws.yaml @@ -1,6 +1,6 @@ {{- if .Values.spec.awsBillingReportDataSource.enabled -}} apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-cpu-request-aws labels: @@ -43,11 +43,11 @@ spec: type: ReportDataSource default: node-cpu-allocatable-raw - name: AwsEc2BillingDataQueryName - type: ReportGenerationQuery + type: ReportQuery default: aws-ec2-billing-data query: | WITH aws_billing_filtered AS ( - {| renderReportGenerationQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} + {| renderReportQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} ), aws_billing_sum AS ( SELECT sum(aws_billing_filtered.period_cost * aws_billing_filtered.period_percent) as cluster_cost @@ -93,7 +93,7 @@ spec: CROSS JOIN aws_billing_sum --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-cpu-usage-aws labels: @@ -136,11 +136,11 @@ spec: type: ReportDataSource default: node-cpu-allocatable-raw - name: AwsEc2BillingDataQueryName - type: ReportGenerationQuery + type: ReportQuery default: aws-ec2-billing-data query: | WITH aws_billing_filtered AS ( - {| renderReportGenerationQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} + {| renderReportQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} ), aws_billing_sum AS ( SELECT sum(aws_billing_filtered.period_cost * aws_billing_filtered.period_percent) as cluster_cost diff --git a/charts/openshift-reporting/templates/report-queries/pod-cpu.yaml b/charts/openshift-reporting/templates/report-queries/pod-cpu.yaml index df63b0c03..86d9019dd 100644 --- a/charts/openshift-reporting/templates/report-queries/pod-cpu.yaml +++ b/charts/openshift-reporting/templates/report-queries/pod-cpu.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-cpu-request-raw labels: @@ -52,7 +52,7 @@ spec: WHERE element_at(labels, 'node') IS NOT NULL --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-cpu-usage-raw labels: @@ -105,7 +105,7 @@ spec: WHERE element_at(labels, 'node') IS NOT NULL --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-cpu-request labels: @@ -165,7 +165,7 @@ spec: ORDER BY namespace, pod, node ASC, pod_request_cpu_core_seconds DESC --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-cpu-usage labels: @@ -225,7 +225,7 @@ spec: ORDER BY namespace, pod, node ASC, pod_usage_cpu_core_seconds DESC --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: namespace-cpu-request labels: @@ -289,7 +289,7 @@ spec: {|- end |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: namespace-cpu-usage labels: @@ -353,7 +353,7 @@ spec: {|- end |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: namespace-cpu-utilization labels: @@ -395,21 +395,21 @@ spec: - name: ClusterCpuCapacityReportName type: Report - name: NamespaceCpuRequestQueryName - type: ReportGenerationQuery + type: ReportQuery default: namespace-cpu-request - name: NamespaceCpuUsageQueryName - type: ReportGenerationQuery + type: ReportQuery default: namespace-cpu-usage - name: ClusterCpuCapacityQueryName - type: ReportGenerationQuery + type: ReportQuery default: cluster-cpu-capacity query: | WITH cluster_cpu_capacity AS ( - {| renderReportGenerationQuery .Report.Inputs.ClusterCpuCapacityQueryName . |} + {| renderReportQuery .Report.Inputs.ClusterCpuCapacityQueryName . |} ), namespace_cpu_usage AS ( - {| renderReportGenerationQuery .Report.Inputs.NamespaceCpuUsageQueryName . |} + {| renderReportQuery .Report.Inputs.NamespaceCpuUsageQueryName . |} ), namespace_cpu_request AS ( - {| renderReportGenerationQuery .Report.Inputs.NamespaceCpuRequestQueryName . |} + {| renderReportQuery .Report.Inputs.NamespaceCpuRequestQueryName . |} ) SELECT timestamp '{| default .Report.ReportingStart .Report.Inputs.ReportingStart| prestoTimestamp |}' AS period_start, diff --git a/charts/openshift-reporting/templates/report-queries/pod-memory-aws.yaml b/charts/openshift-reporting/templates/report-queries/pod-memory-aws.yaml index e8170f805..39e4634b3 100644 --- a/charts/openshift-reporting/templates/report-queries/pod-memory-aws.yaml +++ b/charts/openshift-reporting/templates/report-queries/pod-memory-aws.yaml @@ -1,6 +1,6 @@ {{- if .Values.spec.awsBillingReportDataSource.enabled -}} apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-memory-request-aws labels: @@ -43,11 +43,11 @@ spec: type: ReportDataSource default: node-memory-allocatable-raw - name: AwsEc2BillingDataQueryName - type: ReportGenerationQuery + type: ReportQuery default: aws-ec2-billing-data query: | WITH aws_billing_filtered AS ( - {| renderReportGenerationQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} + {| renderReportQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} ), aws_billing_sum AS ( SELECT sum(aws_billing_filtered.period_cost * aws_billing_filtered.period_percent) as cluster_cost @@ -93,7 +93,7 @@ spec: CROSS JOIN aws_billing_sum --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-memory-usage-aws labels: @@ -136,11 +136,11 @@ spec: type: ReportDataSource default: node-memory-allocatable-raw - name: AwsEc2BillingDataQueryName - type: ReportGenerationQuery + type: ReportQuery default: aws-ec2-billing-data query: | WITH aws_billing_filtered AS ( - {| renderReportGenerationQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} + {| renderReportQuery .Report.Inputs.AwsEc2BillingDataQueryName . |} ), aws_billing_sum AS ( SELECT sum(aws_billing_filtered.period_cost * aws_billing_filtered.period_percent) as cluster_cost diff --git a/charts/openshift-reporting/templates/report-queries/pod-memory.yaml b/charts/openshift-reporting/templates/report-queries/pod-memory.yaml index 7d0eaa0e6..61694fd19 100644 --- a/charts/openshift-reporting/templates/report-queries/pod-memory.yaml +++ b/charts/openshift-reporting/templates/report-queries/pod-memory.yaml @@ -1,5 +1,5 @@ apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-memory-request-raw labels: @@ -52,7 +52,7 @@ spec: WHERE element_at(labels, 'node') IS NOT NULL --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-memory-usage-raw labels: @@ -105,7 +105,7 @@ spec: WHERE element_at(labels, 'node') IS NOT NULL --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-memory-request labels: @@ -165,7 +165,7 @@ spec: ORDER BY namespace, pod, node ASC, pod_request_memory_byte_seconds DESC --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: pod-memory-usage labels: @@ -225,7 +225,7 @@ spec: ORDER BY namespace, pod, node ASC, pod_usage_memory_byte_seconds DESC --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: namespace-memory-request labels: @@ -289,7 +289,7 @@ spec: {|- end |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: namespace-memory-usage labels: @@ -353,7 +353,7 @@ spec: {|- end |} --- apiVersion: metering.openshift.io/v1alpha1 -kind: ReportGenerationQuery +kind: ReportQuery metadata: name: namespace-memory-utilization labels: @@ -395,21 +395,21 @@ spec: - name: ClusterMemoryCapacityReportName type: Report - name: NamespaceMemoryRequestQueryName - type: ReportGenerationQuery + type: ReportQuery default: namespace-memory-request - name: NamespaceMemoryUsageQueryName - type: ReportGenerationQuery + type: ReportQuery default: namespace-memory-usage - name: ClusterMemoryCapacityQueryName - type: ReportGenerationQuery + type: ReportQuery default: cluster-memory-capacity query: | WITH cluster_memory_capacity AS ( - {| renderReportGenerationQuery .Report.Inputs.ClusterMemoryCapacityQueryName . |} + {| renderReportQuery .Report.Inputs.ClusterMemoryCapacityQueryName . |} ), namespace_memory_usage AS ( - {| renderReportGenerationQuery .Report.Inputs.NamespaceMemoryUsageQueryName . |} + {| renderReportQuery .Report.Inputs.NamespaceMemoryUsageQueryName . |} ), namespace_memory_request AS ( - {| renderReportGenerationQuery .Report.Inputs.NamespaceMemoryRequestQueryName . |} + {| renderReportQuery .Report.Inputs.NamespaceMemoryRequestQueryName . |} ) SELECT timestamp '{| default .Report.ReportingStart .Report.Inputs.ReportingStart| prestoTimestamp |}' AS period_start, diff --git a/charts/openshift-reporting/values.yaml b/charts/openshift-reporting/values.yaml index db89e5ef4..cdcb40c04 100644 --- a/charts/openshift-reporting/values.yaml +++ b/charts/openshift-reporting/values.yaml @@ -10,7 +10,7 @@ spec: sum(kube_pod_container_resource_requests_cpu_cores) by (pod, namespace, node) pod-cpu-request-raw: spec: - generationQueryView: + reportQueryView: queryName: "pod-cpu-request-raw" pod-limit-cpu-cores: @@ -26,7 +26,7 @@ spec: label_replace(sum(rate(container_cpu_usage_seconds_total{container_name!="POD",container_name!="",pod_name!=""}[1m])) BY (pod_name, namespace), "pod", "$1", "pod_name", "(.*)") + on (pod, namespace) group_left(node) (sum(kube_pod_info{pod_ip!="",node!="",host_ip!=""}) by (pod, namespace, node) * 0) pod-cpu-usage-raw: spec: - generationQueryView: + reportQueryView: queryName: "pod-cpu-usage-raw" pod-request-memory-bytes: @@ -37,7 +37,7 @@ spec: pod-memory-request-raw: spec: - generationQueryView: + reportQueryView: queryName: "pod-memory-request-raw" pod-limit-memory-bytes: @@ -54,7 +54,7 @@ spec: pod-memory-usage-raw: spec: - generationQueryView: + reportQueryView: queryName: "pod-memory-usage-raw" persistentvolumeclaim-request-bytes: @@ -64,7 +64,7 @@ spec: max(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (namespace, persistentvolumeclaim) + on (namespace, persistentvolumeclaim) group_left(storageclass, volumename) sum(kube_persistentvolumeclaim_info) by (namespace, persistentvolumeclaim, storageclass, volumename) * 0 persistentvolumeclaim-request-raw: spec: - generationQueryView: + reportQueryView: queryName: "persistentvolumeclaim-request-raw" pod-persistentvolumeclaim-request-info: @@ -80,7 +80,7 @@ spec: kubelet_volume_stats_capacity_bytes persistentvolumeclaim-capacity-raw: spec: - generationQueryView: + reportQueryView: queryName: "persistentvolumeclaim-capacity-raw" persistentvolumeclaim-usage-bytes: @@ -90,7 +90,7 @@ spec: kubelet_volume_stats_used_bytes persistentvolumeclaim-usage-raw: spec: - generationQueryView: + reportQueryView: queryName: "persistentvolumeclaim-usage-raw" persistentvolumeclaim-phase: @@ -100,11 +100,11 @@ spec: kube_persistentvolumeclaim_status_phase persistentvolumeclaim-phase-raw: spec: - generationQueryView: + reportQueryView: queryName: "persistentvolumeclaim-phase-raw" persistentvolumeclaim-usage-with-phase-raw: spec: - generationQueryView: + reportQueryView: queryName: "persistentvolumeclaim-usage-with-phase-raw" @@ -115,7 +115,7 @@ spec: kube_node_status_allocatable_memory_bytes * on(node) group_left(provider_id) max(kube_node_info) by (node, provider_id) node-memory-allocatable-raw: spec: - generationQueryView: + reportQueryView: queryName: "node-memory-allocatable-raw" node-capacity-memory-bytes: @@ -125,7 +125,7 @@ spec: kube_node_status_capacity_memory_bytes * on(node) group_left(provider_id) max(kube_node_info) by (node, provider_id) node-memory-capacity-raw: spec: - generationQueryView: + reportQueryView: queryName: "node-memory-capacity-raw" node-allocatable-cpu-cores: @@ -135,7 +135,7 @@ spec: kube_node_status_allocatable_cpu_cores * on(node) group_left(provider_id) max(kube_node_info) by (node, provider_id) node-cpu-allocatable-raw: spec: - generationQueryView: + reportQueryView: queryName: "node-cpu-allocatable-raw" node-capacity-cpu-cores: @@ -145,23 +145,23 @@ spec: kube_node_status_capacity_cpu_cores * on(node) group_left(provider_id) max(kube_node_info) by (node, provider_id) node-cpu-capacity-raw: spec: - generationQueryView: + reportQueryView: queryName: "node-cpu-capacity-raw" cluster-cpu-usage-raw: spec: - generationQueryView: + reportQueryView: queryName: "cluster-cpu-usage-raw" cluster-memory-usage-raw: spec: - generationQueryView: + reportQueryView: queryName: "cluster-memory-usage-raw" cluster-cpu-capacity-raw: spec: - generationQueryView: + reportQueryView: queryName: "cluster-cpu-capacity-raw" cluster-memory-capacity-raw: spec: - generationQueryView: + reportQueryView: queryName: "cluster-memory-capacity-raw" diff --git a/charts/superset/.helmignore b/charts/superset/.helmignore index af6a68dbf..0675909c6 100755 --- a/charts/superset/.helmignore +++ b/charts/superset/.helmignore @@ -21,4 +21,4 @@ .idea/ *.tmproj # OWNERS file for Kubernetes -OWNERS \ No newline at end of file +OWNERS diff --git a/charts/superset/templates/_helpers.tpl b/charts/superset/templates/_helpers.tpl index 8e1823c38..d92099bf1 100755 --- a/charts/superset/templates/_helpers.tpl +++ b/charts/superset/templates/_helpers.tpl @@ -29,4 +29,4 @@ Create chart name and version as used by the chart label. */}} {{- define "superset.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/hack/e2e-test-runner.sh b/hack/e2e-test-runner.sh index 131c9114d..f56e4baee 100755 --- a/hack/e2e-test-runner.sh +++ b/hack/e2e-test-runner.sh @@ -43,7 +43,7 @@ TEST_OUTPUT_DIR=$TEST_OUTPUT_PATH/tests REPORT_RESULTS_DIR=$TEST_OUTPUT_PATH/report_results REPORTS_DIR=$TEST_OUTPUT_PATH/reports DATASOURCES_DIR=$TEST_OUTPUT_PATH/reportdatasources -REPORTGENERATIONQUERIES_DIR=$TEST_OUTPUT_PATH/reportgenerationqueries +REPORTQUERIES_DIR=$TEST_OUTPUT_PATH/reportqueries HIVETABLES_DIR=$TEST_OUTPUT_PATH/hivetables PRESTOTABLES_DIR=$TEST_OUTPUT_PATH/prestotables STORAGELOCATIONS_DIR=$TEST_OUTPUT_PATH/storagelocations @@ -54,7 +54,7 @@ TEST_JUNIT_REPORT_FILE_PATH="${TEST_JUNIT_REPORT_FILE_PATH:-$TEST_OUTPUT_DIR/$TE DEPLOY_LOG_FILE_PATH="${DEPLOY_LOG_FILE_PATH:-$LOG_DIR/$DEPLOY_LOG_FILE}" DEPLOY_POD_LOGS_LOG_FILE_PATH="${DEPLOY_POD_LOGS_LOG_FILE_PATH:-$LOG_DIR/$DEPLOY_POD_LOGS_LOG_FILE}" -mkdir -p "$LOG_DIR" "$TEST_OUTPUT_DIR" "$REPORT_RESULTS_DIR" "$REPORTS_DIR" "$DATASOURCES_DIR" "$REPORTGENERATIONQUERIES_DIR" "$HIVETABLES_DIR" "$PRESTOTABLES_DIR" "$STORAGELOCATIONS_DIR" +mkdir -p "$LOG_DIR" "$TEST_OUTPUT_DIR" "$REPORT_RESULTS_DIR" "$REPORTS_DIR" "$DATASOURCES_DIR" "$REPORTQUERIES_DIR" "$HIVETABLES_DIR" "$PRESTOTABLES_DIR" "$STORAGELOCATIONS_DIR" export SKIP_DELETE_CRDS=true export DELETE_PVCS=true @@ -138,12 +138,12 @@ function cleanup() { fi done <<< "$DATASOURCES" - echo "Capturing Metering ReportGenerationQueries" - RGQS="$(kubectl get reportgenerationqueries --no-headers --namespace "$METERING_NAMESPACE" -o name | cut -d/ -f2)" + echo "Capturing Metering ReportQueries" + RGQS="$(kubectl get reportqueries --no-headers --namespace "$METERING_NAMESPACE" -o name | cut -d/ -f2)" while read -r rgq; do if [[ -n "$rgq" ]]; then - echo "Capturing ReportGenerationQuery $rgq as json" - if ! kubectl get reportgenerationquery "$rgq" --namespace "$METERING_NAMESPACE" -o json > "$REPORTGENERATIONQUERIES_DIR/${rgq}.json"; then + echo "Capturing ReportQuery $rgq as json" + if ! kubectl get reportquery "$rgq" --namespace "$METERING_NAMESPACE" -o json > "$REPORTQUERIES_DIR/${rgq}.json"; then echo "Error getting $rgq as json" fi fi diff --git a/manifests/custom-resource-definitions/prestotable.crd.yaml b/manifests/custom-resource-definitions/prestotable.crd.yaml index 61a2e86e2..9e867fab3 100644 --- a/manifests/custom-resource-definitions/prestotable.crd.yaml +++ b/manifests/custom-resource-definitions/prestotable.crd.yaml @@ -4,7 +4,7 @@ metadata: name: prestotables.metering.openshift.io annotations: catalog.app.coreos.com/displayName: Metering Presto Table - catalog.app.coreos.com/description: Used under-the-hood. A resource describing a source of data for usage by Report Generation Queries. + catalog.app.coreos.com/description: Used under-the-hood. A resource describing a source of data for usage by Report Queries. catalog.app.coreos.com/weight: "6" spec: group: metering.openshift.io diff --git a/manifests/custom-resource-definitions/report.crd.yaml b/manifests/custom-resource-definitions/report.crd.yaml index b473db130..fdf0ab309 100644 --- a/manifests/custom-resource-definitions/report.crd.yaml +++ b/manifests/custom-resource-definitions/report.crd.yaml @@ -16,7 +16,7 @@ spec: additionalPrinterColumns: - name: Query type: string - JSONPath: .spec.generationQuery + JSONPath: .spec.query - name: Schedule type: string JSONPath: .spec.schedule.period diff --git a/manifests/custom-resource-definitions/reportdatasource.crd.yaml b/manifests/custom-resource-definitions/reportdatasource.crd.yaml index 418b1a69f..e92fd31c2 100644 --- a/manifests/custom-resource-definitions/reportdatasource.crd.yaml +++ b/manifests/custom-resource-definitions/reportdatasource.crd.yaml @@ -4,7 +4,7 @@ metadata: name: reportdatasources.metering.openshift.io annotations: catalog.app.coreos.com/displayName: Metering Data Source - catalog.app.coreos.com/description: Used under-the-hood. A resource a database table in Presto. Use by ReportGenerationQueries to determine what tables exist, and by the HTTP API to determine how to query a table. + catalog.app.coreos.com/description: Used under-the-hood. A resource a database table in Presto. Use by ReportQueries to determine what tables exist, and by the HTTP API to determine how to query a table. catalog.app.coreos.com/weight: "4" spec: group: metering.openshift.io diff --git a/manifests/custom-resource-definitions/reportgenerationquery.crd.yaml b/manifests/custom-resource-definitions/reportquery.crd.yaml similarity index 64% rename from manifests/custom-resource-definitions/reportgenerationquery.crd.yaml rename to manifests/custom-resource-definitions/reportquery.crd.yaml index 692e8555b..25ec0ab30 100644 --- a/manifests/custom-resource-definitions/reportgenerationquery.crd.yaml +++ b/manifests/custom-resource-definitions/reportquery.crd.yaml @@ -1,9 +1,9 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: reportgenerationqueries.metering.openshift.io + name: reportqueries.metering.openshift.io annotations: - catalog.app.coreos.com/displayName: Metering Generation Query + catalog.app.coreos.com/displayName: Metering Report Query catalog.app.coreos.com/description: A SQL query used by Metering to generate reports. catalog.app.coreos.com/weight: "2" spec: @@ -11,11 +11,11 @@ spec: version: v1alpha1 scope: Namespaced names: - plural: reportgenerationqueries - singular: reportgenerationquery - kind: ReportGenerationQuery + plural: reportqueries + singular: reportquery + kind: ReportQuery shortNames: - - rgq + - rq additionalPrinterColumns: - name: Age type: date diff --git a/manifests/deploy/common-olm-values.yaml b/manifests/deploy/common-olm-values.yaml index c0ce39fc3..56c139165 100644 --- a/manifests/deploy/common-olm-values.yaml +++ b/manifests/deploy/common-olm-values.yaml @@ -85,7 +85,7 @@ annotations: "name": "unready-deployment-replicas-hourly" }, "spec": { - "generationQuery": "unready-deployment-replicas", + "query": "unready-deployment-replicas", "schedule": { "period": "hourly" } @@ -93,7 +93,7 @@ annotations: }, { "apiVersion": "metering.openshift.io/v1alpha1", - "kind": "ReportGenerationQuery", + "kind": "ReportQuery", "metadata": { "name": "unready-deployment-replicas" }, diff --git a/manifests/deploy/openshift/olm/bundle/meteringoperator.v4.1.0.clusterserviceversion.yaml b/manifests/deploy/openshift/olm/bundle/meteringoperator.v4.1.0.clusterserviceversion.yaml index e65042388..87b6bae30 100644 --- a/manifests/deploy/openshift/olm/bundle/meteringoperator.v4.1.0.clusterserviceversion.yaml +++ b/manifests/deploy/openshift/olm/bundle/meteringoperator.v4.1.0.clusterserviceversion.yaml @@ -21,7 +21,7 @@ metadata: "name": "unready-deployment-replicas-hourly" }, "spec": { - "generationQuery": "unready-deployment-replicas", + "query": "unready-deployment-replicas", "schedule": { "period": "hourly" } @@ -29,7 +29,7 @@ metadata: }, { "apiVersion": "metering.openshift.io/v1alpha1", - "kind": "ReportGenerationQuery", + "kind": "ReportQuery", "metadata": { "name": "unready-deployment-replicas" }, @@ -581,13 +581,13 @@ spec: name: reports.metering.openshift.io version: v1alpha1 - description: A SQL query used by Metering to generate reports. - displayName: Metering Generation Query - kind: ReportGenerationQuery - name: reportgenerationqueries.metering.openshift.io + displayName: Metering Report Query + kind: ReportQuery + name: reportqueries.metering.openshift.io version: v1alpha1 - description: Used under-the-hood. A resource a database table in Presto. Use by - ReportGenerationQueries to determine what tables exist, and by the HTTP API to - determine how to query a table. + ReportQueries to determine what tables exist, and by the HTTP API to determine + how to query a table. displayName: Metering Data Source kind: ReportDataSource name: reportdatasources.metering.openshift.io @@ -599,7 +599,7 @@ spec: name: storagelocations.metering.openshift.io version: v1alpha1 - description: Used under-the-hood. A resource describing a source of data for usage - by Report Generation Queries. + by Report Queries. displayName: Metering Presto Table kind: PrestoTable name: prestotables.metering.openshift.io diff --git a/manifests/deploy/openshift/olm/bundle/prestotable.crd.yaml b/manifests/deploy/openshift/olm/bundle/prestotable.crd.yaml index 61a2e86e2..9e867fab3 100644 --- a/manifests/deploy/openshift/olm/bundle/prestotable.crd.yaml +++ b/manifests/deploy/openshift/olm/bundle/prestotable.crd.yaml @@ -4,7 +4,7 @@ metadata: name: prestotables.metering.openshift.io annotations: catalog.app.coreos.com/displayName: Metering Presto Table - catalog.app.coreos.com/description: Used under-the-hood. A resource describing a source of data for usage by Report Generation Queries. + catalog.app.coreos.com/description: Used under-the-hood. A resource describing a source of data for usage by Report Queries. catalog.app.coreos.com/weight: "6" spec: group: metering.openshift.io diff --git a/manifests/deploy/openshift/olm/bundle/report.crd.yaml b/manifests/deploy/openshift/olm/bundle/report.crd.yaml index b473db130..fdf0ab309 100644 --- a/manifests/deploy/openshift/olm/bundle/report.crd.yaml +++ b/manifests/deploy/openshift/olm/bundle/report.crd.yaml @@ -16,7 +16,7 @@ spec: additionalPrinterColumns: - name: Query type: string - JSONPath: .spec.generationQuery + JSONPath: .spec.query - name: Schedule type: string JSONPath: .spec.schedule.period diff --git a/manifests/deploy/openshift/olm/bundle/reportdatasource.crd.yaml b/manifests/deploy/openshift/olm/bundle/reportdatasource.crd.yaml index 418b1a69f..e92fd31c2 100644 --- a/manifests/deploy/openshift/olm/bundle/reportdatasource.crd.yaml +++ b/manifests/deploy/openshift/olm/bundle/reportdatasource.crd.yaml @@ -4,7 +4,7 @@ metadata: name: reportdatasources.metering.openshift.io annotations: catalog.app.coreos.com/displayName: Metering Data Source - catalog.app.coreos.com/description: Used under-the-hood. A resource a database table in Presto. Use by ReportGenerationQueries to determine what tables exist, and by the HTTP API to determine how to query a table. + catalog.app.coreos.com/description: Used under-the-hood. A resource a database table in Presto. Use by ReportQueries to determine what tables exist, and by the HTTP API to determine how to query a table. catalog.app.coreos.com/weight: "4" spec: group: metering.openshift.io diff --git a/manifests/deploy/openshift/olm/bundle/reportgenerationquery.crd.yaml b/manifests/deploy/openshift/olm/bundle/reportquery.crd.yaml similarity index 64% rename from manifests/deploy/openshift/olm/bundle/reportgenerationquery.crd.yaml rename to manifests/deploy/openshift/olm/bundle/reportquery.crd.yaml index 692e8555b..25ec0ab30 100644 --- a/manifests/deploy/openshift/olm/bundle/reportgenerationquery.crd.yaml +++ b/manifests/deploy/openshift/olm/bundle/reportquery.crd.yaml @@ -1,9 +1,9 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: reportgenerationqueries.metering.openshift.io + name: reportqueries.metering.openshift.io annotations: - catalog.app.coreos.com/displayName: Metering Generation Query + catalog.app.coreos.com/displayName: Metering Report Query catalog.app.coreos.com/description: A SQL query used by Metering to generate reports. catalog.app.coreos.com/weight: "2" spec: @@ -11,11 +11,11 @@ spec: version: v1alpha1 scope: Namespaced names: - plural: reportgenerationqueries - singular: reportgenerationquery - kind: ReportGenerationQuery + plural: reportqueries + singular: reportquery + kind: ReportQuery shortNames: - - rgq + - rq additionalPrinterColumns: - name: Age type: date diff --git a/manifests/reports/cluster-capacity-daily.yaml b/manifests/reports/cluster-capacity-daily.yaml index fc706f5ad..cc34a188c 100644 --- a/manifests/reports/cluster-capacity-daily.yaml +++ b/manifests/reports/cluster-capacity-daily.yaml @@ -3,7 +3,7 @@ kind: Report metadata: name: cluster-cpu-capacity-daily spec: - generationQuery: "cluster-cpu-capacity" + query: "cluster-cpu-capacity" # this configures the this report to aggregate the hourly one inputs: - name: ClusterCpuCapacityReportName @@ -18,7 +18,7 @@ kind: Report metadata: name: cluster-memory-capacity-daily spec: - generationQuery: "cluster-memory-capacity" + query: "cluster-memory-capacity" # this configures the this report to aggregate the hourly one inputs: - name: ClusterMemoryCapacityReportName diff --git a/manifests/reports/cluster-capacity-hourly.yaml b/manifests/reports/cluster-capacity-hourly.yaml index 8ed8e619d..8e840234f 100644 --- a/manifests/reports/cluster-capacity-hourly.yaml +++ b/manifests/reports/cluster-capacity-hourly.yaml @@ -3,7 +3,7 @@ kind: Report metadata: name: cluster-cpu-capacity-hourly spec: - generationQuery: "cluster-cpu-capacity" + query: "cluster-cpu-capacity" schedule: period: "hourly" @@ -14,7 +14,7 @@ kind: Report metadata: name: cluster-memory-capacity-hourly spec: - generationQuery: "cluster-memory-capacity" + query: "cluster-memory-capacity" schedule: period: "hourly" diff --git a/manifests/reports/cluster-usage-daily.yaml b/manifests/reports/cluster-usage-daily.yaml index cd97c6ab3..7fa627785 100644 --- a/manifests/reports/cluster-usage-daily.yaml +++ b/manifests/reports/cluster-usage-daily.yaml @@ -3,7 +3,7 @@ kind: Report metadata: name: cluster-cpu-usage-daily spec: - generationQuery: "cluster-cpu-usage" + query: "cluster-cpu-usage" # this configures the this report to aggregate the hourly one inputs: - name: ClusterCpuusageReportName @@ -18,7 +18,7 @@ kind: Report metadata: name: cluster-memory-usage-daily spec: - generationQuery: "cluster-memory-usage" + query: "cluster-memory-usage" # this configures the this report to aggregate the hourly one inputs: - name: ClusterMemoryusageReportName diff --git a/manifests/reports/cluster-usage-hourly.yaml b/manifests/reports/cluster-usage-hourly.yaml index eb32d14b8..f1916a939 100644 --- a/manifests/reports/cluster-usage-hourly.yaml +++ b/manifests/reports/cluster-usage-hourly.yaml @@ -3,7 +3,7 @@ kind: Report metadata: name: cluster-cpu-usage-hourly spec: - generationQuery: "cluster-cpu-usage" + query: "cluster-cpu-usage" schedule: period: "hourly" @@ -14,7 +14,7 @@ kind: Report metadata: name: cluster-memory-usage-hourly spec: - generationQuery: "cluster-memory-usage" + query: "cluster-memory-usage" schedule: period: "hourly" diff --git a/manifests/reports/cluster-utilization-daily.yaml b/manifests/reports/cluster-utilization-daily.yaml index c191d5ae6..ce4d3e9e5 100644 --- a/manifests/reports/cluster-utilization-daily.yaml +++ b/manifests/reports/cluster-utilization-daily.yaml @@ -3,7 +3,7 @@ kind: Report metadata: name: cluster-cpu-utilization-daily spec: - generationQuery: "cluster-cpu-utilization" + query: "cluster-cpu-utilization" inputs: - name: ClusterCpuUtilizationReportName value: cluster-cpu-utilization-hourly @@ -17,7 +17,7 @@ kind: Report metadata: name: cluster-memory-utilization-daily spec: - generationQuery: "cluster-memory-utilization" + query: "cluster-memory-utilization" inputs: - name: ClusterMemoryUtilizationReportName value: cluster-memory-utilization-hourly diff --git a/manifests/reports/cluster-utilization-hourly.yaml b/manifests/reports/cluster-utilization-hourly.yaml index 1349e5da3..c34830177 100644 --- a/manifests/reports/cluster-utilization-hourly.yaml +++ b/manifests/reports/cluster-utilization-hourly.yaml @@ -3,7 +3,7 @@ kind: Report metadata: name: cluster-cpu-utilization-hourly spec: - generationQuery: "cluster-cpu-utilization" + query: "cluster-cpu-utilization" inputs: - name: ClusterCpuCapacityReportName value: cluster-cpu-capacity-hourly @@ -19,7 +19,7 @@ kind: Report metadata: name: cluster-memory-utilization-hourly spec: - generationQuery: "cluster-memory-utilization" + query: "cluster-memory-utilization" inputs: - name: ClusterMemoryCapacityReportName value: cluster-memory-capacity-hourly diff --git a/manifests/reports/namespace-usage-daily.yaml b/manifests/reports/namespace-usage-daily.yaml index f27495e95..b3d3ed0c3 100644 --- a/manifests/reports/namespace-usage-daily.yaml +++ b/manifests/reports/namespace-usage-daily.yaml @@ -3,7 +3,7 @@ kind: Report metadata: name: namespace-memory-usage-daily spec: - generationQuery: "namespace-memory-usage" + query: "namespace-memory-usage" schedule: period: "daily" @@ -14,6 +14,6 @@ kind: Report metadata: name: namespace-cpu-usage-daily spec: - generationQuery: "namespace-cpu-usage" + query: "namespace-cpu-usage" schedule: period: "daily" diff --git a/manifests/reports/namespace-usage-hourly.yaml b/manifests/reports/namespace-usage-hourly.yaml index 347b9a5ea..5c62cbad8 100644 --- a/manifests/reports/namespace-usage-hourly.yaml +++ b/manifests/reports/namespace-usage-hourly.yaml @@ -3,7 +3,7 @@ kind: Report metadata: name: namespace-memory-usage-hourly spec: - generationQuery: "namespace-memory-usage" + query: "namespace-memory-usage" schedule: period: "hourly" @@ -14,6 +14,6 @@ kind: Report metadata: name: namespace-cpu-usage-hourly spec: - generationQuery: "namespace-cpu-usage" + query: "namespace-cpu-usage" schedule: period: "hourly" diff --git a/pkg/apis/metering/v1alpha1/register.go b/pkg/apis/metering/v1alpha1/register.go index 38bdf320d..dc17bbfae 100644 --- a/pkg/apis/metering/v1alpha1/register.go +++ b/pkg/apis/metering/v1alpha1/register.go @@ -31,8 +31,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ReportList{}, &ReportDataSource{}, &ReportDataSourceList{}, - &ReportGenerationQuery{}, - &ReportGenerationQueryList{}, + &ReportQuery{}, + &ReportQueryList{}, &StorageLocation{}, &StorageLocationList{}, &PrestoTable{}, diff --git a/pkg/apis/metering/v1alpha1/report.go b/pkg/apis/metering/v1alpha1/report.go index 0fd9bc325..6eea6e4f2 100644 --- a/pkg/apis/metering/v1alpha1/report.go +++ b/pkg/apis/metering/v1alpha1/report.go @@ -27,9 +27,9 @@ type Report struct { } type ReportSpec struct { - // GenerationQueryName specifies the ReportGenerationQuery to execute when + // QueryName specifies the ReportQuery to execute when // the report runs. - GenerationQueryName string `json:"generationQuery"` + QueryName string `json:"query"` // Schedule configures when the report runs. Schedule *ReportSchedule `json:"schedule,omitempty"` @@ -55,8 +55,8 @@ type ReportSpec struct { // and, ReportingEnd. RunImmediately bool `json:"runImmediately,omitempty"` - // Inputs are the inputs to the ReportGenerationQuery - Inputs ReportGenerationQueryInputValues `json:"inputs,omitempty"` + // Inputs are the inputs to the ReportQuery + Inputs ReportQueryInputValues `json:"inputs,omitempty"` // Output is the storage location where results are sent. Output *StorageLocationRef `json:"output,omitempty"` diff --git a/pkg/apis/metering/v1alpha1/report_datasource.go b/pkg/apis/metering/v1alpha1/report_datasource.go index 0b3a00db6..f8cd6d8b9 100644 --- a/pkg/apis/metering/v1alpha1/report_datasource.go +++ b/pkg/apis/metering/v1alpha1/report_datasource.go @@ -36,9 +36,9 @@ type ReportDataSourceSpec struct { // PrestoTable CR. PrestoTable *PrestoTableDataSource `json:"prestoTable,omitempty"` - // GenerationQueryView represents a datasource which creates a Presto - // view from a ReportGenerationQuery - GenerationQueryView *GenerationQueryViewDataSource `json:"generationQueryView,omitempty"` + // ReportQueryView represents a datasource which creates a Presto + // view from a ReportQuery + ReportQueryView *ReportQueryViewDataSource `json:"reportQueryView,omitempty"` } type AWSBillingDataSource struct { @@ -73,13 +73,13 @@ type PrestoTableDataSource struct { TableRef v1.LocalObjectReference `json:"tableRef"` } -type GenerationQueryViewDataSource struct { - // QueryName specifies the ReportGenerationQuery to execute when the report +type ReportQueryViewDataSource struct { + // QueryName specifies the ReportQuery to execute when the report // runs. QueryName string `json:"queryName"` - // Inputs are the inputs to the ReportGenerationQuery - Inputs ReportGenerationQueryInputValues `json:"inputs,omitempty"` - Storage *StorageLocationRef `json:"storage,omitempty"` + // Inputs are the inputs to the ReportQuery + Inputs ReportQueryInputValues `json:"inputs,omitempty"` + Storage *StorageLocationRef `json:"storage,omitempty"` } type ReportDataSourceStatus struct { diff --git a/pkg/apis/metering/v1alpha1/report_generation_query.go b/pkg/apis/metering/v1alpha1/report_query.go similarity index 51% rename from pkg/apis/metering/v1alpha1/report_generation_query.go rename to pkg/apis/metering/v1alpha1/report_query.go index 269c0370f..75b5d1938 100644 --- a/pkg/apis/metering/v1alpha1/report_generation_query.go +++ b/pkg/apis/metering/v1alpha1/report_query.go @@ -6,53 +6,53 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) -var ReportGenerationQueryGVK = SchemeGroupVersion.WithKind("ReportGenerationQuery") +var ReportQueryGVK = SchemeGroupVersion.WithKind("ReportQuery") // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ReportGenerationQueryList struct { +type ReportQueryList struct { meta.TypeMeta `json:",inline"` meta.ListMeta `json:"metadata,omitempty"` - Items []*ReportGenerationQuery `json:"items"` + Items []*ReportQuery `json:"items"` } // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ReportGenerationQuery struct { +type ReportQuery struct { meta.TypeMeta `json:",inline"` meta.ObjectMeta `json:"metadata,omitempty"` - Spec ReportGenerationQuerySpec `json:"spec"` - Status ReportGenerationQueryStatus `json:"status"` + Spec ReportQuerySpec `json:"spec"` + Status ReportQueryStatus `json:"status"` } -type ReportGenerationQuerySpec struct { - Columns []ReportGenerationQueryColumn `json:"columns"` - Query string `json:"query"` - Inputs []ReportGenerationQueryInputDefinition `json:"inputs,omitempty"` +type ReportQuerySpec struct { + Columns []ReportQueryColumn `json:"columns"` + Query string `json:"query"` + Inputs []ReportQueryInputDefinition `json:"inputs,omitempty"` } -type ReportGenerationQueryColumn struct { +type ReportQueryColumn struct { Name string `json:"name"` Type string `json:"type"` TableHidden bool `json:"tableHidden"` Unit string `json:"unit,omitempty"` } -type ReportGenerationQueryInputDefinition struct { +type ReportQueryInputDefinition struct { Name string `json:"name"` Required bool `json:"required"` Type string `json:"type,omitempty"` Default *json.RawMessage `json:"default,omitempty"` } -type ReportGenerationQueryInputValue struct { +type ReportQueryInputValue struct { Name string `json:"name"` Value *json.RawMessage `json:"value,omitempty"` } -type ReportGenerationQueryInputValues []ReportGenerationQueryInputValue +type ReportQueryInputValues []ReportQueryInputValue -type ReportGenerationQueryStatus struct { +type ReportQueryStatus struct { } diff --git a/pkg/apis/metering/v1alpha1/util/report_util.go b/pkg/apis/metering/v1alpha1/util/report_util.go index db5b3ab70..e82ff5606 100644 --- a/pkg/apis/metering/v1alpha1/util/report_util.go +++ b/pkg/apis/metering/v1alpha1/util/report_util.go @@ -31,12 +31,12 @@ const ( ReportFinishedReason = "Finished" // InvalidReportReason is added to a Report when the - // Report is invalid or it's ReportGenerationQuery is invalid. + // Report is invalid or it's ReportQuery is invalid. InvalidReportReason = "InvalidReport" // ReportingPeriodUnmetDependenciesReason is set when a Report cannot run - // because it's dependencies (ReportGenerationQueries dependencies on - // ReportDataSources, ReportGenerationQueries, and other Reports) do not + // because it's dependencies (ReportQueries dependencies on + // ReportDataSources, ReportQueries, and other Reports) do not // have data available for the reporting period currently being processed. ReportingPeriodUnmetDependenciesReason = "ReportingPeriodUnmetDependencies" diff --git a/pkg/apis/metering/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/metering/v1alpha1/zz_generated.deepcopy.go index 34733087b..c335f111e 100644 --- a/pkg/apis/metering/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/metering/v1alpha1/zz_generated.deepcopy.go @@ -34,34 +34,6 @@ func (in *AWSBillingDataSource) DeepCopy() *AWSBillingDataSource { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GenerationQueryViewDataSource) DeepCopyInto(out *GenerationQueryViewDataSource) { - *out = *in - if in.Inputs != nil { - in, out := &in.Inputs, &out.Inputs - *out = make(ReportGenerationQueryInputValues, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Storage != nil { - in, out := &in.Storage, &out.Storage - *out = new(StorageLocationRef) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenerationQueryViewDataSource. -func (in *GenerationQueryViewDataSource) DeepCopy() *GenerationQueryViewDataSource { - if in == nil { - return nil - } - out := new(GenerationQueryViewDataSource) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HiveColumn) DeepCopyInto(out *HiveColumn) { *out = *in @@ -704,9 +676,9 @@ func (in *ReportDataSourceSpec) DeepCopyInto(out *ReportDataSourceSpec) { *out = new(PrestoTableDataSource) **out = **in } - if in.GenerationQueryView != nil { - in, out := &in.GenerationQueryView, &out.GenerationQueryView - *out = new(GenerationQueryViewDataSource) + if in.ReportQueryView != nil { + in, out := &in.ReportQueryView, &out.ReportQueryView + *out = new(ReportQueryViewDataSource) (*in).DeepCopyInto(*out) } return @@ -745,7 +717,44 @@ func (in *ReportDataSourceStatus) DeepCopy() *ReportDataSourceStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReportGenerationQuery) DeepCopyInto(out *ReportGenerationQuery) { +func (in *ReportList) DeepCopyInto(out *ReportList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*Report, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Report) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportList. +func (in *ReportList) DeepCopy() *ReportList { + if in == nil { + return nil + } + out := new(ReportList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ReportList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReportQuery) DeepCopyInto(out *ReportQuery) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -754,18 +763,18 @@ func (in *ReportGenerationQuery) DeepCopyInto(out *ReportGenerationQuery) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportGenerationQuery. -func (in *ReportGenerationQuery) DeepCopy() *ReportGenerationQuery { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportQuery. +func (in *ReportQuery) DeepCopy() *ReportQuery { if in == nil { return nil } - out := new(ReportGenerationQuery) + out := new(ReportQuery) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ReportGenerationQuery) DeepCopyObject() runtime.Object { +func (in *ReportQuery) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -773,23 +782,23 @@ func (in *ReportGenerationQuery) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReportGenerationQueryColumn) DeepCopyInto(out *ReportGenerationQueryColumn) { +func (in *ReportQueryColumn) DeepCopyInto(out *ReportQueryColumn) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportGenerationQueryColumn. -func (in *ReportGenerationQueryColumn) DeepCopy() *ReportGenerationQueryColumn { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportQueryColumn. +func (in *ReportQueryColumn) DeepCopy() *ReportQueryColumn { if in == nil { return nil } - out := new(ReportGenerationQueryColumn) + out := new(ReportQueryColumn) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReportGenerationQueryInputDefinition) DeepCopyInto(out *ReportGenerationQueryInputDefinition) { +func (in *ReportQueryInputDefinition) DeepCopyInto(out *ReportQueryInputDefinition) { *out = *in if in.Default != nil { in, out := &in.Default, &out.Default @@ -803,18 +812,18 @@ func (in *ReportGenerationQueryInputDefinition) DeepCopyInto(out *ReportGenerati return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportGenerationQueryInputDefinition. -func (in *ReportGenerationQueryInputDefinition) DeepCopy() *ReportGenerationQueryInputDefinition { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportQueryInputDefinition. +func (in *ReportQueryInputDefinition) DeepCopy() *ReportQueryInputDefinition { if in == nil { return nil } - out := new(ReportGenerationQueryInputDefinition) + out := new(ReportQueryInputDefinition) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReportGenerationQueryInputValue) DeepCopyInto(out *ReportGenerationQueryInputValue) { +func (in *ReportQueryInputValue) DeepCopyInto(out *ReportQueryInputValue) { *out = *in if in.Value != nil { in, out := &in.Value, &out.Value @@ -828,21 +837,21 @@ func (in *ReportGenerationQueryInputValue) DeepCopyInto(out *ReportGenerationQue return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportGenerationQueryInputValue. -func (in *ReportGenerationQueryInputValue) DeepCopy() *ReportGenerationQueryInputValue { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportQueryInputValue. +func (in *ReportQueryInputValue) DeepCopy() *ReportQueryInputValue { if in == nil { return nil } - out := new(ReportGenerationQueryInputValue) + out := new(ReportQueryInputValue) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in ReportGenerationQueryInputValues) DeepCopyInto(out *ReportGenerationQueryInputValues) { +func (in ReportQueryInputValues) DeepCopyInto(out *ReportQueryInputValues) { { in := &in - *out = make(ReportGenerationQueryInputValues, len(*in)) + *out = make(ReportQueryInputValues, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -850,28 +859,28 @@ func (in ReportGenerationQueryInputValues) DeepCopyInto(out *ReportGenerationQue } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportGenerationQueryInputValues. -func (in ReportGenerationQueryInputValues) DeepCopy() ReportGenerationQueryInputValues { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportQueryInputValues. +func (in ReportQueryInputValues) DeepCopy() ReportQueryInputValues { if in == nil { return nil } - out := new(ReportGenerationQueryInputValues) + out := new(ReportQueryInputValues) in.DeepCopyInto(out) return *out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReportGenerationQueryList) DeepCopyInto(out *ReportGenerationQueryList) { +func (in *ReportQueryList) DeepCopyInto(out *ReportQueryList) { *out = *in out.TypeMeta = in.TypeMeta out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]*ReportGenerationQuery, len(*in)) + *out = make([]*ReportQuery, len(*in)) for i := range *in { if (*in)[i] != nil { in, out := &(*in)[i], &(*out)[i] - *out = new(ReportGenerationQuery) + *out = new(ReportQuery) (*in).DeepCopyInto(*out) } } @@ -879,18 +888,18 @@ func (in *ReportGenerationQueryList) DeepCopyInto(out *ReportGenerationQueryList return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportGenerationQueryList. -func (in *ReportGenerationQueryList) DeepCopy() *ReportGenerationQueryList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportQueryList. +func (in *ReportQueryList) DeepCopy() *ReportQueryList { if in == nil { return nil } - out := new(ReportGenerationQueryList) + out := new(ReportQueryList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ReportGenerationQueryList) DeepCopyObject() runtime.Object { +func (in *ReportQueryList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -898,16 +907,16 @@ func (in *ReportGenerationQueryList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReportGenerationQuerySpec) DeepCopyInto(out *ReportGenerationQuerySpec) { +func (in *ReportQuerySpec) DeepCopyInto(out *ReportQuerySpec) { *out = *in if in.Columns != nil { in, out := &in.Columns, &out.Columns - *out = make([]ReportGenerationQueryColumn, len(*in)) + *out = make([]ReportQueryColumn, len(*in)) copy(*out, *in) } if in.Inputs != nil { in, out := &in.Inputs, &out.Inputs - *out = make([]ReportGenerationQueryInputDefinition, len(*in)) + *out = make([]ReportQueryInputDefinition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -915,69 +924,60 @@ func (in *ReportGenerationQuerySpec) DeepCopyInto(out *ReportGenerationQuerySpec return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportGenerationQuerySpec. -func (in *ReportGenerationQuerySpec) DeepCopy() *ReportGenerationQuerySpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportQuerySpec. +func (in *ReportQuerySpec) DeepCopy() *ReportQuerySpec { if in == nil { return nil } - out := new(ReportGenerationQuerySpec) + out := new(ReportQuerySpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReportGenerationQueryStatus) DeepCopyInto(out *ReportGenerationQueryStatus) { +func (in *ReportQueryStatus) DeepCopyInto(out *ReportQueryStatus) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportGenerationQueryStatus. -func (in *ReportGenerationQueryStatus) DeepCopy() *ReportGenerationQueryStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportQueryStatus. +func (in *ReportQueryStatus) DeepCopy() *ReportQueryStatus { if in == nil { return nil } - out := new(ReportGenerationQueryStatus) + out := new(ReportQueryStatus) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReportList) DeepCopyInto(out *ReportList) { +func (in *ReportQueryViewDataSource) DeepCopyInto(out *ReportQueryViewDataSource) { *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]*Report, len(*in)) + if in.Inputs != nil { + in, out := &in.Inputs, &out.Inputs + *out = make(ReportQueryInputValues, len(*in)) for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(Report) - (*in).DeepCopyInto(*out) - } + (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Storage != nil { + in, out := &in.Storage, &out.Storage + *out = new(StorageLocationRef) + **out = **in + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportList. -func (in *ReportList) DeepCopy() *ReportList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportQueryViewDataSource. +func (in *ReportQueryViewDataSource) DeepCopy() *ReportQueryViewDataSource { if in == nil { return nil } - out := new(ReportList) + out := new(ReportQueryViewDataSource) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ReportList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReportSchedule) DeepCopyInto(out *ReportSchedule) { *out = *in @@ -1127,7 +1127,7 @@ func (in *ReportSpec) DeepCopyInto(out *ReportSpec) { } if in.Inputs != nil { in, out := &in.Inputs, &out.Inputs - *out = make(ReportGenerationQueryInputValues, len(*in)) + *out = make(ReportQueryInputValues, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } diff --git a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_metering_client.go b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_metering_client.go index 67be08032..b0980c53b 100644 --- a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_metering_client.go +++ b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_metering_client.go @@ -28,8 +28,8 @@ func (c *FakeMeteringV1alpha1) ReportDataSources(namespace string) v1alpha1.Repo return &FakeReportDataSources{c, namespace} } -func (c *FakeMeteringV1alpha1) ReportGenerationQueries(namespace string) v1alpha1.ReportGenerationQueryInterface { - return &FakeReportGenerationQueries{c, namespace} +func (c *FakeMeteringV1alpha1) ReportQueries(namespace string) v1alpha1.ReportQueryInterface { + return &FakeReportQueries{c, namespace} } func (c *FakeMeteringV1alpha1) StorageLocations(namespace string) v1alpha1.StorageLocationInterface { diff --git a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_reportgenerationquery.go b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_reportgenerationquery.go deleted file mode 100644 index 7d0b90487..000000000 --- a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_reportgenerationquery.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeReportGenerationQueries implements ReportGenerationQueryInterface -type FakeReportGenerationQueries struct { - Fake *FakeMeteringV1alpha1 - ns string -} - -var reportgenerationqueriesResource = schema.GroupVersionResource{Group: "metering.openshift.io", Version: "v1alpha1", Resource: "reportgenerationqueries"} - -var reportgenerationqueriesKind = schema.GroupVersionKind{Group: "metering.openshift.io", Version: "v1alpha1", Kind: "ReportGenerationQuery"} - -// Get takes name of the reportGenerationQuery, and returns the corresponding reportGenerationQuery object, and an error if there is any. -func (c *FakeReportGenerationQueries) Get(name string, options v1.GetOptions) (result *v1alpha1.ReportGenerationQuery, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(reportgenerationqueriesResource, c.ns, name), &v1alpha1.ReportGenerationQuery{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ReportGenerationQuery), err -} - -// List takes label and field selectors, and returns the list of ReportGenerationQueries that match those selectors. -func (c *FakeReportGenerationQueries) List(opts v1.ListOptions) (result *v1alpha1.ReportGenerationQueryList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(reportgenerationqueriesResource, reportgenerationqueriesKind, c.ns, opts), &v1alpha1.ReportGenerationQueryList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ReportGenerationQueryList{ListMeta: obj.(*v1alpha1.ReportGenerationQueryList).ListMeta} - for _, item := range obj.(*v1alpha1.ReportGenerationQueryList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested reportGenerationQueries. -func (c *FakeReportGenerationQueries) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(reportgenerationqueriesResource, c.ns, opts)) - -} - -// Create takes the representation of a reportGenerationQuery and creates it. Returns the server's representation of the reportGenerationQuery, and an error, if there is any. -func (c *FakeReportGenerationQueries) Create(reportGenerationQuery *v1alpha1.ReportGenerationQuery) (result *v1alpha1.ReportGenerationQuery, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(reportgenerationqueriesResource, c.ns, reportGenerationQuery), &v1alpha1.ReportGenerationQuery{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ReportGenerationQuery), err -} - -// Update takes the representation of a reportGenerationQuery and updates it. Returns the server's representation of the reportGenerationQuery, and an error, if there is any. -func (c *FakeReportGenerationQueries) Update(reportGenerationQuery *v1alpha1.ReportGenerationQuery) (result *v1alpha1.ReportGenerationQuery, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(reportgenerationqueriesResource, c.ns, reportGenerationQuery), &v1alpha1.ReportGenerationQuery{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ReportGenerationQuery), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeReportGenerationQueries) UpdateStatus(reportGenerationQuery *v1alpha1.ReportGenerationQuery) (*v1alpha1.ReportGenerationQuery, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(reportgenerationqueriesResource, "status", c.ns, reportGenerationQuery), &v1alpha1.ReportGenerationQuery{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ReportGenerationQuery), err -} - -// Delete takes name of the reportGenerationQuery and deletes it. Returns an error if one occurs. -func (c *FakeReportGenerationQueries) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(reportgenerationqueriesResource, c.ns, name), &v1alpha1.ReportGenerationQuery{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeReportGenerationQueries) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(reportgenerationqueriesResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.ReportGenerationQueryList{}) - return err -} - -// Patch applies the patch and returns the patched reportGenerationQuery. -func (c *FakeReportGenerationQueries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ReportGenerationQuery, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(reportgenerationqueriesResource, c.ns, name, pt, data, subresources...), &v1alpha1.ReportGenerationQuery{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ReportGenerationQuery), err -} diff --git a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_reportquery.go b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_reportquery.go new file mode 100644 index 000000000..034122660 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/fake/fake_reportquery.go @@ -0,0 +1,124 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeReportQueries implements ReportQueryInterface +type FakeReportQueries struct { + Fake *FakeMeteringV1alpha1 + ns string +} + +var reportqueriesResource = schema.GroupVersionResource{Group: "metering.openshift.io", Version: "v1alpha1", Resource: "reportqueries"} + +var reportqueriesKind = schema.GroupVersionKind{Group: "metering.openshift.io", Version: "v1alpha1", Kind: "ReportQuery"} + +// Get takes name of the reportQuery, and returns the corresponding reportQuery object, and an error if there is any. +func (c *FakeReportQueries) Get(name string, options v1.GetOptions) (result *v1alpha1.ReportQuery, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(reportqueriesResource, c.ns, name), &v1alpha1.ReportQuery{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ReportQuery), err +} + +// List takes label and field selectors, and returns the list of ReportQueries that match those selectors. +func (c *FakeReportQueries) List(opts v1.ListOptions) (result *v1alpha1.ReportQueryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(reportqueriesResource, reportqueriesKind, c.ns, opts), &v1alpha1.ReportQueryList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.ReportQueryList{ListMeta: obj.(*v1alpha1.ReportQueryList).ListMeta} + for _, item := range obj.(*v1alpha1.ReportQueryList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested reportQueries. +func (c *FakeReportQueries) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(reportqueriesResource, c.ns, opts)) + +} + +// Create takes the representation of a reportQuery and creates it. Returns the server's representation of the reportQuery, and an error, if there is any. +func (c *FakeReportQueries) Create(reportQuery *v1alpha1.ReportQuery) (result *v1alpha1.ReportQuery, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(reportqueriesResource, c.ns, reportQuery), &v1alpha1.ReportQuery{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ReportQuery), err +} + +// Update takes the representation of a reportQuery and updates it. Returns the server's representation of the reportQuery, and an error, if there is any. +func (c *FakeReportQueries) Update(reportQuery *v1alpha1.ReportQuery) (result *v1alpha1.ReportQuery, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(reportqueriesResource, c.ns, reportQuery), &v1alpha1.ReportQuery{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ReportQuery), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeReportQueries) UpdateStatus(reportQuery *v1alpha1.ReportQuery) (*v1alpha1.ReportQuery, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(reportqueriesResource, "status", c.ns, reportQuery), &v1alpha1.ReportQuery{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ReportQuery), err +} + +// Delete takes name of the reportQuery and deletes it. Returns an error if one occurs. +func (c *FakeReportQueries) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(reportqueriesResource, c.ns, name), &v1alpha1.ReportQuery{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeReportQueries) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(reportqueriesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.ReportQueryList{}) + return err +} + +// Patch applies the patch and returns the patched reportQuery. +func (c *FakeReportQueries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ReportQuery, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(reportqueriesResource, c.ns, name, pt, data, subresources...), &v1alpha1.ReportQuery{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ReportQuery), err +} diff --git a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/generated_expansion.go index 1f96aafbf..f112064c2 100644 --- a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/generated_expansion.go @@ -10,6 +10,6 @@ type ReportExpansion interface{} type ReportDataSourceExpansion interface{} -type ReportGenerationQueryExpansion interface{} +type ReportQueryExpansion interface{} type StorageLocationExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/metering_client.go b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/metering_client.go index 8db331245..71bcf864f 100644 --- a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/metering_client.go +++ b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/metering_client.go @@ -15,7 +15,7 @@ type MeteringV1alpha1Interface interface { PrestoTablesGetter ReportsGetter ReportDataSourcesGetter - ReportGenerationQueriesGetter + ReportQueriesGetter StorageLocationsGetter } @@ -40,8 +40,8 @@ func (c *MeteringV1alpha1Client) ReportDataSources(namespace string) ReportDataS return newReportDataSources(c, namespace) } -func (c *MeteringV1alpha1Client) ReportGenerationQueries(namespace string) ReportGenerationQueryInterface { - return newReportGenerationQueries(c, namespace) +func (c *MeteringV1alpha1Client) ReportQueries(namespace string) ReportQueryInterface { + return newReportQueries(c, namespace) } func (c *MeteringV1alpha1Client) StorageLocations(namespace string) StorageLocationInterface { diff --git a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/reportgenerationquery.go b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/reportgenerationquery.go deleted file mode 100644 index 8ba94d564..000000000 --- a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/reportgenerationquery.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "time" - - v1alpha1 "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" - scheme "github.com/operator-framework/operator-metering/pkg/generated/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// ReportGenerationQueriesGetter has a method to return a ReportGenerationQueryInterface. -// A group's client should implement this interface. -type ReportGenerationQueriesGetter interface { - ReportGenerationQueries(namespace string) ReportGenerationQueryInterface -} - -// ReportGenerationQueryInterface has methods to work with ReportGenerationQuery resources. -type ReportGenerationQueryInterface interface { - Create(*v1alpha1.ReportGenerationQuery) (*v1alpha1.ReportGenerationQuery, error) - Update(*v1alpha1.ReportGenerationQuery) (*v1alpha1.ReportGenerationQuery, error) - UpdateStatus(*v1alpha1.ReportGenerationQuery) (*v1alpha1.ReportGenerationQuery, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.ReportGenerationQuery, error) - List(opts v1.ListOptions) (*v1alpha1.ReportGenerationQueryList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ReportGenerationQuery, err error) - ReportGenerationQueryExpansion -} - -// reportGenerationQueries implements ReportGenerationQueryInterface -type reportGenerationQueries struct { - client rest.Interface - ns string -} - -// newReportGenerationQueries returns a ReportGenerationQueries -func newReportGenerationQueries(c *MeteringV1alpha1Client, namespace string) *reportGenerationQueries { - return &reportGenerationQueries{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the reportGenerationQuery, and returns the corresponding reportGenerationQuery object, and an error if there is any. -func (c *reportGenerationQueries) Get(name string, options v1.GetOptions) (result *v1alpha1.ReportGenerationQuery, err error) { - result = &v1alpha1.ReportGenerationQuery{} - err = c.client.Get(). - Namespace(c.ns). - Resource("reportgenerationqueries"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ReportGenerationQueries that match those selectors. -func (c *reportGenerationQueries) List(opts v1.ListOptions) (result *v1alpha1.ReportGenerationQueryList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ReportGenerationQueryList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("reportgenerationqueries"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested reportGenerationQueries. -func (c *reportGenerationQueries) Watch(opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("reportgenerationqueries"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch() -} - -// Create takes the representation of a reportGenerationQuery and creates it. Returns the server's representation of the reportGenerationQuery, and an error, if there is any. -func (c *reportGenerationQueries) Create(reportGenerationQuery *v1alpha1.ReportGenerationQuery) (result *v1alpha1.ReportGenerationQuery, err error) { - result = &v1alpha1.ReportGenerationQuery{} - err = c.client.Post(). - Namespace(c.ns). - Resource("reportgenerationqueries"). - Body(reportGenerationQuery). - Do(). - Into(result) - return -} - -// Update takes the representation of a reportGenerationQuery and updates it. Returns the server's representation of the reportGenerationQuery, and an error, if there is any. -func (c *reportGenerationQueries) Update(reportGenerationQuery *v1alpha1.ReportGenerationQuery) (result *v1alpha1.ReportGenerationQuery, err error) { - result = &v1alpha1.ReportGenerationQuery{} - err = c.client.Put(). - Namespace(c.ns). - Resource("reportgenerationqueries"). - Name(reportGenerationQuery.Name). - Body(reportGenerationQuery). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *reportGenerationQueries) UpdateStatus(reportGenerationQuery *v1alpha1.ReportGenerationQuery) (result *v1alpha1.ReportGenerationQuery, err error) { - result = &v1alpha1.ReportGenerationQuery{} - err = c.client.Put(). - Namespace(c.ns). - Resource("reportgenerationqueries"). - Name(reportGenerationQuery.Name). - SubResource("status"). - Body(reportGenerationQuery). - Do(). - Into(result) - return -} - -// Delete takes name of the reportGenerationQuery and deletes it. Returns an error if one occurs. -func (c *reportGenerationQueries) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("reportgenerationqueries"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *reportGenerationQueries) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("reportgenerationqueries"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Timeout(timeout). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched reportGenerationQuery. -func (c *reportGenerationQueries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ReportGenerationQuery, err error) { - result = &v1alpha1.ReportGenerationQuery{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("reportgenerationqueries"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/generated/clientset/versioned/typed/metering/v1alpha1/reportquery.go b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/reportquery.go new file mode 100644 index 000000000..1d1e9284d --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/metering/v1alpha1/reportquery.go @@ -0,0 +1,175 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" + scheme "github.com/operator-framework/operator-metering/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ReportQueriesGetter has a method to return a ReportQueryInterface. +// A group's client should implement this interface. +type ReportQueriesGetter interface { + ReportQueries(namespace string) ReportQueryInterface +} + +// ReportQueryInterface has methods to work with ReportQuery resources. +type ReportQueryInterface interface { + Create(*v1alpha1.ReportQuery) (*v1alpha1.ReportQuery, error) + Update(*v1alpha1.ReportQuery) (*v1alpha1.ReportQuery, error) + UpdateStatus(*v1alpha1.ReportQuery) (*v1alpha1.ReportQuery, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.ReportQuery, error) + List(opts v1.ListOptions) (*v1alpha1.ReportQueryList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ReportQuery, err error) + ReportQueryExpansion +} + +// reportQueries implements ReportQueryInterface +type reportQueries struct { + client rest.Interface + ns string +} + +// newReportQueries returns a ReportQueries +func newReportQueries(c *MeteringV1alpha1Client, namespace string) *reportQueries { + return &reportQueries{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the reportQuery, and returns the corresponding reportQuery object, and an error if there is any. +func (c *reportQueries) Get(name string, options v1.GetOptions) (result *v1alpha1.ReportQuery, err error) { + result = &v1alpha1.ReportQuery{} + err = c.client.Get(). + Namespace(c.ns). + Resource("reportqueries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ReportQueries that match those selectors. +func (c *reportQueries) List(opts v1.ListOptions) (result *v1alpha1.ReportQueryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ReportQueryList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("reportqueries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested reportQueries. +func (c *reportQueries) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("reportqueries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a reportQuery and creates it. Returns the server's representation of the reportQuery, and an error, if there is any. +func (c *reportQueries) Create(reportQuery *v1alpha1.ReportQuery) (result *v1alpha1.ReportQuery, err error) { + result = &v1alpha1.ReportQuery{} + err = c.client.Post(). + Namespace(c.ns). + Resource("reportqueries"). + Body(reportQuery). + Do(). + Into(result) + return +} + +// Update takes the representation of a reportQuery and updates it. Returns the server's representation of the reportQuery, and an error, if there is any. +func (c *reportQueries) Update(reportQuery *v1alpha1.ReportQuery) (result *v1alpha1.ReportQuery, err error) { + result = &v1alpha1.ReportQuery{} + err = c.client.Put(). + Namespace(c.ns). + Resource("reportqueries"). + Name(reportQuery.Name). + Body(reportQuery). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *reportQueries) UpdateStatus(reportQuery *v1alpha1.ReportQuery) (result *v1alpha1.ReportQuery, err error) { + result = &v1alpha1.ReportQuery{} + err = c.client.Put(). + Namespace(c.ns). + Resource("reportqueries"). + Name(reportQuery.Name). + SubResource("status"). + Body(reportQuery). + Do(). + Into(result) + return +} + +// Delete takes name of the reportQuery and deletes it. Returns an error if one occurs. +func (c *reportQueries) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("reportqueries"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *reportQueries) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("reportqueries"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched reportQuery. +func (c *reportQueries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ReportQuery, err error) { + result = &v1alpha1.ReportQuery{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("reportqueries"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index cbd4e66be..44e9dd63d 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -45,8 +45,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Metering().V1alpha1().Reports().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("reportdatasources"): return &genericInformer{resource: resource.GroupResource(), informer: f.Metering().V1alpha1().ReportDataSources().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("reportgenerationqueries"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Metering().V1alpha1().ReportGenerationQueries().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("reportqueries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Metering().V1alpha1().ReportQueries().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("storagelocations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Metering().V1alpha1().StorageLocations().Informer()}, nil diff --git a/pkg/generated/informers/externalversions/metering/v1alpha1/interface.go b/pkg/generated/informers/externalversions/metering/v1alpha1/interface.go index bbfd69781..1b6499296 100644 --- a/pkg/generated/informers/externalversions/metering/v1alpha1/interface.go +++ b/pkg/generated/informers/externalversions/metering/v1alpha1/interface.go @@ -16,8 +16,8 @@ type Interface interface { Reports() ReportInformer // ReportDataSources returns a ReportDataSourceInformer. ReportDataSources() ReportDataSourceInformer - // ReportGenerationQueries returns a ReportGenerationQueryInformer. - ReportGenerationQueries() ReportGenerationQueryInformer + // ReportQueries returns a ReportQueryInformer. + ReportQueries() ReportQueryInformer // StorageLocations returns a StorageLocationInformer. StorageLocations() StorageLocationInformer } @@ -53,9 +53,9 @@ func (v *version) ReportDataSources() ReportDataSourceInformer { return &reportDataSourceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ReportGenerationQueries returns a ReportGenerationQueryInformer. -func (v *version) ReportGenerationQueries() ReportGenerationQueryInformer { - return &reportGenerationQueryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +// ReportQueries returns a ReportQueryInformer. +func (v *version) ReportQueries() ReportQueryInformer { + return &reportQueryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // StorageLocations returns a StorageLocationInformer. diff --git a/pkg/generated/informers/externalversions/metering/v1alpha1/reportgenerationquery.go b/pkg/generated/informers/externalversions/metering/v1alpha1/reportgenerationquery.go deleted file mode 100644 index 4aa45d92d..000000000 --- a/pkg/generated/informers/externalversions/metering/v1alpha1/reportgenerationquery.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - time "time" - - meteringv1alpha1 "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" - versioned "github.com/operator-framework/operator-metering/pkg/generated/clientset/versioned" - internalinterfaces "github.com/operator-framework/operator-metering/pkg/generated/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/operator-framework/operator-metering/pkg/generated/listers/metering/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// ReportGenerationQueryInformer provides access to a shared informer and lister for -// ReportGenerationQueries. -type ReportGenerationQueryInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.ReportGenerationQueryLister -} - -type reportGenerationQueryInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewReportGenerationQueryInformer constructs a new informer for ReportGenerationQuery type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewReportGenerationQueryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredReportGenerationQueryInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredReportGenerationQueryInformer constructs a new informer for ReportGenerationQuery type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredReportGenerationQueryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.MeteringV1alpha1().ReportGenerationQueries(namespace).List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.MeteringV1alpha1().ReportGenerationQueries(namespace).Watch(options) - }, - }, - &meteringv1alpha1.ReportGenerationQuery{}, - resyncPeriod, - indexers, - ) -} - -func (f *reportGenerationQueryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredReportGenerationQueryInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *reportGenerationQueryInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&meteringv1alpha1.ReportGenerationQuery{}, f.defaultInformer) -} - -func (f *reportGenerationQueryInformer) Lister() v1alpha1.ReportGenerationQueryLister { - return v1alpha1.NewReportGenerationQueryLister(f.Informer().GetIndexer()) -} diff --git a/pkg/generated/informers/externalversions/metering/v1alpha1/reportquery.go b/pkg/generated/informers/externalversions/metering/v1alpha1/reportquery.go new file mode 100644 index 000000000..0ad186c8c --- /dev/null +++ b/pkg/generated/informers/externalversions/metering/v1alpha1/reportquery.go @@ -0,0 +1,73 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + time "time" + + meteringv1alpha1 "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" + versioned "github.com/operator-framework/operator-metering/pkg/generated/clientset/versioned" + internalinterfaces "github.com/operator-framework/operator-metering/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/operator-framework/operator-metering/pkg/generated/listers/metering/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ReportQueryInformer provides access to a shared informer and lister for +// ReportQueries. +type ReportQueryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.ReportQueryLister +} + +type reportQueryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewReportQueryInformer constructs a new informer for ReportQuery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewReportQueryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredReportQueryInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredReportQueryInformer constructs a new informer for ReportQuery type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredReportQueryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MeteringV1alpha1().ReportQueries(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MeteringV1alpha1().ReportQueries(namespace).Watch(options) + }, + }, + &meteringv1alpha1.ReportQuery{}, + resyncPeriod, + indexers, + ) +} + +func (f *reportQueryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredReportQueryInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *reportQueryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&meteringv1alpha1.ReportQuery{}, f.defaultInformer) +} + +func (f *reportQueryInformer) Lister() v1alpha1.ReportQueryLister { + return v1alpha1.NewReportQueryLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/listers/metering/v1alpha1/expansion_generated.go b/pkg/generated/listers/metering/v1alpha1/expansion_generated.go index d70263fd8..7968987b2 100644 --- a/pkg/generated/listers/metering/v1alpha1/expansion_generated.go +++ b/pkg/generated/listers/metering/v1alpha1/expansion_generated.go @@ -34,13 +34,13 @@ type ReportDataSourceListerExpansion interface{} // ReportDataSourceNamespaceLister. type ReportDataSourceNamespaceListerExpansion interface{} -// ReportGenerationQueryListerExpansion allows custom methods to be added to -// ReportGenerationQueryLister. -type ReportGenerationQueryListerExpansion interface{} +// ReportQueryListerExpansion allows custom methods to be added to +// ReportQueryLister. +type ReportQueryListerExpansion interface{} -// ReportGenerationQueryNamespaceListerExpansion allows custom methods to be added to -// ReportGenerationQueryNamespaceLister. -type ReportGenerationQueryNamespaceListerExpansion interface{} +// ReportQueryNamespaceListerExpansion allows custom methods to be added to +// ReportQueryNamespaceLister. +type ReportQueryNamespaceListerExpansion interface{} // StorageLocationListerExpansion allows custom methods to be added to // StorageLocationLister. diff --git a/pkg/generated/listers/metering/v1alpha1/reportgenerationquery.go b/pkg/generated/listers/metering/v1alpha1/reportgenerationquery.go deleted file mode 100644 index d0319c900..000000000 --- a/pkg/generated/listers/metering/v1alpha1/reportgenerationquery.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ReportGenerationQueryLister helps list ReportGenerationQueries. -type ReportGenerationQueryLister interface { - // List lists all ReportGenerationQueries in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.ReportGenerationQuery, err error) - // ReportGenerationQueries returns an object that can list and get ReportGenerationQueries. - ReportGenerationQueries(namespace string) ReportGenerationQueryNamespaceLister - ReportGenerationQueryListerExpansion -} - -// reportGenerationQueryLister implements the ReportGenerationQueryLister interface. -type reportGenerationQueryLister struct { - indexer cache.Indexer -} - -// NewReportGenerationQueryLister returns a new ReportGenerationQueryLister. -func NewReportGenerationQueryLister(indexer cache.Indexer) ReportGenerationQueryLister { - return &reportGenerationQueryLister{indexer: indexer} -} - -// List lists all ReportGenerationQueries in the indexer. -func (s *reportGenerationQueryLister) List(selector labels.Selector) (ret []*v1alpha1.ReportGenerationQuery, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ReportGenerationQuery)) - }) - return ret, err -} - -// ReportGenerationQueries returns an object that can list and get ReportGenerationQueries. -func (s *reportGenerationQueryLister) ReportGenerationQueries(namespace string) ReportGenerationQueryNamespaceLister { - return reportGenerationQueryNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// ReportGenerationQueryNamespaceLister helps list and get ReportGenerationQueries. -type ReportGenerationQueryNamespaceLister interface { - // List lists all ReportGenerationQueries in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.ReportGenerationQuery, err error) - // Get retrieves the ReportGenerationQuery from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.ReportGenerationQuery, error) - ReportGenerationQueryNamespaceListerExpansion -} - -// reportGenerationQueryNamespaceLister implements the ReportGenerationQueryNamespaceLister -// interface. -type reportGenerationQueryNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ReportGenerationQueries in the indexer for a given namespace. -func (s reportGenerationQueryNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ReportGenerationQuery, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ReportGenerationQuery)) - }) - return ret, err -} - -// Get retrieves the ReportGenerationQuery from the indexer for a given namespace and name. -func (s reportGenerationQueryNamespaceLister) Get(name string) (*v1alpha1.ReportGenerationQuery, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("reportgenerationquery"), name) - } - return obj.(*v1alpha1.ReportGenerationQuery), nil -} diff --git a/pkg/generated/listers/metering/v1alpha1/reportquery.go b/pkg/generated/listers/metering/v1alpha1/reportquery.go new file mode 100644 index 000000000..258d80a64 --- /dev/null +++ b/pkg/generated/listers/metering/v1alpha1/reportquery.go @@ -0,0 +1,78 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ReportQueryLister helps list ReportQueries. +type ReportQueryLister interface { + // List lists all ReportQueries in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.ReportQuery, err error) + // ReportQueries returns an object that can list and get ReportQueries. + ReportQueries(namespace string) ReportQueryNamespaceLister + ReportQueryListerExpansion +} + +// reportQueryLister implements the ReportQueryLister interface. +type reportQueryLister struct { + indexer cache.Indexer +} + +// NewReportQueryLister returns a new ReportQueryLister. +func NewReportQueryLister(indexer cache.Indexer) ReportQueryLister { + return &reportQueryLister{indexer: indexer} +} + +// List lists all ReportQueries in the indexer. +func (s *reportQueryLister) List(selector labels.Selector) (ret []*v1alpha1.ReportQuery, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.ReportQuery)) + }) + return ret, err +} + +// ReportQueries returns an object that can list and get ReportQueries. +func (s *reportQueryLister) ReportQueries(namespace string) ReportQueryNamespaceLister { + return reportQueryNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ReportQueryNamespaceLister helps list and get ReportQueries. +type ReportQueryNamespaceLister interface { + // List lists all ReportQueries in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.ReportQuery, err error) + // Get retrieves the ReportQuery from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.ReportQuery, error) + ReportQueryNamespaceListerExpansion +} + +// reportQueryNamespaceLister implements the ReportQueryNamespaceLister +// interface. +type reportQueryNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ReportQueries in the indexer for a given namespace. +func (s reportQueryNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ReportQuery, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.ReportQuery)) + }) + return ret, err +} + +// Get retrieves the ReportQuery from the indexer for a given namespace and name. +func (s reportQueryNamespaceLister) Get(name string) (*v1alpha1.ReportQuery, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("reportquery"), name) + } + return obj.(*v1alpha1.ReportQuery), nil +} diff --git a/pkg/operator/datasources.go b/pkg/operator/datasources.go index c49edc4cd..5956738d5 100644 --- a/pkg/operator/datasources.go +++ b/pkg/operator/datasources.go @@ -86,10 +86,10 @@ func (op *Reporting) handleReportDataSource(logger log.FieldLogger, dataSource * err = op.handleAWSBillingDataSource(logger, dataSource) case dataSource.Spec.PrestoTable != nil: err = op.handlePrestoTableDataSource(logger, dataSource) - case dataSource.Spec.GenerationQueryView != nil: - err = op.handleGenerationQueryViewDataSource(logger, dataSource) + case dataSource.Spec.ReportQueryView != nil: + err = op.handleReportQueryViewDataSource(logger, dataSource) default: - err = fmt.Errorf("ReportDataSource %s: improperly configured missing prometheusMetricsImporter, awsBilling, generationQueryView or prestoTable configuration", dataSource.Name) + err = fmt.Errorf("ReportDataSource %s: improperly configured missing prometheusMetricsImporter, awsBilling, reportQueryView or prestoTable configuration", dataSource.Name) } return err @@ -408,17 +408,17 @@ func (op *Reporting) handlePrestoTableDataSource(logger log.FieldLogger, dataSou return nil } -func (op *Reporting) handleGenerationQueryViewDataSource(logger log.FieldLogger, dataSource *cbTypes.ReportDataSource) error { - if dataSource.Spec.GenerationQueryView == nil { - return fmt.Errorf("%s is not a GenerationQueryView ReportDataSource", dataSource.Name) +func (op *Reporting) handleReportQueryViewDataSource(logger log.FieldLogger, dataSource *cbTypes.ReportDataSource) error { + if dataSource.Spec.ReportQueryView == nil { + return fmt.Errorf("%s is not a ReportQueryView ReportDataSource", dataSource.Name) } - if dataSource.Spec.GenerationQueryView.QueryName == "" { - return fmt.Errorf("invalid GenerationQueryView ReportDataSource %s, spec.generationQueryView.queryName must be set", dataSource.Name) + if dataSource.Spec.ReportQueryView.QueryName == "" { + return fmt.Errorf("invalid ReportQueryView ReportDataSource %s, spec.reportQueryView.queryName must be set", dataSource.Name) } - generationQuery, err := op.reportGenerationQueryLister.ReportGenerationQueries(dataSource.Namespace).Get(dataSource.Spec.GenerationQueryView.QueryName) + query, err := op.reportQueryLister.ReportQueries(dataSource.Namespace).Get(dataSource.Spec.ReportQueryView.QueryName) if err != nil { - return fmt.Errorf("unable to get ReportGenerationQuery %s for GenerationQueryView ReportDataSource %s: %s", dataSource.Spec.GenerationQueryView.QueryName, dataSource.Name, err) + return fmt.Errorf("unable to get ReportQuery %s for ReportQueryView ReportDataSource %s: %s", dataSource.Spec.ReportQueryView.QueryName, dataSource.Name, err) } var viewName string @@ -436,22 +436,22 @@ func (op *Reporting) handleGenerationQueryViewDataSource(logger log.FieldLogger, viewName = prestoTable.Status.TableName } - dependencyResult, err := op.dependencyResolver.ResolveDependencies(generationQuery.Namespace, generationQuery.Spec.Inputs, nil) + dependencyResult, err := op.dependencyResolver.ResolveDependencies(query.Namespace, query.Spec.Inputs, nil) if err != nil { return err } - err = reporting.ValidateGenerationQueryDependencies(dependencyResult.Dependencies, op.uninitialiedDependendenciesHandler()) + err = reporting.ValidateQueryDependencies(dependencyResult.Dependencies, op.uninitialiedDependendenciesHandler()) if err != nil { if reporting.IsUninitializedDependencyError(err) { - logger.Warnf("unable to validate ReportGenerationQuery %s, has uninitialized dependencies: %v", generationQuery.Name, err) + logger.Warnf("unable to validate ReportQuery %s, has uninitialized dependencies: %v", query.Name, err) // We do not return an error because we do not need to requeue this // query. Instead we can wait until this queries uninitialized // dependencies become initialized. After they're initialized they // will queue anything that depends on them, including this query. return nil } else if reporting.IsInvalidDependencyError(err) { - logger.WithError(err).Errorf("unable to validate ReportGenerationQuery %s, has invalid dependencies, dropping off queue", generationQuery.Name) + logger.WithError(err).Errorf("unable to validate ReportQuery %s, has invalid dependencies, dropping off queue", query.Name) // Invalid dependency means it will not resolve itself, so do not // return an error since we do not want to be requeued unless the // resource is modified, or it's dependencies are modified. @@ -461,7 +461,7 @@ func (op *Reporting) handleGenerationQueryViewDataSource(logger log.FieldLogger, // unknown reason so we want to retry up to a limit. This most // commonly occurs when fetching a dependency from the API fails, // or if there is a cyclic dependency. - return fmt.Errorf("unable to get or validate ReportGenerationQuery dependencies %s: %v", generationQuery.Name, err) + return fmt.Errorf("unable to get or validate ReportQuery dependencies %s: %v", query.Name, err) } } @@ -479,12 +479,12 @@ func (op *Reporting) handleGenerationQueryViewDataSource(logger log.FieldLogger, } queryCtx := &reporting.ReportQueryTemplateContext{ - Namespace: dataSource.Namespace, - ReportQuery: generationQuery, - Reports: dependencyResult.Dependencies.Reports, - ReportGenerationQueries: dependencyResult.Dependencies.ReportGenerationQueries, - ReportDataSources: dependencyResult.Dependencies.ReportDataSources, - PrestoTables: prestoTables, + Namespace: dataSource.Namespace, + ReportQuery: query, + Reports: dependencyResult.Dependencies.Reports, + ReportQueries: dependencyResult.Dependencies.ReportQueries, + ReportDataSources: dependencyResult.Dependencies.ReportDataSources, + PrestoTables: prestoTables, } renderedQuery, err := reporting.RenderQuery(queryCtx, reporting.TemplateContext{ Report: reporting.ReportTemplateInfo{ @@ -495,9 +495,9 @@ func (op *Reporting) handleGenerationQueryViewDataSource(logger log.FieldLogger, return err } - columns := reportingutil.GeneratePrestoColumns(generationQuery) + columns := reportingutil.GeneratePrestoColumns(query) logger.Infof("creating view %s", viewName) - prestoTable, err := op.createPrestoTableCR(dataSource, cbTypes.ReportGenerationQueryGVK, "hive", hiveStorage.Status.Hive.DatabaseName, viewName, columns, false, true, renderedQuery) + prestoTable, err := op.createPrestoTableCR(dataSource, cbTypes.ReportQueryGVK, "hive", hiveStorage.Status.Hive.DatabaseName, viewName, columns, false, true, renderedQuery) if err != nil { return fmt.Errorf("error creating view %s for ReportDataSource %s: %v", viewName, dataSource.Name, err) } @@ -559,13 +559,13 @@ func reportDataSourceNeedsFinalizer(ds *cbTypes.ReportDataSource) bool { return ds.ObjectMeta.DeletionTimestamp == nil && !slice.ContainsString(ds.ObjectMeta.Finalizers, reportDataSourceFinalizer, nil) } -func (op *Reporting) getGenerationQueryDependencies(namespace, name string, inputVals []cbTypes.ReportGenerationQueryInputValue) (*reporting.ReportGenerationQueryDependencies, error) { - queryGetter := reporting.NewReportGenerationQueryListerGetter(op.reportGenerationQueryLister) - genQuery, err := queryGetter.GetReportGenerationQuery(namespace, name) +func (op *Reporting) getQueryDependencies(namespace, name string, inputVals []cbTypes.ReportQueryInputValue) (*reporting.ReportQueryDependencies, error) { + queryGetter := reporting.NewReportQueryListerGetter(op.reportQueryLister) + query, err := queryGetter.GetReportQuery(namespace, name) if err != nil { return nil, err } - result, err := op.dependencyResolver.ResolveDependencies(genQuery.Namespace, genQuery.Spec.Inputs, inputVals) + result, err := op.dependencyResolver.ResolveDependencies(query.Namespace, query.Spec.Inputs, inputVals) if err != nil { return nil, err } @@ -583,14 +583,14 @@ func (op *Reporting) queueDependentReportDataSourcesForDataSource(dataSource *cb // reportDataSources that have a dependency on the provided dataSource for _, ds := range reportDataSources { // Only ReportDataSources that create a view from a - // ReportGenerationQuery depend on other ReportDataSources. - if ds.Spec.GenerationQueryView == nil { + // ReportQuery depend on other ReportDataSources. + if ds.Spec.ReportQueryView == nil { continue } - deps, err := op.getGenerationQueryDependencies(ds.Namespace, ds.Name, ds.Spec.GenerationQueryView.Inputs) + deps, err := op.getQueryDependencies(ds.Namespace, ds.Name, ds.Spec.ReportQueryView.Inputs) if err != nil { - return fmt.Errorf("unable to get dependencies for GenerationQueryView ReportDataSource %s: %s", ds.Name, err) + return fmt.Errorf("unable to get dependencies for ReportQueryView ReportDataSource %s: %s", ds.Name, err) } // If this reportDataSource has a dependency on the passed in diff --git a/pkg/operator/http.go b/pkg/operator/http.go index d99adcb40..97d8f8744 100644 --- a/pkg/operator/http.go +++ b/pkg/operator/http.go @@ -49,9 +49,9 @@ type server struct { prometheusMetricsRepo prestostore.PrometheusMetricsRepo reportResultsGetter prestostore.ReportResultsGetter - reportLister listers.ReportLister - reportGenerationQueryLister listers.ReportGenerationQueryLister - prestoTableLister listers.PrestoTableLister + reportLister listers.ReportLister + reportQueryLister listers.ReportQueryLister + prestoTableLister listers.PrestoTableLister } type requestLogger struct { @@ -69,7 +69,7 @@ func newRouter( reportResultsGetter prestostore.ReportResultsGetter, collectorFunc prometheusImporterFunc, reportLister listers.ReportLister, - reportGenerationQueryLister listers.ReportGenerationQueryLister, + reportQueryLister listers.ReportQueryLister, prestoTableLister listers.PrestoTableLister, ) chi.Router { router := chi.NewRouter() @@ -79,14 +79,14 @@ func newRouter( router.Use(prometheusMiddleware) srv := &server{ - logger: logger, - rand: rand, - collectorFunc: collectorFunc, - prometheusMetricsRepo: prometheusMetricsRepo, - reportResultsGetter: reportResultsGetter, - reportLister: reportLister, - reportGenerationQueryLister: reportGenerationQueryLister, - prestoTableLister: prestoTableLister, + logger: logger, + rand: rand, + collectorFunc: collectorFunc, + prometheusMetricsRepo: prometheusMetricsRepo, + reportResultsGetter: reportResultsGetter, + reportLister: reportLister, + reportQueryLister: reportQueryLister, + prestoTableLister: prestoTableLister, } router.HandleFunc(APIV2ReportsEndpointPrefix+"/{namespace}/{name}/full", srv.getReportV2FullHandler) @@ -194,7 +194,7 @@ func (srv *server) getReport(logger log.FieldLogger, name, namespace, format str } } - reportQuery, err := srv.reportGenerationQueryLister.ReportGenerationQueries(report.Namespace).Get(report.Spec.GenerationQueryName) + reportQuery, err := srv.reportQueryLister.ReportQueries(report.Namespace).Get(report.Spec.QueryName) if err != nil { logger.WithError(err).Errorf("error getting report: %v", err) writeErrorResponse(logger, w, r, http.StatusInternalServerError, "error getting report: %v", err) @@ -223,8 +223,8 @@ func (srv *server) getReport(logger log.FieldLogger, name, namespace, format str } if !reflect.DeepEqual(queryPrestoColumns, prestoColumns) { - logger.Warnf("report columns and table columns don't match, ReportGenerationQuery was likely updated after the report ran") - logger.Debugf("mismatched columns, PrestoTable columns: %v, ReportGenerationQuery columns: %v", prestoColumns, queryPrestoColumns) + logger.Warnf("report columns and table columns don't match, ReportQuery was likely updated after the report ran") + logger.Debugf("mismatched columns, PrestoTable columns: %v, ReportQuery columns: %v", prestoColumns, queryPrestoColumns) } tableName := reportingutil.FullyQualifiedTableName(prestoTable) @@ -248,7 +248,7 @@ func (srv *server) getReport(logger log.FieldLogger, name, namespace, format str } } -func writeResultsResponseAsCSV(logger log.FieldLogger, name string, columns []api.ReportGenerationQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { +func writeResultsResponseAsCSV(logger log.FieldLogger, name string, columns []api.ReportQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/csv") w.Header().Set("Content-Disposition", fmt.Sprintf("attachment;filename=%s.csv", name)) err := writeResultsAsCSV(columns, results, w, ',') @@ -259,7 +259,7 @@ func writeResultsResponseAsCSV(logger log.FieldLogger, name string, columns []ap w.WriteHeader(http.StatusOK) } -func writeResultsAsCSV(columns []api.ReportGenerationQueryColumn, results []presto.Row, w io.Writer, delimiter rune) error { +func writeResultsAsCSV(columns []api.ReportQueryColumn, results []presto.Row, w io.Writer, delimiter rune) error { csvWriter := csv.NewWriter(w) csvWriter.Comma = delimiter @@ -312,7 +312,7 @@ func writeResultsAsCSV(columns []api.ReportGenerationQueryColumn, results []pres return csvWriter.Error() } -func writeResultsResponseAsTabular(logger log.FieldLogger, name string, columns []api.ReportGenerationQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { +func writeResultsResponseAsTabular(logger log.FieldLogger, name string, columns []api.ReportQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/tab-separated-values") w.Header().Set("Content-Disposition", fmt.Sprintf("attachment;filename=%s.tsv", name)) padding := 2 @@ -339,7 +339,7 @@ func writeResultsResponseAsTabular(logger log.FieldLogger, name string, columns w.WriteHeader(http.StatusOK) } -func writeResultsResponseAsJSON(logger log.FieldLogger, name string, columns []api.ReportGenerationQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { +func writeResultsResponseAsJSON(logger log.FieldLogger, name string, columns []api.ReportQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Disposition", fmt.Sprintf("attachment;filename=%s.json", name)) newResults := make([]*orderedmap.OrderedMap, len(results)) for i, item := range results { @@ -353,7 +353,7 @@ func writeResultsResponseAsJSON(logger log.FieldLogger, name string, columns []a writeResponseAsJSON(logger, w, http.StatusOK, newResults) } -func writeResultsResponse(logger log.FieldLogger, format, name string, columns []api.ReportGenerationQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { +func writeResultsResponse(logger log.FieldLogger, format, name string, columns []api.ReportQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { switch format { case "json": writeResultsResponseAsJSON(logger, name, columns, results, w, r) @@ -380,9 +380,9 @@ type ReportResultValues struct { } // convertsToGetReportResults converts Rows returned from `presto.ExecuteSelect` into a GetReportResults -func convertsToGetReportResults(input []presto.Row, columns []api.ReportGenerationQueryColumn) GetReportResults { +func convertsToGetReportResults(input []presto.Row, columns []api.ReportQueryColumn) GetReportResults { results := GetReportResults{} - columnsMap := make(map[string]api.ReportGenerationQueryColumn) + columnsMap := make(map[string]api.ReportQueryColumn) for _, column := range columns { columnsMap[column.Name] = column } @@ -402,9 +402,9 @@ func convertsToGetReportResults(input []presto.Row, columns []api.ReportGenerati return results } -func writeResultsResponseV1(logger log.FieldLogger, format string, name string, columns []api.ReportGenerationQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { - columnsMap := make(map[string]api.ReportGenerationQueryColumn) - var filteredColumns []api.ReportGenerationQueryColumn +func writeResultsResponseV1(logger log.FieldLogger, format string, name string, columns []api.ReportQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { + columnsMap := make(map[string]api.ReportQueryColumn) + var filteredColumns []api.ReportQueryColumn // remove tableHidden columns and their values if the format is tabular or CSV @@ -429,11 +429,11 @@ func writeResultsResponseV1(logger log.FieldLogger, format string, name string, writeResultsResponse(logger, format, name, filteredColumns, results, w, r) } -func writeResultsResponseV2(logger log.FieldLogger, full bool, format string, name string, columns []api.ReportGenerationQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { +func writeResultsResponseV2(logger log.FieldLogger, full bool, format string, name string, columns []api.ReportQueryColumn, results []presto.Row, w http.ResponseWriter, r *http.Request) { format = strings.ToLower(format) isTableFormat := format == "csv" || format == "tab" || format == "tabular" - columnsMap := make(map[string]api.ReportGenerationQueryColumn) - var filteredColumns []api.ReportGenerationQueryColumn + columnsMap := make(map[string]api.ReportQueryColumn) + var filteredColumns []api.ReportQueryColumn // Remove columns and their values from `results` if full is false and the // column's TableHidden is true or if TableHidden is true and we're diff --git a/pkg/operator/http_test.go b/pkg/operator/http_test.go index 35d7a24dd..6b7a77036 100644 --- a/pkg/operator/http_test.go +++ b/pkg/operator/http_test.go @@ -102,7 +102,7 @@ func TestAPIV1ReportsGet(t *testing.T) { reportName string report *v1alpha1.Report - query *v1alpha1.ReportGenerationQuery + query *v1alpha1.ReportQuery prestoTable *v1alpha1.PrestoTable expectedStatusCode int @@ -115,7 +115,7 @@ func TestAPIV1ReportsGet(t *testing.T) { "report-finished-no-results": { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -143,7 +143,7 @@ func TestAPIV1ReportsGet(t *testing.T) { "report-finished-with-results": { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -184,7 +184,7 @@ func TestAPIV1ReportsGet(t *testing.T) { "report-finished-db-errored": { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -229,7 +229,7 @@ func TestAPIV1ReportsGet(t *testing.T) { "mismatched-results-schema-to-table-schema": { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -280,11 +280,11 @@ func TestAPIV1ReportsGet(t *testing.T) { // cache.Store, it's basically just a key-value store that we can // use to mock the lister returns. reportIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) - reportGenerationQueryIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) + reportQueryIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) prestoTableIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) reportLister := listers.NewReportLister(reportIndexer) - reportGenerationQueryLister := listers.NewReportGenerationQueryLister(reportGenerationQueryIndexer) + reportQueryLister := listers.NewReportQueryLister(reportQueryIndexer) prestoTableLister := listers.NewPrestoTableLister(prestoTableIndexer) // add our test report if one is specified @@ -293,7 +293,7 @@ func TestAPIV1ReportsGet(t *testing.T) { } // add our test query for the report if tt.query != nil { - reportGenerationQueryIndexer.Add(tt.query) + reportQueryIndexer.Add(tt.query) } if tt.prestoTable != nil { prestoTableIndexer.Add(tt.prestoTable) @@ -301,7 +301,7 @@ func TestAPIV1ReportsGet(t *testing.T) { // setup a test server suitable for making API calls against router := newRouter(testLogger, testRand, tt.prometheusMetricsRepo, tt.reportResultsGetter, noopPrometheusImporterFunc, - reportLister, reportGenerationQueryLister, prestoTableLister, + reportLister, reportQueryLister, prestoTableLister, ) server := httptest.NewServer(router) defer server.Close() @@ -372,7 +372,7 @@ func TestAPIV2ReportsFull(t *testing.T) { apiPath string report *v1alpha1.Report - query *v1alpha1.ReportGenerationQuery + query *v1alpha1.ReportQuery prestoTable *v1alpha1.PrestoTable expectedStatusCode int @@ -386,7 +386,7 @@ func TestAPIV2ReportsFull(t *testing.T) { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), apiPath: apiReportV2URLFull(namespace, testReportName) + testFormat, - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -436,7 +436,7 @@ func TestAPIV2ReportsFull(t *testing.T) { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), apiPath: apiReportV2URLFull(namespace, testReportName) + testFormat, - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -467,7 +467,7 @@ func TestAPIV2ReportsFull(t *testing.T) { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), apiPath: apiReportV2URLFull(namespace, testReportName) + testFormat, - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -534,7 +534,7 @@ func TestAPIV2ReportsFull(t *testing.T) { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), apiPath: apiReportV2URLFull(namespace, testReportName) + testFormat, - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -580,11 +580,11 @@ func TestAPIV2ReportsFull(t *testing.T) { // cache.Store, it's basically just a key-value store that we can // use to mock the lister returns. reportIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) - reportGenerationQueryIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) + reportQueryIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) prestoTableIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) reportLister := listers.NewReportLister(reportIndexer) - reportGenerationQueryLister := listers.NewReportGenerationQueryLister(reportGenerationQueryIndexer) + reportQueryLister := listers.NewReportQueryLister(reportQueryIndexer) prestoTableLister := listers.NewPrestoTableLister(prestoTableIndexer) // add our test report if one is specified @@ -593,7 +593,7 @@ func TestAPIV2ReportsFull(t *testing.T) { } // add our test query for the report if tt.query != nil { - reportGenerationQueryIndexer.Add(tt.query) + reportQueryIndexer.Add(tt.query) } if tt.prestoTable != nil { prestoTableIndexer.Add(tt.prestoTable) @@ -601,7 +601,7 @@ func TestAPIV2ReportsFull(t *testing.T) { // setup a test server suitable for making API calls against router := newRouter(testLogger, testRand, tt.prometheusMetricsRepo, tt.reportResultsGetter, noopPrometheusImporterFunc, - reportLister, reportGenerationQueryLister, prestoTableLister, + reportLister, reportQueryLister, prestoTableLister, ) server := httptest.NewServer(router) defer server.Close() @@ -654,7 +654,7 @@ func TestAPIV2ReportsTable(t *testing.T) { apiPath string report *v1alpha1.Report - query *v1alpha1.ReportGenerationQuery + query *v1alpha1.ReportQuery prestoTable *v1alpha1.PrestoTable expectedStatusCode int @@ -668,7 +668,7 @@ func TestAPIV2ReportsTable(t *testing.T) { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), apiPath: apiReportV2URLTable(namespace, testReportName) + testFormat, - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -720,7 +720,7 @@ func TestAPIV2ReportsTable(t *testing.T) { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), apiPath: apiReportV2URLTable(namespace, testReportName) + testFormat, - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -751,7 +751,7 @@ func TestAPIV2ReportsTable(t *testing.T) { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), apiPath: apiReportV2URLTable(namespace, testReportName) + testFormat, - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -818,7 +818,7 @@ func TestAPIV2ReportsTable(t *testing.T) { reportName: testReportName, report: testhelpers.NewReport(testReportName, namespace, testQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), apiPath: apiReportV2URLTable(namespace, testReportName) + testFormat, - query: testhelpers.NewReportGenerationQuery(testQueryName, namespace, []v1alpha1.ReportGenerationQueryColumn{ + query: testhelpers.NewReportQuery(testQueryName, namespace, []v1alpha1.ReportQueryColumn{ { Name: "timestamp", Type: "timestamp", @@ -864,11 +864,11 @@ func TestAPIV2ReportsTable(t *testing.T) { // cache.Store, it's basically just a key-value store that we can // use to mock the lister returns. reportIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) - reportGenerationQueryIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) + reportQueryIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) prestoTableIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) reportLister := listers.NewReportLister(reportIndexer) - reportGenerationQueryLister := listers.NewReportGenerationQueryLister(reportGenerationQueryIndexer) + reportQueryLister := listers.NewReportQueryLister(reportQueryIndexer) prestoTableLister := listers.NewPrestoTableLister(prestoTableIndexer) // add our test report if one is specified @@ -877,7 +877,7 @@ func TestAPIV2ReportsTable(t *testing.T) { } // add our test query for the report if tt.query != nil { - reportGenerationQueryIndexer.Add(tt.query) + reportQueryIndexer.Add(tt.query) } if tt.prestoTable != nil { prestoTableIndexer.Add(tt.prestoTable) @@ -885,7 +885,7 @@ func TestAPIV2ReportsTable(t *testing.T) { // setup a test server suitable for making API calls against router := newRouter(testLogger, testRand, tt.prometheusMetricsRepo, tt.reportResultsGetter, noopPrometheusImporterFunc, - reportLister, reportGenerationQueryLister, prestoTableLister, + reportLister, reportQueryLister, prestoTableLister, ) server := httptest.NewServer(router) defer server.Close() diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index b454343a9..5fa3480c7 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -128,20 +128,20 @@ type Reporting struct { informerFactory factory.SharedInformerFactory - prestoTableLister listers.PrestoTableLister - hiveTableLister listers.HiveTableLister - reportDataSourceLister listers.ReportDataSourceLister - reportGenerationQueryLister listers.ReportGenerationQueryLister - reportLister listers.ReportLister - storageLocationLister listers.StorageLocationLister - - queueList []workqueue.RateLimitingInterface - reportQueue workqueue.RateLimitingInterface - reportDataSourceQueue workqueue.RateLimitingInterface - reportGenerationQueryQueue workqueue.RateLimitingInterface - prestoTableQueue workqueue.RateLimitingInterface - hiveTableQueue workqueue.RateLimitingInterface - storageLocationQueue workqueue.RateLimitingInterface + prestoTableLister listers.PrestoTableLister + hiveTableLister listers.HiveTableLister + reportDataSourceLister listers.ReportDataSourceLister + reportQueryLister listers.ReportQueryLister + reportLister listers.ReportLister + storageLocationLister listers.StorageLocationLister + + queueList []workqueue.RateLimitingInterface + reportQueue workqueue.RateLimitingInterface + reportDataSourceQueue workqueue.RateLimitingInterface + reportQueryQueue workqueue.RateLimitingInterface + prestoTableQueue workqueue.RateLimitingInterface + hiveTableQueue workqueue.RateLimitingInterface + storageLocationQueue workqueue.RateLimitingInterface reportResultsRepo prestostore.ReportResultsRepo prometheusMetricsRepo prestostore.PrometheusMetricsRepo @@ -251,13 +251,13 @@ func newReportingOperator( prestoTableInformer := informerFactory.Metering().V1alpha1().PrestoTables() hiveTableInformer := informerFactory.Metering().V1alpha1().HiveTables() reportDataSourceInformer := informerFactory.Metering().V1alpha1().ReportDataSources() - reportGenerationQueryInformer := informerFactory.Metering().V1alpha1().ReportGenerationQueries() + reportQueryInformer := informerFactory.Metering().V1alpha1().ReportQueries() reportInformer := informerFactory.Metering().V1alpha1().Reports() storageLocationInformer := informerFactory.Metering().V1alpha1().StorageLocations() reportQueue := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "reports") reportDataSourceQueue := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "reportdatasources") - reportGenerationQueryQueue := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "reportgenerationqueries") + reportQueryQueue := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "reportqueries") prestoTableQueue := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "prestotables") hiveTableQueue := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "hivetables") storageLocationQueue := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "storagelocation") @@ -265,14 +265,14 @@ func newReportingOperator( queueList := []workqueue.RateLimitingInterface{ reportQueue, reportDataSourceQueue, - reportGenerationQueryQueue, + reportQueryQueue, prestoTableQueue, hiveTableQueue, storageLocationQueue, } depResolver := reporting.NewDependencyResolver( - reporting.NewReportGenerationQueryListerGetter(reportGenerationQueryInformer.Lister()), + reporting.NewReportQueryListerGetter(reportQueryInformer.Lister()), reporting.NewReportDataSourceListerGetter(reportDataSourceInformer.Lister()), reporting.NewReportListerGetter(reportInformer.Lister()), ) @@ -286,22 +286,22 @@ func newReportingOperator( informerFactory: informerFactory, - prestoTableLister: prestoTableInformer.Lister(), - hiveTableLister: hiveTableInformer.Lister(), - reportDataSourceLister: reportDataSourceInformer.Lister(), - reportGenerationQueryLister: reportGenerationQueryInformer.Lister(), - reportLister: reportInformer.Lister(), - storageLocationLister: storageLocationInformer.Lister(), + prestoTableLister: prestoTableInformer.Lister(), + hiveTableLister: hiveTableInformer.Lister(), + reportDataSourceLister: reportDataSourceInformer.Lister(), + reportQueryLister: reportQueryInformer.Lister(), + reportLister: reportInformer.Lister(), + storageLocationLister: storageLocationInformer.Lister(), dependencyResolver: depResolver, - queueList: queueList, - reportQueue: reportQueue, - reportDataSourceQueue: reportDataSourceQueue, - reportGenerationQueryQueue: reportGenerationQueryQueue, - prestoTableQueue: prestoTableQueue, - hiveTableQueue: hiveTableQueue, - storageLocationQueue: storageLocationQueue, + queueList: queueList, + reportQueue: reportQueue, + reportDataSourceQueue: reportDataSourceQueue, + reportQueryQueue: reportQueryQueue, + prestoTableQueue: prestoTableQueue, + hiveTableQueue: hiveTableQueue, + storageLocationQueue: storageLocationQueue, rand: rand, clock: clock, @@ -326,9 +326,9 @@ func newReportingOperator( DeleteFunc: op.deleteReportDataSource, }, op.cfg.TargetNamespaces)) - reportGenerationQueryInformer.Informer().AddEventHandler(newInTargetNamespaceEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: op.addReportGenerationQuery, - UpdateFunc: op.updateReportGenerationQuery, + reportQueryInformer.Informer().AddEventHandler(newInTargetNamespaceEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: op.addReportQuery, + UpdateFunc: op.updateReportQuery, }, op.cfg.TargetNamespaces)) prestoTableInformer.Informer().AddEventHandler(newInTargetNamespaceEventHandler(cache.ResourceEventHandlerFuncs{ @@ -445,7 +445,7 @@ func (op *Reporting) Run(ctx context.Context) error { op.logger.Infof("starting HTTP server") apiRouter := newRouter( op.logger, op.rand, op.prometheusMetricsRepo, op.reportResultsRepo, op.importPrometheusForTimeRange, - op.reportLister, op.reportGenerationQueryLister, op.prestoTableLister, + op.reportLister, op.reportQueryLister, op.prestoTableLister, ) apiRouter.HandleFunc("/ready", op.readinessHandler) apiRouter.HandleFunc("/healthy", op.readinessHandler) @@ -663,9 +663,9 @@ func (op *Reporting) startWorkers(wg *sync.WaitGroup, ctx context.Context) { }) startWorker(4, func(i int) { - op.logger.Infof("starting ReportGenerationQuery worker #%d", i) - wait.Until(op.runReportGenerationQueryWorker, time.Second, stopCh) - op.logger.Infof("ReportGenerationQuery worker #%d stopped", i) + op.logger.Infof("starting ReportQuery worker #%d", i) + wait.Until(op.runReportQueryWorker, time.Second, stopCh) + op.logger.Infof("ReportQuery worker #%d stopped", i) }) startWorker(6, func(i int) { @@ -697,5 +697,5 @@ func (op *Reporting) newPrometheusConn(promConfig promapi.Config) (prom.API, err } type DependencyResolver interface { - ResolveDependencies(namespace string, inputDefs []cbTypes.ReportGenerationQueryInputDefinition, inputVals []cbTypes.ReportGenerationQueryInputValue) (*reporting.DependencyResolutionResult, error) + ResolveDependencies(namespace string, inputDefs []cbTypes.ReportQueryInputDefinition, inputVals []cbTypes.ReportQueryInputValue) (*reporting.DependencyResolutionResult, error) } diff --git a/pkg/operator/queues.go b/pkg/operator/queues.go index e884a6b4b..b90961a2f 100644 --- a/pkg/operator/queues.go +++ b/pkg/operator/queues.go @@ -174,41 +174,41 @@ func (op *Reporting) enqueueReportDataSourceAfter(ds *cbTypes.ReportDataSource, op.reportDataSourceQueue.AddAfter(key, duration) } -func (op *Reporting) addReportGenerationQuery(obj interface{}) { - query := obj.(*cbTypes.ReportGenerationQuery) - op.logger.Infof("adding ReportGenerationQuery %s/%s", query.Namespace, query.Name) - op.enqueueReportGenerationQuery(query) +func (op *Reporting) addReportQuery(obj interface{}) { + query := obj.(*cbTypes.ReportQuery) + op.logger.Infof("adding ReportQuery %s/%s", query.Namespace, query.Name) + op.enqueueReportQuery(query) } -func (op *Reporting) updateReportGenerationQuery(prev, cur interface{}) { - curReportGenerationQuery := cur.(*cbTypes.ReportGenerationQuery) - prevReportGenerationQuery := prev.(*cbTypes.ReportGenerationQuery) - logger := op.logger.WithFields(log.Fields{"reportGenerationQuery": curReportGenerationQuery.Name, "namespace": curReportGenerationQuery.Namespace}) +func (op *Reporting) updateReportQuery(prev, cur interface{}) { + curReportQuery := cur.(*cbTypes.ReportQuery) + prevReportQuery := prev.(*cbTypes.ReportQuery) + logger := op.logger.WithFields(log.Fields{"reportQuery": curReportQuery.Name, "namespace": curReportQuery.Namespace}) // Only skip queuing if we're not missing a view - if curReportGenerationQuery.ResourceVersion == prevReportGenerationQuery.ResourceVersion { - // Periodic resyncs will send update events for all known ReportGenerationQuerys. - // Two different versions of the same reportGenerationQuery will always have + if curReportQuery.ResourceVersion == prevReportQuery.ResourceVersion { + // Periodic resyncs will send update events for all known ReportQuerys. + // Two different versions of the same reportQuery will always have // different ResourceVersions. - logger.Debugf("ReportGenerationQuery %s/%s resourceVersion is unchanged, skipping update", curReportGenerationQuery.Namespace, curReportGenerationQuery.Name) + logger.Debugf("ReportQuery %s/%s resourceVersion is unchanged, skipping update", curReportQuery.Namespace, curReportQuery.Name) return } - if reflect.DeepEqual(prevReportGenerationQuery.Spec, curReportGenerationQuery.Spec) { - logger.Debugf("ReportGenerationQuery %s/%s spec is unchanged, skipping update", curReportGenerationQuery.Namespace, curReportGenerationQuery.Name) + if reflect.DeepEqual(prevReportQuery.Spec, curReportQuery.Spec) { + logger.Debugf("ReportQuery %s/%s spec is unchanged, skipping update", curReportQuery.Namespace, curReportQuery.Name) return } - logger.Infof("updating ReportGenerationQuery %s/%s", curReportGenerationQuery.Namespace, curReportGenerationQuery.Name) - op.enqueueReportGenerationQuery(curReportGenerationQuery) + logger.Infof("updating ReportQuery %s/%s", curReportQuery.Namespace, curReportQuery.Name) + op.enqueueReportQuery(curReportQuery) } -func (op *Reporting) enqueueReportGenerationQuery(query *cbTypes.ReportGenerationQuery) { +func (op *Reporting) enqueueReportQuery(query *cbTypes.ReportQuery) { key, err := cache.MetaNamespaceKeyFunc(query) if err != nil { - op.logger.WithFields(log.Fields{"reportGenerationQuery": query.Name, "namespace": query.Namespace}).WithError(err).Errorf("couldn't get key for object: %#v", query) + op.logger.WithFields(log.Fields{"reportQuery": query.Name, "namespace": query.Namespace}).WithError(err).Errorf("couldn't get key for object: %#v", query) return } - op.reportGenerationQueryQueue.Add(key) + op.reportQueryQueue.Add(key) } func (op *Reporting) addPrestoTable(obj interface{}) { diff --git a/pkg/operator/reportgenerationquery.go b/pkg/operator/reportgenerationquery.go deleted file mode 100644 index ab89ca889..000000000 --- a/pkg/operator/reportgenerationquery.go +++ /dev/null @@ -1,70 +0,0 @@ -package operator - -import ( - log "github.com/sirupsen/logrus" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/cache" - - cbTypes "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" - "github.com/operator-framework/operator-metering/pkg/operator/reporting" -) - -func (op *Reporting) runReportGenerationQueryWorker() { - logger := op.logger.WithField("component", "reportGenerationQueryWorker") - logger.Infof("ReportGenerationQuery worker started") - // 10 requeues compared to the 5 others have because - // ReportGenerationQueries can reference a lot of other resources, and it may - // take time for them to all to finish setup - const maxRequeues = 10 - for op.processResource(logger, op.syncReportGenerationQuery, "ReportGenerationQuery", op.reportGenerationQueryQueue, maxRequeues) { - } -} - -func (op *Reporting) syncReportGenerationQuery(logger log.FieldLogger, key string) error { - namespace, name, err := cache.SplitMetaNamespaceKey(key) - if err != nil { - logger.WithError(err).Errorf("invalid resource key :%s", key) - return nil - } - - logger = logger.WithFields(log.Fields{"reportGenerationQuery": name, "namespace": namespace}) - - reportGenerationQueryLister := op.reportGenerationQueryLister - reportGenerationQuery, err := reportGenerationQueryLister.ReportGenerationQueries(namespace).Get(name) - if err != nil { - if apierrors.IsNotFound(err) { - logger.Infof("ReportGenerationQuery %s does not exist anymore", key) - return nil - } - return err - } - q := reportGenerationQuery.DeepCopy() - return op.handleReportGenerationQuery(logger, q) -} - -func (op *Reporting) handleReportGenerationQuery(logger log.FieldLogger, generationQuery *cbTypes.ReportGenerationQuery) error { - // queue any reportDataSources using this query to create views - return op.queueDependentReportDataSourcesForQuery(generationQuery) -} - -func (op *Reporting) uninitialiedDependendenciesHandler() *reporting.UninitialiedDependendenciesHandler { - return &reporting.UninitialiedDependendenciesHandler{ - HandleUninitializedReportDataSource: op.enqueueReportDataSource, - } -} - -func (op *Reporting) queueDependentReportDataSourcesForQuery(generationQuery *cbTypes.ReportGenerationQuery) error { - reportDataSourceLister := op.meteringClient.MeteringV1alpha1().ReportDataSources(generationQuery.Namespace) - reportDataSources, err := reportDataSourceLister.List(metav1.ListOptions{}) - if err != nil { - return err - } - - for _, reportDataSource := range reportDataSources.Items { - if reportDataSource.Spec.GenerationQueryView != nil && reportDataSource.Spec.GenerationQueryView.QueryName == generationQuery.Name { - op.enqueueReportDataSource(reportDataSource) - } - } - return nil -} diff --git a/pkg/operator/reporting/dependencies.go b/pkg/operator/reporting/dependencies.go index 2701f4ba2..19b9b1e42 100644 --- a/pkg/operator/reporting/dependencies.go +++ b/pkg/operator/reporting/dependencies.go @@ -12,25 +12,25 @@ import ( const maxDepth = 50 -type ReportGenerationQueryDependencies struct { - ReportGenerationQueries []*metering.ReportGenerationQuery - ReportDataSources []*metering.ReportDataSource - Reports []*metering.Report +type ReportQueryDependencies struct { + ReportQueries []*metering.ReportQuery + ReportDataSources []*metering.ReportDataSource + Reports []*metering.Report } type DependencyResolutionResult struct { - Dependencies *ReportGenerationQueryDependencies + Dependencies *ReportQueryDependencies InputValues map[string]interface{} } type DependencyResolver struct { - queryGetter ReportGenerationQueryGetter + queryGetter ReportQueryGetter dataSourceGetter ReportDataSourceGetter reportGetter ReportGetter } func NewDependencyResolver( - queryGetter ReportGenerationQueryGetter, + queryGetter ReportQueryGetter, dataSourceGetter ReportDataSourceGetter, reportGetter ReportGetter) *DependencyResolver { @@ -41,10 +41,10 @@ func NewDependencyResolver( } } -func (resolver *DependencyResolver) ResolveDependencies(namespace string, inputDefs []metering.ReportGenerationQueryInputDefinition, inputVals []metering.ReportGenerationQueryInputValue) (*DependencyResolutionResult, error) { +func (resolver *DependencyResolver) ResolveDependencies(namespace string, inputDefs []metering.ReportQueryInputDefinition, inputVals []metering.ReportQueryInputValue) (*DependencyResolutionResult, error) { resolverCtx := &resolverContext{ reportAccumulator: make(map[string]*metering.Report), - queryAccumulator: make(map[string]*metering.ReportGenerationQuery), + queryAccumulator: make(map[string]*metering.ReportQuery), datasourceAccumulator: make(map[string]*metering.ReportDataSource), inputValues: make(map[string]interface{}), } @@ -53,17 +53,17 @@ func (resolver *DependencyResolver) ResolveDependencies(namespace string, inputD return nil, err } - deps := &ReportGenerationQueryDependencies{ - ReportGenerationQueries: make([]*metering.ReportGenerationQuery, 0, len(resolverCtx.queryAccumulator)), - ReportDataSources: make([]*metering.ReportDataSource, 0, len(resolverCtx.datasourceAccumulator)), - Reports: make([]*metering.Report, 0, len(resolverCtx.reportAccumulator)), + deps := &ReportQueryDependencies{ + ReportQueries: make([]*metering.ReportQuery, 0, len(resolverCtx.queryAccumulator)), + ReportDataSources: make([]*metering.ReportDataSource, 0, len(resolverCtx.datasourceAccumulator)), + Reports: make([]*metering.Report, 0, len(resolverCtx.reportAccumulator)), } for _, datasource := range resolverCtx.datasourceAccumulator { deps.ReportDataSources = append(deps.ReportDataSources, datasource) } for _, query := range resolverCtx.queryAccumulator { - deps.ReportGenerationQueries = append(deps.ReportGenerationQueries, query) + deps.ReportQueries = append(deps.ReportQueries, query) } for _, report := range resolverCtx.reportAccumulator { deps.Reports = append(deps.Reports, report) @@ -72,8 +72,8 @@ func (resolver *DependencyResolver) ResolveDependencies(namespace string, inputD sort.Slice(deps.ReportDataSources, func(i, j int) bool { return deps.ReportDataSources[i].Name < deps.ReportDataSources[j].Name }) - sort.Slice(deps.ReportGenerationQueries, func(i, j int) bool { - return deps.ReportGenerationQueries[i].Name < deps.ReportGenerationQueries[j].Name + sort.Slice(deps.ReportQueries, func(i, j int) bool { + return deps.ReportQueries[i].Name < deps.ReportQueries[j].Name }) sort.Slice(deps.Reports, func(i, j int) bool { return deps.Reports[i].Name < deps.Reports[j].Name @@ -87,12 +87,12 @@ func (resolver *DependencyResolver) ResolveDependencies(namespace string, inputD type resolverContext struct { reportAccumulator map[string]*metering.Report - queryAccumulator map[string]*metering.ReportGenerationQuery + queryAccumulator map[string]*metering.ReportQuery datasourceAccumulator map[string]*metering.ReportDataSource inputValues map[string]interface{} } -func (resolver *DependencyResolver) resolveDependencies(namespace string, resolverCtx *resolverContext, inputDefs []metering.ReportGenerationQueryInputDefinition, inputVals []metering.ReportGenerationQueryInputValue, depth, maxDepth int) error { +func (resolver *DependencyResolver) resolveDependencies(namespace string, resolverCtx *resolverContext, inputDefs []metering.ReportQueryInputDefinition, inputVals []metering.ReportQueryInputValue, depth, maxDepth int) error { if depth >= maxDepth { return fmt.Errorf("detected a cycle at depth %d", depth) } @@ -103,7 +103,7 @@ func (resolver *DependencyResolver) resolveDependencies(namespace string, resolv supportedInputs = append(supportedInputs, def.Name) } - givenInputs := make(map[string]metering.ReportGenerationQueryInputValue) + givenInputs := make(map[string]metering.ReportQueryInputValue) for _, val := range inputVals { var seen bool for _, def := range inputDefs { @@ -164,7 +164,7 @@ func (resolver *DependencyResolver) resolveDependencies(namespace string, resolv } } } - case "reportgenerationquery": + case "reportquery": dst = new(string) err = json.Unmarshal(*inputVal, dst) if err == nil { @@ -199,16 +199,16 @@ func (resolver *DependencyResolver) resolveDependencies(namespace string, resolv return nil } -func (resolver *DependencyResolver) resolveQuery(namespace string, resolverCtx *resolverContext, inputVals []metering.ReportGenerationQueryInputValue, queryName string, depth, maxDepth int) error { +func (resolver *DependencyResolver) resolveQuery(namespace string, resolverCtx *resolverContext, inputVals []metering.ReportQueryInputValue, queryName string, depth, maxDepth int) error { if _, exists := resolverCtx.queryAccumulator[queryName]; exists { return nil } // fetch the query - query, err := resolver.queryGetter.GetReportGenerationQuery(namespace, queryName) + query, err := resolver.queryGetter.GetReportQuery(namespace, queryName) if err != nil { return err } - // Resolve the dependencies of the reportGenerationQuery. + // Resolve the dependencies of the reportQuery. // We pass nil for the inputValues to resolverDependencies to avoid cycles. err = resolver.resolveDependencies(namespace, resolverCtx, query.Spec.Inputs, nil, depth, maxDepth) if err != nil { @@ -218,7 +218,7 @@ func (resolver *DependencyResolver) resolveQuery(namespace string, resolverCtx * return nil } -func (resolver *DependencyResolver) resolveDataSource(namespace string, resolverCtx *resolverContext, inputVals []metering.ReportGenerationQueryInputValue, dsName string, depth, maxDepth int) error { +func (resolver *DependencyResolver) resolveDataSource(namespace string, resolverCtx *resolverContext, inputVals []metering.ReportQueryInputValue, dsName string, depth, maxDepth int) error { if _, exists := resolverCtx.datasourceAccumulator[dsName]; exists { return nil } @@ -227,10 +227,10 @@ func (resolver *DependencyResolver) resolveDataSource(namespace string, resolver if err != nil { return err } - // if the datasource is a GenerationQuery datasource, lookup the query it + // if the datasource is a Query datasource, lookup the query it // depends on and resolve it's dependencies - if datasource.Spec.GenerationQueryView != nil { - err = resolver.resolveQuery(namespace, resolverCtx, inputVals, datasource.Spec.GenerationQueryView.QueryName, depth, maxDepth) + if datasource.Spec.ReportQueryView != nil { + err = resolver.resolveQuery(namespace, resolverCtx, inputVals, datasource.Spec.ReportQueryView.QueryName, depth, maxDepth) if err != nil { return err } @@ -239,7 +239,7 @@ func (resolver *DependencyResolver) resolveDataSource(namespace string, resolver return nil } -func (resolver *DependencyResolver) resolveReport(namespace string, resolverCtx *resolverContext, inputVals []metering.ReportGenerationQueryInputValue, reportName string, depth, maxDepth int) error { +func (resolver *DependencyResolver) resolveReport(namespace string, resolverCtx *resolverContext, inputVals []metering.ReportQueryInputValue, reportName string, depth, maxDepth int) error { if _, exists := resolverCtx.reportAccumulator[reportName]; exists { return nil } @@ -248,7 +248,7 @@ func (resolver *DependencyResolver) resolveReport(namespace string, resolverCtx if err != nil { return err } - err = resolver.resolveQuery(namespace, resolverCtx, inputVals, report.Spec.GenerationQueryName, depth, maxDepth) + err = resolver.resolveQuery(namespace, resolverCtx, inputVals, report.Spec.QueryName, depth, maxDepth) if err != nil { return err } diff --git a/pkg/operator/reporting/dependencies_test.go b/pkg/operator/reporting/dependencies_test.go index 198aa2660..bea142c13 100644 --- a/pkg/operator/reporting/dependencies_test.go +++ b/pkg/operator/reporting/dependencies_test.go @@ -23,7 +23,7 @@ func TestDependencyResolver(t *testing.T) { ds2 := testhelpers.NewReportDataSource("datasource2", testNs) ds3 := testhelpers.NewReportDataSource("datasource4", testNs) - testInputs := []metering.ReportGenerationQueryInputDefinition{ + testInputs := []metering.ReportQueryInputDefinition{ { Name: "ds1", Type: "ReportDataSource", @@ -38,25 +38,25 @@ func TestDependencyResolver(t *testing.T) { }, { Name: "q1", - Type: "ReportGenerationQuery", + Type: "ReportQuery", Required: true, Default: newDefault(`"query1"`), }, { Name: "q2", - Type: "ReportGenerationQuery", + Type: "ReportQuery", Required: true, Default: newDefault(`"query2"`), }, } - query1 := &metering.ReportGenerationQuery{ + query1 := &metering.ReportQuery{ ObjectMeta: meta.ObjectMeta{ Name: "query1", Namespace: testNs, }, - Spec: metering.ReportGenerationQuerySpec{ - Inputs: []metering.ReportGenerationQueryInputDefinition{ + Spec: metering.ReportQuerySpec{ + Inputs: []metering.ReportQueryInputDefinition{ { Name: "ds3", Type: "ReportDataSource", @@ -67,16 +67,16 @@ func TestDependencyResolver(t *testing.T) { }, } - query2 := &metering.ReportGenerationQuery{ + query2 := &metering.ReportQuery{ ObjectMeta: meta.ObjectMeta{ Name: "query2", Namespace: testNs, }, - Spec: metering.ReportGenerationQuerySpec{ - Inputs: []metering.ReportGenerationQueryInputDefinition{ + Spec: metering.ReportQuerySpec{ + Inputs: []metering.ReportQueryInputDefinition{ { Name: "q3", - Type: "ReportGenerationQuery", + Type: "ReportQuery", Required: true, Default: newDefault(`"query3"`), }, @@ -84,19 +84,19 @@ func TestDependencyResolver(t *testing.T) { }, } - query3 := &metering.ReportGenerationQuery{ + query3 := &metering.ReportQuery{ ObjectMeta: meta.ObjectMeta{ Name: "query3", Namespace: testNs, }, - Spec: metering.ReportGenerationQuerySpec{}, + Spec: metering.ReportQuerySpec{}, } - expectedDeps := &ReportGenerationQueryDependencies{ + expectedDeps := &ReportQueryDependencies{ ReportDataSources: []*metering.ReportDataSource{ ds1, ds2, ds3, }, - ReportGenerationQueries: []*metering.ReportGenerationQuery{ + ReportQueries: []*metering.ReportQuery{ query1, query2, query3, }, Reports: []*metering.Report{}, @@ -105,7 +105,7 @@ func TestDependencyResolver(t *testing.T) { dataSourceGetter := testhelpers.NewReportDataSourceStore([]*metering.ReportDataSource{ ds1, ds2, ds3, }) - queryGetter := testhelpers.NewReportGenerationQueryStore([]*metering.ReportGenerationQuery{ + queryGetter := testhelpers.NewReportQueryStore([]*metering.ReportQuery{ query1, query2, query3, }) reportGetter := testhelpers.NewReportStore(nil) diff --git a/pkg/operator/reporting/getters.go b/pkg/operator/reporting/getters.go index 95d2be0a5..f4126be62 100644 --- a/pkg/operator/reporting/getters.go +++ b/pkg/operator/reporting/getters.go @@ -52,24 +52,24 @@ func NewReportClientGetter(getter meteringClient.ReportsGetter) ReportGetter { }) } -type ReportGenerationQueryGetter interface { - GetReportGenerationQuery(namespace, name string) (*metering.ReportGenerationQuery, error) +type ReportQueryGetter interface { + GetReportQuery(namespace, name string) (*metering.ReportQuery, error) } -type ReportGenerationQueryGetterFunc func(string, string) (*metering.ReportGenerationQuery, error) +type ReportQueryGetterFunc func(string, string) (*metering.ReportQuery, error) -func (f ReportGenerationQueryGetterFunc) GetReportGenerationQuery(namespace, name string) (*metering.ReportGenerationQuery, error) { +func (f ReportQueryGetterFunc) GetReportQuery(namespace, name string) (*metering.ReportQuery, error) { return f(namespace, name) } -func NewReportGenerationQueryListerGetter(lister meteringListers.ReportGenerationQueryLister) ReportGenerationQueryGetter { - return ReportGenerationQueryGetterFunc(func(namespace, name string) (*metering.ReportGenerationQuery, error) { - return lister.ReportGenerationQueries(namespace).Get(name) +func NewReportQueryListerGetter(lister meteringListers.ReportQueryLister) ReportQueryGetter { + return ReportQueryGetterFunc(func(namespace, name string) (*metering.ReportQuery, error) { + return lister.ReportQueries(namespace).Get(name) }) } -func NewReportGenerationQueryClientGetter(getter meteringClient.ReportGenerationQueriesGetter) ReportGenerationQueryGetter { - return ReportGenerationQueryGetterFunc(func(namespace, name string) (*metering.ReportGenerationQuery, error) { - return getter.ReportGenerationQueries(namespace).Get(name, metav1.GetOptions{}) +func NewReportQueryClientGetter(getter meteringClient.ReportQueriesGetter) ReportQueryGetter { + return ReportQueryGetterFunc(func(namespace, name string) (*metering.ReportQuery, error) { + return getter.ReportQueries(namespace).Get(name, metav1.GetOptions{}) }) } diff --git a/pkg/operator/reporting/report_generator.go b/pkg/operator/reporting/report_generator.go index 6f1bf0408..182d4b083 100644 --- a/pkg/operator/reporting/report_generator.go +++ b/pkg/operator/reporting/report_generator.go @@ -15,9 +15,9 @@ const ( ) var ( - errInvalidTableName = errors.New("tableName cannot be empty") - errInvalidReportGenerationQueryName = errors.New("reportGenerationQuery cannot be empty") - errEmptyQueryField = errors.New("ReportGenerationQuery spec.query cannot be empty") + errInvalidTableName = errors.New("tableName cannot be empty") + errInvalidReportQueryName = errors.New("reportQuery cannot be empty") + errEmptyQueryField = errors.New("ReportQuery spec.query cannot be empty") ) type ReportGenerator interface { @@ -53,7 +53,7 @@ func (g *reportGenerator) GenerateReport(tableName, query string, deleteExisting } } - logger.Debugf("StoreReportResults: executing ReportGenerationQuery") + logger.Debugf("StoreReportResults: executing ReportQuery") err := g.reportResultsRepo.StoreReportResults(tableName, query) if err != nil { logger.WithError(err).Errorf("creating usage report FAILED!") diff --git a/pkg/operator/reporting/report_generator_test.go b/pkg/operator/reporting/report_generator_test.go index 9976cc4be..a2745584f 100644 --- a/pkg/operator/reporting/report_generator_test.go +++ b/pkg/operator/reporting/report_generator_test.go @@ -20,7 +20,7 @@ func TestGenerateReport(t *testing.T) { deleteExistingData bool expectedErr string }{ - "a table name and a ReportGenerationQuery with a query": { + "a table name and a ReportQuery with a query": { tableName: tableName, query: testSQL, }, @@ -29,7 +29,7 @@ func TestGenerateReport(t *testing.T) { query: testSQL, expectedErr: errInvalidTableName.Error(), }, - "a table name and a ReportGenerationQuery with a query field and deleteExistingData=true will succeed": { + "a table name and a ReportQuery with a query field and deleteExistingData=true will succeed": { tableName: tableName, query: testSQL, deleteExistingData: true, diff --git a/pkg/operator/reporting/templates.go b/pkg/operator/reporting/templates.go index 08f27e12f..026a4c202 100644 --- a/pkg/operator/reporting/templates.go +++ b/pkg/operator/reporting/templates.go @@ -16,12 +16,12 @@ import ( ) type ReportQueryTemplateContext struct { - Namespace string - Reports []*cbTypes.Report - ReportQuery *cbTypes.ReportGenerationQuery - ReportGenerationQueries []*cbTypes.ReportGenerationQuery - ReportDataSources []*cbTypes.ReportDataSource - PrestoTables []*cbTypes.PrestoTable + Namespace string + Reports []*cbTypes.Report + ReportQuery *cbTypes.ReportQuery + ReportQueries []*cbTypes.ReportQuery + ReportDataSources []*cbTypes.ReportDataSource + PrestoTables []*cbTypes.PrestoTable } type TemplateContext struct { @@ -68,16 +68,16 @@ func (ctx *ReportQueryTemplateContext) reportTableName(name string) (string, err return "", fmt.Errorf("Report %s dependency not found", name) } -func (ctx *ReportQueryTemplateContext) renderReportGenerationQuery(name string, tmplCtx TemplateContext) (string, error) { - var reportQuery *cbTypes.ReportGenerationQuery - for _, q := range ctx.ReportGenerationQueries { +func (ctx *ReportQueryTemplateContext) renderReportQuery(name string, tmplCtx TemplateContext) (string, error) { + var reportQuery *cbTypes.ReportQuery + for _, q := range ctx.ReportQueries { if q.Name == name { reportQuery = q break } } if reportQuery == nil { - return "", fmt.Errorf("unknown ReportGenerationQuery %s", name) + return "", fmt.Errorf("unknown ReportQuery %s", name) } // copy context and replace the query we're rendering @@ -98,10 +98,10 @@ func (ctx *ReportQueryTemplateContext) newQueryTemplate() (*template.Template, e "prometheusMetricPartitionFormat": PrometheusMetricPartitionFormat, "reportTableName": ctx.reportTableName, "dataSourceTableName": ctx.dataSourceTableName, - "renderReportGenerationQuery": ctx.renderReportGenerationQuery, + "renderReportQuery": ctx.renderReportQuery, } - tmpl, err := template.New("report-generation-query").Delims("{|", "|}").Funcs(templateFuncMap).Funcs(sprig.TxtFuncMap()).Parse(ctx.ReportQuery.Spec.Query) + tmpl, err := template.New("reportQueryTemplate").Delims("{|", "|}").Funcs(templateFuncMap).Funcs(sprig.TxtFuncMap()).Parse(ctx.ReportQuery.Spec.Query) if err != nil { return nil, fmt.Errorf("error parsing query: %v", err) } diff --git a/pkg/operator/reporting/validate.go b/pkg/operator/reporting/validate.go index 2fa218fc6..1d607c988 100644 --- a/pkg/operator/reporting/validate.go +++ b/pkg/operator/reporting/validate.go @@ -8,33 +8,33 @@ import ( metering "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" ) -func GetAndValidateGenerationQueryDependencies( - queryGetter ReportGenerationQueryGetter, +func GetAndValidateQueryDependencies( + queryGetter ReportQueryGetter, dataSourceGetter ReportDataSourceGetter, reportGetter ReportGetter, - generationQuery *metering.ReportGenerationQuery, - inputVals []cbTypes.ReportGenerationQueryInputValue, + query *metering.ReportQuery, + inputVals []cbTypes.ReportQueryInputValue, handler *UninitialiedDependendenciesHandler, -) (*ReportGenerationQueryDependencies, error) { - deps, err := GetGenerationQueryDependencies(queryGetter, dataSourceGetter, reportGetter, generationQuery, inputVals) +) (*ReportQueryDependencies, error) { + deps, err := GetQueryDependencies(queryGetter, dataSourceGetter, reportGetter, query, inputVals) if err != nil { return nil, err } - err = ValidateGenerationQueryDependencies(deps, handler) + err = ValidateQueryDependencies(deps, handler) if err != nil { return nil, err } return deps, nil } -func GetGenerationQueryDependencies( - queryGetter ReportGenerationQueryGetter, +func GetQueryDependencies( + queryGetter ReportQueryGetter, dataSourceGetter ReportDataSourceGetter, reportGetter ReportGetter, - generationQuery *metering.ReportGenerationQuery, - inputVals []cbTypes.ReportGenerationQueryInputValue, -) (*ReportGenerationQueryDependencies, error) { - result, err := NewDependencyResolver(queryGetter, dataSourceGetter, reportGetter).ResolveDependencies(generationQuery.Namespace, generationQuery.Spec.Inputs, inputVals) + query *metering.ReportQuery, + inputVals []cbTypes.ReportQueryInputValue, +) (*ReportQueryDependencies, error) { + result, err := NewDependencyResolver(queryGetter, dataSourceGetter, reportGetter).ResolveDependencies(query.Namespace, query.Spec.Inputs, inputVals) if err != nil { return nil, err } @@ -45,11 +45,11 @@ type UninitialiedDependendenciesHandler struct { HandleUninitializedReportDataSource func(*metering.ReportDataSource) } -func ValidateGenerationQueryDependencies(deps *ReportGenerationQueryDependencies, handler *UninitialiedDependendenciesHandler) error { - // if the specified ReportGenerationQuery depends on datasources without a +func ValidateQueryDependencies(deps *ReportQueryDependencies, handler *UninitialiedDependendenciesHandler) error { + // if the specified ReportQuery depends on datasources without a // table, it's invalid var uninitializedDataSources []*metering.ReportDataSource - validationErr := new(reportGenerationQueryDependenciesValidationError) + validationErr := new(reportQueryDependenciesValidationError) // anything below missing tableName in it's status is uninitialized for _, ds := range deps.ReportDataSources { if ds.Status.TableRef.Name == "" { @@ -76,22 +76,22 @@ func ValidateGenerationQueryDependencies(deps *ReportGenerationQueryDependencies } func IsUninitializedDependencyError(err error) bool { - validationErr, ok := err.(*reportGenerationQueryDependenciesValidationError) + validationErr, ok := err.(*reportQueryDependenciesValidationError) return ok && (len(validationErr.uninitializedDataSourceNames) != 0 || len(validationErr.uninitializedReportNames) != 0) } func IsInvalidDependencyError(err error) bool { - _, ok := err.(*reportGenerationQueryDependenciesValidationError) + _, ok := err.(*reportQueryDependenciesValidationError) return ok } -type reportGenerationQueryDependenciesValidationError struct { +type reportQueryDependenciesValidationError struct { uninitializedDataSourceNames, uninitializedReportNames []string } -func (e *reportGenerationQueryDependenciesValidationError) Error() string { +func (e *reportQueryDependenciesValidationError) Error() string { var errs []string if len(e.uninitializedDataSourceNames) != 0 { errs = append(errs, fmt.Sprintf("uninitialized ReportDataSource dependencies: %s", strings.Join(e.uninitializedDataSourceNames, ", "))) @@ -100,7 +100,7 @@ func (e *reportGenerationQueryDependenciesValidationError) Error() string { errs = append(errs, fmt.Sprintf("uninitialized Report dependencies: %s", strings.Join(e.uninitializedReportNames, ", "))) } if len(errs) != 0 { - return fmt.Sprintf("ReportGenerationQueryDependencyValidationError: %s", strings.Join(errs, ", ")) + return fmt.Sprintf("ReportQueryDependencyValidationError: %s", strings.Join(errs, ", ")) } panic("zero uninitialized or invalid dependencies") } diff --git a/pkg/operator/reporting/validate_test.go b/pkg/operator/reporting/validate_test.go index f10c95566..a11d39fdb 100644 --- a/pkg/operator/reporting/validate_test.go +++ b/pkg/operator/reporting/validate_test.go @@ -11,8 +11,8 @@ import ( "github.com/operator-framework/operator-metering/test/testhelpers" ) -func TestValidateGenerationQueryDependencies(t *testing.T) { - // reportQuery := testhelpers.NewReportGenerationQuery("uninitialized-query", "default", nil) +func TestValidateQueryDependencies(t *testing.T) { + // reportQuery := testhelpers.NewReportQuery("uninitialized-query", "default", nil) dataSourceTableUnset := testhelpers.NewReportDataSource("uninitialized-datasource", "default") dataSourceTableSet := testhelpers.NewReportDataSource("initialized-datasource", "default") dataSourceTableSet.Status.TableRef.Name = reportingutil.DataSourceTableName("test-ns", "initialized-datasource") @@ -36,51 +36,51 @@ func TestValidateGenerationQueryDependencies(t *testing.T) { } tests := map[string]struct { - deps ReportGenerationQueryDependencies + deps ReportQueryDependencies expectErr bool }{ "no dependencies results in no errors": { - deps: ReportGenerationQueryDependencies{}, + deps: ReportQueryDependencies{}, }, - "ReportGenerationQueryDependencies dependencies on other queries is valid": { - deps: ReportGenerationQueryDependencies{ - // ReportGenerationQueries: initializedQueries, + "ReportQueryDependencies dependencies on other queries is valid": { + deps: ReportQueryDependencies{ + // ReportQueries: initializedQueries, }, }, "ReportDataSource dependencies with status.tableRef.name unset is a validation error": { - deps: ReportGenerationQueryDependencies{ + deps: ReportQueryDependencies{ ReportDataSources: uninitializedDataSources, }, expectErr: true, }, "ReportDataSource dependencies with status.tableRef.name set is valid": { - deps: ReportGenerationQueryDependencies{ + deps: ReportQueryDependencies{ ReportDataSources: initializedDataSources, }, }, "Report dependencies with status.tableRef.name unset is a validation error": { - deps: ReportGenerationQueryDependencies{ + deps: ReportQueryDependencies{ Reports: uninitializedReports, }, expectErr: true, }, "Report dependencies with status.tableRef.name set is valid": { - deps: ReportGenerationQueryDependencies{ + deps: ReportQueryDependencies{ Reports: initializedReports, }, }, "mixing valid and invalid dependencies is a validation error": { - deps: ReportGenerationQueryDependencies{ + deps: ReportQueryDependencies{ Reports: uninitializedReports, - // ReportGenerationQueries: initializedQueries, + // ReportQueries: initializedQueries, ReportDataSources: uninitializedDataSources, }, expectErr: true, }, "mixing valid dependencies is a valid": { - deps: ReportGenerationQueryDependencies{ + deps: ReportQueryDependencies{ Reports: uninitializedReports, - // ReportGenerationQueries: initializedQueries, + // ReportQueries: initializedQueries, ReportDataSources: initializedDataSources, }, expectErr: true, @@ -91,7 +91,7 @@ func TestValidateGenerationQueryDependencies(t *testing.T) { testName := testName tt := tt t.Run(testName, func(t *testing.T) { - err := ValidateGenerationQueryDependencies(&tt.deps, nil) + err := ValidateQueryDependencies(&tt.deps, nil) if tt.expectErr { assert.NotNil(t, err, "expected a validation error") } else { diff --git a/pkg/operator/reportingutil/util.go b/pkg/operator/reportingutil/util.go index 61ae07cad..4b6a95ac0 100644 --- a/pkg/operator/reportingutil/util.go +++ b/pkg/operator/reportingutil/util.go @@ -64,17 +64,17 @@ func TruncateToMinute(t time.Time) time.Time { return t.Truncate(time.Minute) } -func GenerateHiveColumns(genQuery *cbTypes.ReportGenerationQuery) []hive.Column { +func GenerateHiveColumns(query *cbTypes.ReportQuery) []hive.Column { var columns []hive.Column - for _, col := range genQuery.Spec.Columns { + for _, col := range query.Spec.Columns { columns = append(columns, hive.Column{Name: col.Name, Type: col.Type}) } return columns } -func GeneratePrestoColumns(genQuery *cbTypes.ReportGenerationQuery) []presto.Column { +func GeneratePrestoColumns(query *cbTypes.ReportQuery) []presto.Column { var columns []presto.Column - for _, col := range genQuery.Spec.Columns { + for _, col := range query.Spec.Columns { columns = append(columns, presto.Column{Name: col.Name, Type: col.Type}) } return columns diff --git a/pkg/operator/reportquery.go b/pkg/operator/reportquery.go new file mode 100644 index 000000000..bd9f6b58c --- /dev/null +++ b/pkg/operator/reportquery.go @@ -0,0 +1,70 @@ +package operator + +import ( + log "github.com/sirupsen/logrus" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/tools/cache" + + cbTypes "github.com/operator-framework/operator-metering/pkg/apis/metering/v1alpha1" + "github.com/operator-framework/operator-metering/pkg/operator/reporting" +) + +func (op *Reporting) runReportQueryWorker() { + logger := op.logger.WithField("component", "reportQueryWorker") + logger.Infof("ReportQuery worker started") + // 10 requeues compared to the 5 others have because + // ReportQueries can reference a lot of other resources, and it may + // take time for them to all to finish setup + const maxRequeues = 10 + for op.processResource(logger, op.syncReportQuery, "ReportQuery", op.reportQueryQueue, maxRequeues) { + } +} + +func (op *Reporting) syncReportQuery(logger log.FieldLogger, key string) error { + namespace, name, err := cache.SplitMetaNamespaceKey(key) + if err != nil { + logger.WithError(err).Errorf("invalid resource key :%s", key) + return nil + } + + logger = logger.WithFields(log.Fields{"reportQuery": name, "namespace": namespace}) + + reportQueryLister := op.reportQueryLister + reportQuery, err := reportQueryLister.ReportQueries(namespace).Get(name) + if err != nil { + if apierrors.IsNotFound(err) { + logger.Infof("ReportQuery %s does not exist anymore", key) + return nil + } + return err + } + q := reportQuery.DeepCopy() + return op.handleReportQuery(logger, q) +} + +func (op *Reporting) handleReportQuery(logger log.FieldLogger, query *cbTypes.ReportQuery) error { + // queue any reportDataSources using this query to create views + return op.queueDependentReportDataSourcesForQuery(query) +} + +func (op *Reporting) uninitialiedDependendenciesHandler() *reporting.UninitialiedDependendenciesHandler { + return &reporting.UninitialiedDependendenciesHandler{ + HandleUninitializedReportDataSource: op.enqueueReportDataSource, + } +} + +func (op *Reporting) queueDependentReportDataSourcesForQuery(query *cbTypes.ReportQuery) error { + reportDataSourceLister := op.meteringClient.MeteringV1alpha1().ReportDataSources(query.Namespace) + reportDataSources, err := reportDataSourceLister.List(metav1.ListOptions{}) + if err != nil { + return err + } + + for _, reportDataSource := range reportDataSources.Items { + if reportDataSource.Spec.ReportQueryView != nil && reportDataSource.Spec.ReportQueryView.QueryName == query.Name { + op.enqueueReportDataSource(reportDataSource) + } + } + return nil +} diff --git a/pkg/operator/reports.go b/pkg/operator/reports.go index e51ec1ae3..824a73f39 100644 --- a/pkg/operator/reports.go +++ b/pkg/operator/reports.go @@ -29,7 +29,7 @@ const ( ) var ( - reportPrometheusMetricLabels = []string{"report", "namespace", "reportgenerationquery", "table_name"} + reportPrometheusMetricLabels = []string{"report", "namespace", "reportquery", "table_name"} generateReportTotalCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ @@ -245,13 +245,13 @@ func isReportFinished(logger log.FieldLogger, report *cbTypes.Report) bool { // validateReport takes a Report structure and checks if it contains valid fields func validateReport( report *cbTypes.Report, - queryGetter reporting.ReportGenerationQueryGetter, + queryGetter reporting.ReportQueryGetter, depResolver DependencyResolver, handler *reporting.UninitialiedDependendenciesHandler, -) (*cbTypes.ReportGenerationQuery, *reporting.DependencyResolutionResult, error) { - // Validate the ReportGenerationQuery is set - if report.Spec.GenerationQueryName == "" { - return nil, nil, errors.New("must set spec.generationQuery") +) (*cbTypes.ReportQuery, *reporting.DependencyResolutionResult, error) { + // Validate the ReportQuery is set + if report.Spec.QueryName == "" { + return nil, nil, errors.New("must set spec.query") } // Validate the reportingStart and reportingEnd make sense and are set when @@ -263,29 +263,29 @@ func validateReport( return nil, nil, errors.New("spec.reportingEnd must be set if report.spec.runImmediately is true") } - // Validate the ReportGenerationQuery that the Report used exists - genQuery, err := GetReportGenerationQueryForReport(report, queryGetter) + // Validate the ReportQuery that the Report used exists + query, err := GetReportQueryForReport(report, queryGetter) if err != nil { if apierrors.IsNotFound(err) { - return nil, nil, fmt.Errorf("ReportGenerationQuery (%s) does not exist", report.Spec.GenerationQueryName) + return nil, nil, fmt.Errorf("ReportQuery (%s) does not exist", report.Spec.QueryName) } - return nil, nil, fmt.Errorf("failed to get report generation query") + return nil, nil, fmt.Errorf("failed to get report report query") } // Validate the dependencies of this Report's query exist dependencyResult, err := depResolver.ResolveDependencies( - genQuery.Namespace, - genQuery.Spec.Inputs, + query.Namespace, + query.Spec.Inputs, report.Spec.Inputs) if err != nil { - return nil, nil, fmt.Errorf("failed to resolve ReportGenerationQuery dependencies %s: %v", genQuery.Name, err) + return nil, nil, fmt.Errorf("failed to resolve ReportQuery dependencies %s: %v", query.Name, err) } - err = reporting.ValidateGenerationQueryDependencies(dependencyResult.Dependencies, handler) + err = reporting.ValidateQueryDependencies(dependencyResult.Dependencies, handler) if err != nil { - return nil, nil, fmt.Errorf("failed to validate ReportGenerationQuery dependencies %s: %v", genQuery.Name, err) + return nil, nil, fmt.Errorf("failed to validate ReportQuery dependencies %s: %v", query.Name, err) } - return genQuery, dependencyResult, nil + return query, dependencyResult, nil } // getReportPeriod determines a Report's reporting period based off the report parameter's fields. @@ -350,10 +350,10 @@ func (op *Reporting) runReport(logger log.FieldLogger, report *cbTypes.Report) e } runningCond := cbutil.GetReportCondition(report.Status, cbTypes.ReportRunning) - queryGetter := reporting.NewReportGenerationQueryListerGetter(op.reportGenerationQueryLister) + queryGetter := reporting.NewReportQueryListerGetter(op.reportQueryLister) // validate that Report contains valid Spec fields - genQuery, dependencyResult, err := validateReport(report, queryGetter, op.dependencyResolver, op.uninitialiedDependendenciesHandler()) + reportQuery, dependencyResult, err := validateReport(report, queryGetter, op.dependencyResolver, op.uninitialiedDependendenciesHandler()) if err != nil { return op.setReportStatusInvalidReport(report, err.Error()) } @@ -393,7 +393,7 @@ func (op *Reporting) runReport(logger log.FieldLogger, report *cbTypes.Report) e return fmt.Errorf("StorageLocation %s Hive database %s does not exist yet", hiveStorage.Name, hiveStorage.Spec.Hive.DatabaseName) } - cols, err := reportingutil.PrestoColumnsToHiveColumns(reportingutil.GeneratePrestoColumns(genQuery)) + cols, err := reportingutil.PrestoColumnsToHiveColumns(reportingutil.GeneratePrestoColumns(reportQuery)) if err != nil { return fmt.Errorf("unable to convert Presto columns to Hive columns: %s", err) } @@ -465,8 +465,8 @@ func (op *Reporting) runReport(logger log.FieldLogger, report *cbTypes.Report) e } // queue dependents so that they're aware the table now exists - if err := op.queueDependentReportGenerationQueriesForReport(report); err != nil { - logger.WithError(err).Errorf("error queuing ReportGenerationQuery dependents of Report %s", report.Name) + if err := op.queueDependentReportQueriesForReport(report); err != nil { + logger.WithError(err).Errorf("error queuing ReportQuery dependents of Report %s", report.Name) } if err := op.queueDependentReportsForReport(report); err != nil { logger.WithError(err).Errorf("error queuing Report dependents of Report %s", report.Name) @@ -604,18 +604,18 @@ func (op *Reporting) runReport(logger log.FieldLogger, report *cbTypes.Report) e return err } - queries, err := op.reportGenerationQueryLister.ReportGenerationQueries(report.Namespace).List(labels.Everything()) + queries, err := op.reportQueryLister.ReportQueries(report.Namespace).List(labels.Everything()) if err != nil { return err } queryCtx := &reporting.ReportQueryTemplateContext{ - Namespace: report.Namespace, - ReportQuery: genQuery, - Reports: reports, - ReportGenerationQueries: queries, - ReportDataSources: datasources, - PrestoTables: prestoTables, + Namespace: report.Namespace, + ReportQuery: reportQuery, + Reports: reports, + ReportQueries: queries, + ReportDataSources: datasources, + PrestoTables: prestoTables, } tmplCtx := reporting.TemplateContext{ Report: reporting.ReportTemplateInfo{ @@ -632,17 +632,17 @@ func (op *Reporting) runReport(logger log.FieldLogger, report *cbTypes.Report) e } metricLabels := prometheus.Labels{ - "report": report.Name, - "namespace": report.Namespace, - "reportgenerationquery": report.Spec.GenerationQueryName, - "table_name": prestoTable.Status.TableName, + "report": report.Name, + "namespace": report.Namespace, + "reportquery": report.Spec.QueryName, + "table_name": prestoTable.Status.TableName, } genReportTotalCounter := generateReportTotalCounter.With(metricLabels) genReportFailedCounter := generateReportFailedCounter.With(metricLabels) genReportDurationObserver := generateReportDurationHistogram.With(metricLabels) - logger.Infof("generating Report %s using query %s and periodStart: %s, periodEnd: %s", report.Name, genQuery.Name, reportPeriod.periodStart, reportPeriod.periodEnd) + logger.Infof("generating Report %s using query %s and periodStart: %s, periodEnd: %s", report.Name, reportQuery.Name, reportPeriod.periodStart, reportPeriod.periodEnd) genReportTotalCounter.Inc() generateReportStart := op.clock.Now() @@ -663,7 +663,7 @@ func (op *Reporting) runReport(logger log.FieldLogger, report *cbTypes.Report) e return fmt.Errorf("failed to generateReport for Report %s, err: %v", report.Name, err) } - logger.Infof("successfully generated Report %s using query %s and periodStart: %s, periodEnd: %s", report.Name, genQuery.Name, reportPeriod.periodStart, reportPeriod.periodEnd) + logger.Infof("successfully generated Report %s using query %s and periodStart: %s, periodEnd: %s", report.Name, reportQuery.Name, reportPeriod.periodStart, reportPeriod.periodEnd) // Update the LastReportTime on the report status report.Status.LastReportTime = &metav1.Time{Time: reportPeriod.periodEnd} @@ -707,8 +707,8 @@ func (op *Reporting) runReport(logger log.FieldLogger, report *cbTypes.Report) e return err } - if err := op.queueDependentReportGenerationQueriesForReport(report); err != nil { - logger.WithError(err).Errorf("error queuing ReportGenerationQuery dependents of Report %s", report.Name) + if err := op.queueDependentReportQueriesForReport(report); err != nil { + logger.WithError(err).Errorf("error queuing ReportQuery dependents of Report %s", report.Name) } if err := op.queueDependentReportsForReport(report); err != nil { logger.WithError(err).Errorf("error queuing Report dependents of Report %s", report.Name) @@ -806,13 +806,13 @@ func (op *Reporting) setReportStatusInvalidReport(report *cbTypes.Report, msg st return err } -// GetReportGenerationQueryForReport returns the ReportGenerationQuery that was used in the Report parameter -func GetReportGenerationQueryForReport(report *cbTypes.Report, queryGetter reporting.ReportGenerationQueryGetter) (*cbTypes.ReportGenerationQuery, error) { - return queryGetter.GetReportGenerationQuery(report.Namespace, report.Spec.GenerationQueryName) +// GetReportQueryForReport returns the ReportQuery that was used in the Report parameter +func GetReportQueryForReport(report *cbTypes.Report, queryGetter reporting.ReportQueryGetter) (*cbTypes.ReportQuery, error) { + return queryGetter.GetReportQuery(report.Namespace, report.Spec.QueryName) } -func (op *Reporting) getReportDependencies(report *cbTypes.Report) (*reporting.ReportGenerationQueryDependencies, error) { - return op.getGenerationQueryDependencies(report.Namespace, report.Spec.GenerationQueryName, report.Spec.Inputs) +func (op *Reporting) getReportDependencies(report *cbTypes.Report) (*reporting.ReportQueryDependencies, error) { + return op.getQueryDependencies(report.Namespace, report.Spec.QueryName, report.Spec.Inputs) } func (op *Reporting) queueDependentReportsForReport(report *cbTypes.Report) error { @@ -841,11 +841,11 @@ func (op *Reporting) queueDependentReportsForReport(report *cbTypes.Report) erro return nil } -// queueDependentReportGenerationQueriesForReport will queue all -// ReportGenerationQueries in the namespace which have a dependency on the +// queueDependentReportQueriesForReport will queue all +// ReportQueries in the namespace which have a dependency on the // report -func (op *Reporting) queueDependentReportGenerationQueriesForReport(report *cbTypes.Report) error { - queryLister := op.meteringClient.MeteringV1alpha1().ReportGenerationQueries(report.Namespace) +func (op *Reporting) queueDependentReportQueriesForReport(report *cbTypes.Report) error { + queryLister := op.meteringClient.MeteringV1alpha1().ReportQueries(report.Namespace) queries, err := queryLister.List(metav1.ListOptions{}) if err != nil { return err @@ -854,14 +854,14 @@ func (op *Reporting) queueDependentReportGenerationQueriesForReport(report *cbTy for _, query := range queries.Items { // For every query in the namespace, lookup it's dependencies, and if // it has a dependency on the passed in Report, requeue it - deps, err := op.getGenerationQueryDependencies(query.Namespace, query.Name, nil) + deps, err := op.getQueryDependencies(query.Namespace, query.Name, nil) if err != nil { return err } for _, dependency := range deps.Reports { if dependency.Name == report.Name { // this query depends on the Report passed in - op.enqueueReportGenerationQuery(query) + op.enqueueReportQuery(query) break } } diff --git a/pkg/operator/reports_test.go b/pkg/operator/reports_test.go index b1df0b969..395d3abb7 100644 --- a/pkg/operator/reports_test.go +++ b/pkg/operator/reports_test.go @@ -255,13 +255,13 @@ func TestValidateReport(t *testing.T) { return &v } - testValidQuery := &metering.ReportGenerationQuery{ + testValidQuery := &metering.ReportQuery{ ObjectMeta: metav1.ObjectMeta{ Name: testQueryName, Namespace: testNamespace, }, - Spec: metering.ReportGenerationQuerySpec{ - Inputs: []metering.ReportGenerationQueryInputDefinition{ + Spec: metering.ReportQuerySpec{ + Inputs: []metering.ReportQueryInputDefinition{ { Name: "ds", Type: "ReportDataSource", @@ -272,13 +272,13 @@ func TestValidateReport(t *testing.T) { }, } - testInvalidQuery := &metering.ReportGenerationQuery{ + testInvalidQuery := &metering.ReportQuery{ ObjectMeta: metav1.ObjectMeta{ Name: testInvalidQueryName, Namespace: testNamespace, }, - Spec: metering.ReportGenerationQuerySpec{ - Inputs: []metering.ReportGenerationQueryInputDefinition{ + Spec: metering.ReportQuerySpec{ + Inputs: []metering.ReportQueryInputDefinition{ { Name: "ds", Type: "ReportDataSource", @@ -289,13 +289,13 @@ func TestValidateReport(t *testing.T) { }, } - testInvalidQuery2 := &metering.ReportGenerationQuery{ + testInvalidQuery2 := &metering.ReportQuery{ ObjectMeta: metav1.ObjectMeta{ Name: testInvalidQueryName2, Namespace: testNamespace, }, - Spec: metering.ReportGenerationQuerySpec{ - Inputs: []metering.ReportGenerationQueryInputDefinition{ + Spec: metering.ReportQuerySpec{ + Inputs: []metering.ReportQueryInputDefinition{ { Name: "ds", Type: "ReportDataSource", @@ -307,7 +307,7 @@ func TestValidateReport(t *testing.T) { } dataSourceGetter := testhelpers.NewReportDataSourceStore([]*metering.ReportDataSource{ds1, ds2}) - queryGetter := testhelpers.NewReportGenerationQueryStore([]*metering.ReportGenerationQuery{testValidQuery, testInvalidQuery, testInvalidQuery2}) + queryGetter := testhelpers.NewReportQueryStore([]*metering.ReportQuery{testValidQuery, testInvalidQuery, testInvalidQuery2}) reportGetter := testhelpers.NewReportStore(nil) dependencyResolver := reporting.NewDependencyResolver(queryGetter, dataSourceGetter, reportGetter) @@ -322,10 +322,10 @@ func TestValidateReport(t *testing.T) { expectErrMsg string }{ { - name: "empty spec.generationQuery returns err", + name: "empty spec.query returns err", report: testhelpers.NewReport(testReportName, testNamespace, "", reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), expectErr: true, - expectErrMsg: "must set spec.generationQuery", + expectErrMsg: "must set spec.query", }, { name: "spec.ReportingStart > spec.ReportingEnd returns err", @@ -340,22 +340,22 @@ func TestValidateReport(t *testing.T) { expectErrMsg: "spec.reportingEnd must be set if report.spec.runImmediately is true", }, { - name: "spec.GenerationQueryName does not exist returns err", + name: "spec.QueryName does not exist returns err", report: testhelpers.NewReport(testReportName, testNamespace, testNonExistentQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, false), expectErr: true, - expectErrMsg: fmt.Sprintf("ReportGenerationQuery (%s) does not exist", testNonExistentQueryName), + expectErrMsg: fmt.Sprintf("ReportQuery (%s) does not exist", testNonExistentQueryName), }, { name: "valid report with missing DataSource returns error", report: testhelpers.NewReport(testReportName, testNamespace, testInvalidQueryName, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, true), expectErr: true, - expectErrMsg: fmt.Sprintf("failed to resolve ReportGenerationQuery dependencies %s: %s", testInvalidQueryName, "ReportDataSource.metering.openshift.io \"this-does-not-exist\" not found"), + expectErrMsg: fmt.Sprintf("failed to resolve ReportQuery dependencies %s: %s", testInvalidQueryName, "ReportDataSource.metering.openshift.io \"this-does-not-exist\" not found"), }, { name: "valid report with uninitalized DataSource returns error", report: testhelpers.NewReport(testReportName, testNamespace, testInvalidQueryName2, reportStart, reportEnd, v1alpha1.ReportStatus{}, nil, true), expectErr: true, - expectErrMsg: fmt.Sprintf("failed to validate ReportGenerationQuery dependencies %s: ReportGenerationQueryDependencyValidationError: uninitialized ReportDataSource dependencies: %s", testInvalidQueryName2, ds2.Name), + expectErrMsg: fmt.Sprintf("failed to validate ReportQuery dependencies %s: ReportQueryDependencyValidationError: uninitialized ReportDataSource dependencies: %s", testInvalidQueryName2, ds2.Name), }, { name: "valid report with valid DataSource returns nil", diff --git a/test/e2e/report_test.go b/test/e2e/report_test.go index 3c3f9b729..bd67a959d 100644 --- a/test/e2e/report_test.go +++ b/test/e2e/report_test.go @@ -35,15 +35,15 @@ func testReportsProduceData(t *testing.T, testFramework *framework.Framework, te t.Parallel() } - genQuery, err := testFramework.GetMeteringReportGenerationQuery(test.queryName) - require.NoError(t, err, "generation query for report should exist") + query, err := testFramework.GetMeteringReportQuery(test.queryName) + require.NoError(t, err, "report query for report should exist") dsGetter := reporting.NewReportDataSourceClientGetter(testFramework.MeteringClient) - queryGetter := reporting.NewReportGenerationQueryClientGetter(testFramework.MeteringClient) + queryGetter := reporting.NewReportQueryClientGetter(testFramework.MeteringClient) reportGetter := reporting.NewReportClientGetter(testFramework.MeteringClient) // get all the datasources for the query used in our report - dependencies, err := reporting.GetGenerationQueryDependencies(queryGetter, dsGetter, reportGetter, genQuery, nil) + dependencies, err := reporting.GetQueryDependencies(queryGetter, dsGetter, reportGetter, query, nil) require.NoError(t, err, "datasources for query should exist") require.NotEqual(t, 0, len(dependencies.ReportDataSources), "Report should have at least 1 datasource dependency") diff --git a/test/framework/report.go b/test/framework/report.go index 312e87283..1f778f45e 100644 --- a/test/framework/report.go +++ b/test/framework/report.go @@ -45,10 +45,10 @@ func (f *Framework) NewSimpleReport(name, queryName string, schedule *meteringv1 Namespace: f.Namespace, }, Spec: meteringv1alpha1.ReportSpec{ - GenerationQueryName: queryName, - Schedule: schedule, - ReportingStart: start, - ReportingEnd: end, + QueryName: queryName, + Schedule: schedule, + ReportingStart: start, + ReportingEnd: end, }, } } diff --git a/test/framework/reportgenerationquery.go b/test/framework/reportquery.go similarity index 59% rename from test/framework/reportgenerationquery.go rename to test/framework/reportquery.go index ec2167328..e5fbd7c24 100644 --- a/test/framework/reportgenerationquery.go +++ b/test/framework/reportquery.go @@ -14,19 +14,19 @@ import ( "github.com/operator-framework/operator-metering/pkg/operator/reporting" ) -func (f *Framework) GetMeteringReportGenerationQuery(name string) (*metering.ReportGenerationQuery, error) { - return f.MeteringClient.ReportGenerationQueries(f.Namespace).Get(name, meta.GetOptions{}) +func (f *Framework) GetMeteringReportQuery(name string) (*metering.ReportQuery, error) { + return f.MeteringClient.ReportQueries(f.Namespace).Get(name, meta.GetOptions{}) } -func (f *Framework) WaitForMeteringReportGenerationQuery(t *testing.T, name string, pollInterval, timeout time.Duration) (*metering.ReportGenerationQuery, error) { +func (f *Framework) WaitForMeteringReportQuery(t *testing.T, name string, pollInterval, timeout time.Duration) (*metering.ReportQuery, error) { t.Helper() - var reportQuery *metering.ReportGenerationQuery + var reportQuery *metering.ReportQuery return reportQuery, wait.PollImmediate(pollInterval, timeout, func() (bool, error) { var err error - reportQuery, err = f.GetMeteringReportGenerationQuery(name) + reportQuery, err = f.GetMeteringReportQuery(name) if err != nil { if errors.IsNotFound(err) { - t.Logf("ReportGenerationQuery %s does not exist yet", name) + t.Logf("ReportQuery %s does not exist yet", name) return false, nil } return false, err @@ -35,13 +35,13 @@ func (f *Framework) WaitForMeteringReportGenerationQuery(t *testing.T, name stri }) } -func (f *Framework) RequireReportGenerationQueriesReady(t *testing.T, queries []string, pollInterval, timeout time.Duration) { +func (f *Framework) RequireReportQueriesReady(t *testing.T, queries []string, pollInterval, timeout time.Duration) { t.Helper() readyReportDataSources := make(map[string]struct{}) readyReportGenQueries := make(map[string]struct{}) reportGetter := reporting.NewReportClientGetter(f.MeteringClient) - queryGetter := reporting.NewReportGenerationQueryClientGetter(f.MeteringClient) + queryGetter := reporting.NewReportQueryClientGetter(f.MeteringClient) dataSourceGetter := reporting.NewReportDataSourceClientGetter(f.MeteringClient) for _, queryName := range queries { @@ -49,9 +49,9 @@ func (f *Framework) RequireReportGenerationQueriesReady(t *testing.T, queries [] continue } - t.Logf("waiting for ReportGenerationQuery %s to exist", queryName) - reportGenQuery, err := f.WaitForMeteringReportGenerationQuery(t, queryName, pollInterval, timeout) - require.NoError(t, err, "ReportGenerationQuery should exist before creating report using it") + t.Logf("waiting for ReportQuery %s to exist", queryName) + reportQuery, err := f.WaitForMeteringReportQuery(t, queryName, pollInterval, timeout) + require.NoError(t, err, "ReportQuery should exist before creating report using it") depHandler := &reporting.UninitialiedDependendenciesHandler{ HandleUninitializedReportDataSource: func(ds *metering.ReportDataSource) { @@ -60,15 +60,15 @@ func (f *Framework) RequireReportGenerationQueriesReady(t *testing.T, queries [] } t.Logf("%s dependencies: waiting for ReportDataSource %s to exist", queryName, ds.Name) _, err := f.WaitForMeteringReportDataSourceTable(t, ds.Name, pollInterval, timeout) - require.NoError(t, err, "ReportDataSource %s table for ReportGenerationQuery %s should exist before running reports against it", ds.Name, queryName) + require.NoError(t, err, "ReportDataSource %s table for ReportQuery %s should exist before running reports against it", ds.Name, queryName) readyReportDataSources[ds.Name] = struct{}{} }, } - t.Logf("waiting for ReportGenerationQuery %s dependencies to become initialized", queryName) + t.Logf("waiting for ReportQuery %s dependencies to become initialized", queryName) // explicitly ignoring results, since we'll get errors above if any of // the uninitialized dependencies don't become ready in the handler - _, _ = reporting.GetAndValidateGenerationQueryDependencies(queryGetter, dataSourceGetter, reportGetter, reportGenQuery, nil, depHandler) + _, _ = reporting.GetAndValidateQueryDependencies(queryGetter, dataSourceGetter, reportGetter, reportQuery, nil, depHandler) readyReportGenQueries[queryName] = struct{}{} } } @@ -76,7 +76,7 @@ func (f *Framework) RequireReportGenerationQueriesReady(t *testing.T, queries [] func (f *Framework) RequireReportDataSourcesForQueryHaveData(t *testing.T, queries []string, collectResp operator.CollectPrometheusMetricsDataResponse) { t.Helper() reportGetter := reporting.NewReportClientGetter(f.MeteringClient) - queryGetter := reporting.NewReportGenerationQueryClientGetter(f.MeteringClient) + queryGetter := reporting.NewReportQueryClientGetter(f.MeteringClient) dataSourceGetter := reporting.NewReportDataSourceClientGetter(f.MeteringClient) metricsImportedForDS := make(map[string]int) @@ -85,10 +85,10 @@ func (f *Framework) RequireReportDataSourcesForQueryHaveData(t *testing.T, queri } for _, queryName := range queries { - query, err := f.GetMeteringReportGenerationQuery(queryName) - require.NoError(t, err, "ReportGenerationQuery should exist") - deps, err := reporting.GetGenerationQueryDependencies(queryGetter, dataSourceGetter, reportGetter, query, nil) - require.NoError(t, err, "Getting ReportGenerationQuery dependencies should succeed") + query, err := f.GetMeteringReportQuery(queryName) + require.NoError(t, err, "ReportQuery should exist") + deps, err := reporting.GetQueryDependencies(queryGetter, dataSourceGetter, reportGetter, query, nil) + require.NoError(t, err, "Getting ReportQuery dependencies should succeed") for _, dataSource := range deps.ReportDataSources { metricsImported := metricsImportedForDS[dataSource.Name] diff --git a/test/integration/main_test.go b/test/integration/main_test.go index e7674a4b4..5fe62b3d8 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -266,10 +266,10 @@ func TestReportingProducesCorrectDataForInput(t *testing.T) { queries = append(queries, test.queryName) } - // validate all ReportGenerationQueries and ReportDataSources that are + // validate all ReportQueries and ReportDataSources that are // used by the test cases are initialized - t.Logf("Waiting for ReportGenerationQueries tables to become ready") - testFramework.RequireReportGenerationQueriesReady(t, queries, time.Second*5, 2*time.Minute) + t.Logf("Waiting for ReportQueries tables to become ready") + testFramework.RequireReportQueriesReady(t, queries, time.Second*5, 2*time.Minute) var reportStart, reportEnd time.Time dataSourcesSubmitted := make(map[string]struct{}) diff --git a/test/integration/testdata/reports/namespace-cpu-request.json b/test/integration/testdata/reports/namespace-cpu-request.json index e6863e094..80b336b87 100755 --- a/test/integration/testdata/reports/namespace-cpu-request.json +++ b/test/integration/testdata/reports/namespace-cpu-request.json @@ -1 +1 @@ -[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":60},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":1095},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":1125},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":975},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":76.50000000000003},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":420},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":975}] \ No newline at end of file +[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":60},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":1095},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":1125},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":975},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":76.50000000000003},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":420},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":975}] diff --git a/test/integration/testdata/reports/namespace-cpu-usage.json b/test/integration/testdata/reports/namespace-cpu-usage.json index de49cc59a..9df3e3bd4 100755 --- a/test/integration/testdata/reports/namespace-cpu-usage.json +++ b/test/integration/testdata/reports/namespace-cpu-usage.json @@ -1 +1 @@ -[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":3.67662},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":107.49593999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":63.1989},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":72.1668},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":8.665560000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":192.96942},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":0.42828},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-infra","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":3.39816},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":62.87208},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":8.546940000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":59.84723999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":4.57116},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":83.66418}] \ No newline at end of file +[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":3.67662},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":107.49593999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":63.1989},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":72.1668},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":8.665560000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":192.96942},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":0.42828},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-infra","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":3.39816},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":62.87208},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":8.546940000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":59.84723999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":4.57116},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_cpu_core_seconds":83.66418}] diff --git a/test/integration/testdata/reports/namespace-memory-request.json b/test/integration/testdata/reports/namespace-memory-request.json index b8149ced7..e6aee6259 100755 --- a/test/integration/testdata/reports/namespace-memory-request.json +++ b/test/integration/testdata/reports/namespace-memory-request.json @@ -1 +1 @@ -[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":161061273600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1548641894400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1768842854400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1234069094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":31457280000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":339738624000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1101004800000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":31457280000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1234069094400}] \ No newline at end of file +[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":161061273600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1548641894400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1768842854400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1234069094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":31457280000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":339738624000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1101004800000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":31457280000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":1234069094400}] diff --git a/test/integration/testdata/reports/namespace-memory-usage.json b/test/integration/testdata/reports/namespace-memory-usage.json index 117300d51..4cdf4d3d3 100755 --- a/test/integration/testdata/reports/namespace-memory-usage.json +++ b/test/integration/testdata/reports/namespace-memory-usage.json @@ -1 +1 @@ -[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":19379404800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":647564328960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":1215916032000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":1583080488960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":9636741120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":1171264880640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":3689840640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-infra","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":11915919360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":2060653608960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":11554897920},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":271598223360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":10582425600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":1037667287040}] \ No newline at end of file +[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":19379404800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":647564328960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":1215916032000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":1583080488960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":9636741120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":1171264880640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":3689840640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-infra","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":11915919360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":2060653608960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":11554897920},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":271598223360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":10582425600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_usage_memory_byte_seconds":1037667287040}] diff --git a/test/integration/testdata/reports/node-cpu-utilization.json b/test/integration/testdata/reports/node-cpu-utilization.json index ac5017713..464fb82ff 100755 --- a/test/integration/testdata/reports/node-cpu-utilization.json +++ b/test/integration/testdata/reports/node-cpu-utilization.json @@ -1 +1 @@ -[{"cpu_unused_percent":0.6912499999999999,"cpu_used_percent":0.30875,"node_allocatable_cpu_core_seconds":15600,"node_allocatable_data_end":"2019-03-18T16:04:00Z","node_allocatable_data_start":"2019-03-18T16:00:00Z","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":4816.5,"pod_usage_data_end":"2019-03-18T16:04:00Z","pod_usage_data_start":"2019-03-18T16:00:00Z"}] \ No newline at end of file +[{"cpu_unused_percent":0.6912499999999999,"cpu_used_percent":0.30875,"node_allocatable_cpu_core_seconds":15600,"node_allocatable_data_end":"2019-03-18T16:04:00Z","node_allocatable_data_start":"2019-03-18T16:00:00Z","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_cpu_core_seconds":4816.5,"pod_usage_data_end":"2019-03-18T16:04:00Z","pod_usage_data_start":"2019-03-18T16:00:00Z"}] diff --git a/test/integration/testdata/reports/node-memory-utilization.json b/test/integration/testdata/reports/node-memory-utilization.json index 26446d3db..a90d2c6cd 100755 --- a/test/integration/testdata/reports/node-memory-utilization.json +++ b/test/integration/testdata/reports/node-memory-utilization.json @@ -1 +1 @@ -[{"memory_unused_percent":0.8776264385468155,"memory_used_percent":0.12237356145318443,"node_allocatable_data_end":"2019-03-18T16:04:00Z","node_allocatable_data_start":"2019-03-18T16:00:00Z","node_allocatable_memory_byte_seconds":61074753945600,"period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":7473935155200,"pod_usage_data_end":"2019-03-18T16:04:00Z","pod_usage_data_start":"2019-03-18T16:00:00Z"}] \ No newline at end of file +[{"memory_unused_percent":0.8776264385468155,"memory_used_percent":0.12237356145318443,"node_allocatable_data_end":"2019-03-18T16:04:00Z","node_allocatable_data_start":"2019-03-18T16:00:00Z","node_allocatable_memory_byte_seconds":61074753945600,"period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod_request_memory_byte_seconds":7473935155200,"pod_usage_data_end":"2019-03-18T16:04:00Z","pod_usage_data_start":"2019-03-18T16:00:00Z"}] diff --git a/test/integration/testdata/reports/persistentvolumeclaim-usage.json b/test/integration/testdata/reports/persistentvolumeclaim-usage.json index def8348bf..cc2cfd8c0 100644 --- a/test/integration/testdata/reports/persistentvolumeclaim-usage.json +++ b/test/integration/testdata/reports/persistentvolumeclaim-usage.json @@ -1 +1 @@ -[{"namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-datanode-data-hdfs-datanode-0","persistentvolumeclaim_usage_bytes":328486912},{"namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-namenode-data-hdfs-namenode-0","persistentvolumeclaim_usage_bytes":157429760},{"namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hive-metastore-db-data","persistentvolumeclaim_usage_bytes":136089600},{"namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-datanode-data-hdfs-datanode-0","persistentvolumeclaim_usage_bytes":7357468672},{"namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-namenode-data-hdfs-namenode-0","persistentvolumeclaim_usage_bytes":5476855808},{"namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hive-metastore-db-data","persistentvolumeclaim_usage_bytes":271421440},{"namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-datanode-data-hdfs-datanode-0","persistentvolumeclaim_usage_bytes":2192658432},{"namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-namenode-data-hdfs-namenode-0","persistentvolumeclaim_usage_bytes":1251983360},{"namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hive-metastore-db-data","persistentvolumeclaim_usage_bytes":141864960},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"alertmanager-main-db-alertmanager-main-0","persistentvolumeclaim_usage_bytes":31477760},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"alertmanager-main-db-alertmanager-main-1","persistentvolumeclaim_usage_bytes":31477760},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"alertmanager-main-db-alertmanager-main-2","persistentvolumeclaim_usage_bytes":31477760},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"prometheus-k8s-db-prometheus-k8s-0","persistentvolumeclaim_usage_bytes":28705996800},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"prometheus-k8s-db-prometheus-k8s-1","persistentvolumeclaim_usage_bytes":27621396480},{"namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-datanode-data-hdfs-datanode-0","persistentvolumeclaim_usage_bytes":2112933888},{"namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-namenode-data-hdfs-namenode-0","persistentvolumeclaim_usage_bytes":1754583040},{"namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hive-metastore-db-data","persistentvolumeclaim_usage_bytes":133898240}] \ No newline at end of file +[{"namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-datanode-data-hdfs-datanode-0","persistentvolumeclaim_usage_bytes":328486912},{"namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-namenode-data-hdfs-namenode-0","persistentvolumeclaim_usage_bytes":157429760},{"namespace":"metering-chancez","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hive-metastore-db-data","persistentvolumeclaim_usage_bytes":136089600},{"namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-datanode-data-hdfs-datanode-0","persistentvolumeclaim_usage_bytes":7357468672},{"namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-namenode-data-hdfs-namenode-0","persistentvolumeclaim_usage_bytes":5476855808},{"namespace":"metering-ci2-openshift-continuous-upgrade-master","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hive-metastore-db-data","persistentvolumeclaim_usage_bytes":271421440},{"namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-datanode-data-hdfs-datanode-0","persistentvolumeclaim_usage_bytes":2192658432},{"namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-namenode-data-hdfs-namenode-0","persistentvolumeclaim_usage_bytes":1251983360},{"namespace":"metering-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hive-metastore-db-data","persistentvolumeclaim_usage_bytes":141864960},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"alertmanager-main-db-alertmanager-main-0","persistentvolumeclaim_usage_bytes":31477760},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"alertmanager-main-db-alertmanager-main-1","persistentvolumeclaim_usage_bytes":31477760},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"alertmanager-main-db-alertmanager-main-2","persistentvolumeclaim_usage_bytes":31477760},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"prometheus-k8s-db-prometheus-k8s-0","persistentvolumeclaim_usage_bytes":28705996800},{"namespace":"openshift-monitoring","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"prometheus-k8s-db-prometheus-k8s-1","persistentvolumeclaim_usage_bytes":27621396480},{"namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-datanode-data-hdfs-datanode-0","persistentvolumeclaim_usage_bytes":2112933888},{"namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hdfs-namenode-data-hdfs-namenode-0","persistentvolumeclaim_usage_bytes":1754583040},{"namespace":"telemeter-tschuy","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","persistentvolumeclaim":"hive-metastore-db-data","persistentvolumeclaim_usage_bytes":133898240}] diff --git a/test/integration/testdata/reports/pod-cpu-request.json b/test/integration/testdata/reports/pod-cpu-request.json index b549a0d59..3835ea4b0 100755 --- a/test/integration/testdata/reports/pod-cpu-request.json +++ b/test/integration/testdata/reports/pod-cpu-request.json @@ -1 +1 @@ -[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-0","pod_request_cpu_core_seconds":1.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-1","pod_request_cpu_core_seconds":1.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-2","pod_request_cpu_core_seconds":1.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"cluster-monitoring-operator-6465f8fbc7-2lhbb","pod_request_cpu_core_seconds":6},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"console-5bcb69f49f-n7bdp","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"docker-registry-1-n92br","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"grafana-6b9f85786f-8g6jt","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_cpu_core_seconds":150},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_cpu_core_seconds":300},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_cpu_core_seconds":150},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_cpu_core_seconds":150},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_cpu_core_seconds":150},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"kube-state-metrics-7449d589bc-rzqnx","pod_request_cpu_core_seconds":6},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-84qdg","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-lcjxl","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-79b4b94ff6-rqjmb","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-7bc76c48b9-xfhhg","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-d4c79cfcc-xdqk4","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-752gp","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-8sf7d","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d27kb","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d7x4z","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-lfftk","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-qfdwc","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-x7pdm","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-29zh8","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-5jdcb","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dfjm8","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dqbk8","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-gdzww","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-rgm6j","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-s9dvq","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-694d4bc86-crs7m","pod_request_cpu_core_seconds":600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7546ddcbd-pn4z6","pod_request_cpu_core_seconds":600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7c7f57955b-tlmrw","pod_request_cpu_core_seconds":600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-b669fb545-hwf4h","pod_request_cpu_core_seconds":600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-0","pod_request_cpu_core_seconds":4.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-1","pod_request_cpu_core_seconds":4.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-598c846dd9-qbfzh","pod_request_cpu_core_seconds":15},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-68c6d4bdb7-7xws6","pod_request_cpu_core_seconds":15},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-755cc859df-z8z7h","pod_request_cpu_core_seconds":15},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-854c4495d9-5htqt","pod_request_cpu_core_seconds":15},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"router-1-9dgxn","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-6q4m8","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-c65vl","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jd7tm","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jf6r5","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-kxzlf","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-npbmk","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-ssnxk","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"webconsole-7df4f9f689-42kpb","pod_request_cpu_core_seconds":30}] \ No newline at end of file +[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-0","pod_request_cpu_core_seconds":1.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-1","pod_request_cpu_core_seconds":1.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-2","pod_request_cpu_core_seconds":1.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"cluster-monitoring-operator-6465f8fbc7-2lhbb","pod_request_cpu_core_seconds":6},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"console-5bcb69f49f-n7bdp","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"docker-registry-1-n92br","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"grafana-6b9f85786f-8g6jt","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_cpu_core_seconds":75},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_cpu_core_seconds":150},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_cpu_core_seconds":300},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_cpu_core_seconds":150},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_cpu_core_seconds":150},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_cpu_core_seconds":150},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"kube-state-metrics-7449d589bc-rzqnx","pod_request_cpu_core_seconds":6},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-84qdg","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-lcjxl","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-79b4b94ff6-rqjmb","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-7bc76c48b9-xfhhg","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-d4c79cfcc-xdqk4","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-752gp","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-8sf7d","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d27kb","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d7x4z","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-lfftk","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-qfdwc","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-x7pdm","pod_request_cpu_core_seconds":3},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-29zh8","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-5jdcb","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dfjm8","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dqbk8","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-gdzww","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-rgm6j","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-s9dvq","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-694d4bc86-crs7m","pod_request_cpu_core_seconds":600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7546ddcbd-pn4z6","pod_request_cpu_core_seconds":600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7c7f57955b-tlmrw","pod_request_cpu_core_seconds":600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-b669fb545-hwf4h","pod_request_cpu_core_seconds":600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-0","pod_request_cpu_core_seconds":4.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-1","pod_request_cpu_core_seconds":4.5},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-598c846dd9-qbfzh","pod_request_cpu_core_seconds":15},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-68c6d4bdb7-7xws6","pod_request_cpu_core_seconds":15},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-755cc859df-z8z7h","pod_request_cpu_core_seconds":15},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-854c4495d9-5htqt","pod_request_cpu_core_seconds":15},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"router-1-9dgxn","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-6q4m8","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-c65vl","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jd7tm","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jf6r5","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-kxzlf","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-npbmk","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-ssnxk","pod_request_cpu_core_seconds":30},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"webconsole-7df4f9f689-42kpb","pod_request_cpu_core_seconds":30}] diff --git a/test/integration/testdata/reports/pod-cpu-usage.json b/test/integration/testdata/reports/pod-cpu-usage.json index 86d528b35..6464f0613 100755 --- a/test/integration/testdata/reports/pod-cpu-usage.json +++ b/test/integration/testdata/reports/pod-cpu-usage.json @@ -1 +1 @@ -[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-0","pod_usage_cpu_core_seconds":2.17842},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-1","pod_usage_cpu_core_seconds":2.3379},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-2","pod_usage_cpu_core_seconds":3.04758},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-infra","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"bootstrap-autoapprover-0","pod_usage_cpu_core_seconds":3.39816},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"cluster-monitoring-operator-6465f8fbc7-2lhbb","pod_usage_cpu_core_seconds":0.8664000000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"console-5bcb69f49f-n7bdp","pod_usage_cpu_core_seconds":0.42828},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"docker-registry-1-n92br","pod_usage_cpu_core_seconds":0.47244},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"grafana-6b9f85786f-8g6jt","pod_usage_cpu_core_seconds":1.45176},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_cpu_core_seconds":1.35642},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_cpu_core_seconds":2.8905000000000003},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_cpu_core_seconds":13.236659999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_cpu_core_seconds":7.241040000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_cpu_core_seconds":1.19454},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_cpu_core_seconds":1.97574},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_cpu_core_seconds":9.955020000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_cpu_core_seconds":5.96238},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_cpu_core_seconds":10.7343},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_cpu_core_seconds":13.59438},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_cpu_core_seconds":14.79636},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_cpu_core_seconds":5.80224},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_cpu_core_seconds":1.9194000000000002},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_cpu_core_seconds":2.88312},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_cpu_core_seconds":3.19146},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_cpu_core_seconds":3.4916400000000003},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"kube-state-metrics-7449d589bc-rzqnx","pod_usage_cpu_core_seconds":2.16036},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-api-metering-ci-3-ig-m-91kw","pod_usage_cpu_core_seconds":51.747659999999996},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-controllers-metering-ci-3-ig-m-91kw","pod_usage_cpu_core_seconds":33.9813},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-etcd-metering-ci-3-ig-m-91kw","pod_usage_cpu_core_seconds":21.76698},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-84qdg","pod_usage_cpu_core_seconds":11.03514},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-lcjxl","pod_usage_cpu_core_seconds":11.81364},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-79b4b94ff6-rqjmb","pod_usage_cpu_core_seconds":12.520620000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-7bc76c48b9-xfhhg","pod_usage_cpu_core_seconds":8.665560000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-d4c79cfcc-xdqk4","pod_usage_cpu_core_seconds":5.1753599999999995},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-752gp","pod_usage_cpu_core_seconds":0.6255000000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-8sf7d","pod_usage_cpu_core_seconds":0.8261999999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d27kb","pod_usage_cpu_core_seconds":0.56268},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d7x4z","pod_usage_cpu_core_seconds":0.53562},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-lfftk","pod_usage_cpu_core_seconds":0.8709},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-qfdwc","pod_usage_cpu_core_seconds":0.63762},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-x7pdm","pod_usage_cpu_core_seconds":0.66246},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-5jdcb","pod_usage_cpu_core_seconds":3.0186},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dfjm8","pod_usage_cpu_core_seconds":4.977},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dqbk8","pod_usage_cpu_core_seconds":4.55826},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-gdzww","pod_usage_cpu_core_seconds":4.00734},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-rgm6j","pod_usage_cpu_core_seconds":5.92908},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-s9dvq","pod_usage_cpu_core_seconds":4.48596},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-694d4bc86-crs7m","pod_usage_cpu_core_seconds":50.8041},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7546ddcbd-pn4z6","pod_usage_cpu_core_seconds":31.11252},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7c7f57955b-tlmrw","pod_usage_cpu_core_seconds":33.1221},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-b669fb545-hwf4h","pod_usage_cpu_core_seconds":131.81184},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-0","pod_usage_cpu_core_seconds":27.278639999999996},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-1","pod_usage_cpu_core_seconds":18.565559999999998},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-operator-6644b8cd54-4jrd4","pod_usage_cpu_core_seconds":0.26448000000000005},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"registry-console-1-klv8c","pod_usage_cpu_core_seconds":0.0519},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-598c846dd9-qbfzh","pod_usage_cpu_core_seconds":5.846579999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-68c6d4bdb7-7xws6","pod_usage_cpu_core_seconds":5.18742},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-755cc859df-z8z7h","pod_usage_cpu_core_seconds":8.16444},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-854c4495d9-5htqt","pod_usage_cpu_core_seconds":5.180339999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"router-1-9dgxn","pod_usage_cpu_core_seconds":3.15228},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-6q4m8","pod_usage_cpu_core_seconds":2.79258},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-c65vl","pod_usage_cpu_core_seconds":5.34528},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jd7tm","pod_usage_cpu_core_seconds":5.275440000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jf6r5","pod_usage_cpu_core_seconds":3.6945},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-kxzlf","pod_usage_cpu_core_seconds":5.650320000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-npbmk","pod_usage_cpu_core_seconds":4.2425999999999995},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-ssnxk","pod_usage_cpu_core_seconds":5.87028},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-6fmfb","pod_usage_cpu_core_seconds":1.77564},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-8xrwm","pod_usage_cpu_core_seconds":1.51986},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-cp5kl","pod_usage_cpu_core_seconds":0.14118000000000003},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-lgkqw","pod_usage_cpu_core_seconds":3.37572},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-nbf7m","pod_usage_cpu_core_seconds":0.12503999999999998},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-nngln","pod_usage_cpu_core_seconds":0},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-rbfkg","pod_usage_cpu_core_seconds":1.6095},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"webconsole-7df4f9f689-42kpb","pod_usage_cpu_core_seconds":4.57116}] \ No newline at end of file +[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-0","pod_usage_cpu_core_seconds":2.17842},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-1","pod_usage_cpu_core_seconds":2.3379},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-2","pod_usage_cpu_core_seconds":3.04758},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-infra","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"bootstrap-autoapprover-0","pod_usage_cpu_core_seconds":3.39816},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"cluster-monitoring-operator-6465f8fbc7-2lhbb","pod_usage_cpu_core_seconds":0.8664000000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"console-5bcb69f49f-n7bdp","pod_usage_cpu_core_seconds":0.42828},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"docker-registry-1-n92br","pod_usage_cpu_core_seconds":0.47244},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"grafana-6b9f85786f-8g6jt","pod_usage_cpu_core_seconds":1.45176},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_cpu_core_seconds":1.35642},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_cpu_core_seconds":2.8905000000000003},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_cpu_core_seconds":13.236659999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_cpu_core_seconds":7.241040000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_cpu_core_seconds":1.19454},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_cpu_core_seconds":1.97574},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_cpu_core_seconds":9.955020000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_cpu_core_seconds":5.96238},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_cpu_core_seconds":10.7343},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_cpu_core_seconds":13.59438},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_cpu_core_seconds":14.79636},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_cpu_core_seconds":5.80224},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_cpu_core_seconds":1.9194000000000002},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_cpu_core_seconds":2.88312},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_cpu_core_seconds":3.19146},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_cpu_core_seconds":3.4916400000000003},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"kube-state-metrics-7449d589bc-rzqnx","pod_usage_cpu_core_seconds":2.16036},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-api-metering-ci-3-ig-m-91kw","pod_usage_cpu_core_seconds":51.747659999999996},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-controllers-metering-ci-3-ig-m-91kw","pod_usage_cpu_core_seconds":33.9813},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-etcd-metering-ci-3-ig-m-91kw","pod_usage_cpu_core_seconds":21.76698},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-84qdg","pod_usage_cpu_core_seconds":11.03514},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-lcjxl","pod_usage_cpu_core_seconds":11.81364},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-79b4b94ff6-rqjmb","pod_usage_cpu_core_seconds":12.520620000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-7bc76c48b9-xfhhg","pod_usage_cpu_core_seconds":8.665560000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-d4c79cfcc-xdqk4","pod_usage_cpu_core_seconds":5.1753599999999995},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-752gp","pod_usage_cpu_core_seconds":0.6255000000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-8sf7d","pod_usage_cpu_core_seconds":0.8261999999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d27kb","pod_usage_cpu_core_seconds":0.56268},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d7x4z","pod_usage_cpu_core_seconds":0.53562},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-lfftk","pod_usage_cpu_core_seconds":0.8709},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-qfdwc","pod_usage_cpu_core_seconds":0.63762},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-x7pdm","pod_usage_cpu_core_seconds":0.66246},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-5jdcb","pod_usage_cpu_core_seconds":3.0186},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dfjm8","pod_usage_cpu_core_seconds":4.977},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dqbk8","pod_usage_cpu_core_seconds":4.55826},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-gdzww","pod_usage_cpu_core_seconds":4.00734},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-rgm6j","pod_usage_cpu_core_seconds":5.92908},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-s9dvq","pod_usage_cpu_core_seconds":4.48596},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-694d4bc86-crs7m","pod_usage_cpu_core_seconds":50.8041},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7546ddcbd-pn4z6","pod_usage_cpu_core_seconds":31.11252},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7c7f57955b-tlmrw","pod_usage_cpu_core_seconds":33.1221},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-b669fb545-hwf4h","pod_usage_cpu_core_seconds":131.81184},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-0","pod_usage_cpu_core_seconds":27.278639999999996},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-1","pod_usage_cpu_core_seconds":18.565559999999998},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-operator-6644b8cd54-4jrd4","pod_usage_cpu_core_seconds":0.26448000000000005},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"registry-console-1-klv8c","pod_usage_cpu_core_seconds":0.0519},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-598c846dd9-qbfzh","pod_usage_cpu_core_seconds":5.846579999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-68c6d4bdb7-7xws6","pod_usage_cpu_core_seconds":5.18742},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-755cc859df-z8z7h","pod_usage_cpu_core_seconds":8.16444},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-854c4495d9-5htqt","pod_usage_cpu_core_seconds":5.180339999999999},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"router-1-9dgxn","pod_usage_cpu_core_seconds":3.15228},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-6q4m8","pod_usage_cpu_core_seconds":2.79258},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-c65vl","pod_usage_cpu_core_seconds":5.34528},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jd7tm","pod_usage_cpu_core_seconds":5.275440000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jf6r5","pod_usage_cpu_core_seconds":3.6945},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-kxzlf","pod_usage_cpu_core_seconds":5.650320000000001},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-npbmk","pod_usage_cpu_core_seconds":4.2425999999999995},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-ssnxk","pod_usage_cpu_core_seconds":5.87028},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-6fmfb","pod_usage_cpu_core_seconds":1.77564},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-8xrwm","pod_usage_cpu_core_seconds":1.51986},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-cp5kl","pod_usage_cpu_core_seconds":0.14118000000000003},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-lgkqw","pod_usage_cpu_core_seconds":3.37572},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-nbf7m","pod_usage_cpu_core_seconds":0.12503999999999998},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-nngln","pod_usage_cpu_core_seconds":0},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-rbfkg","pod_usage_cpu_core_seconds":1.6095},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"webconsole-7df4f9f689-42kpb","pod_usage_cpu_core_seconds":4.57116}] diff --git a/test/integration/testdata/reports/pod-memory-request.json b/test/integration/testdata/reports/pod-memory-request.json index 653fd4a10..0496b7e65 100755 --- a/test/integration/testdata/reports/pod-memory-request.json +++ b/test/integration/testdata/reports/pod-memory-request.json @@ -1 +1 @@ -[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-0","pod_request_memory_byte_seconds":66060288000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-1","pod_request_memory_byte_seconds":66060288000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-2","pod_request_memory_byte_seconds":66060288000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"cluster-monitoring-operator-6465f8fbc7-2lhbb","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"console-5bcb69f49f-n7bdp","pod_request_memory_byte_seconds":31457280000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"docker-registry-1-n92br","pod_request_memory_byte_seconds":80530636800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"grafana-6b9f85786f-8g6jt","pod_request_memory_byte_seconds":31457280000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_memory_byte_seconds":78643200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_memory_byte_seconds":251658240000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_memory_byte_seconds":78643200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_memory_byte_seconds":78643200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_memory_byte_seconds":110100480000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_memory_byte_seconds":204472320000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_memory_byte_seconds":110100480000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_memory_byte_seconds":110100480000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_memory_byte_seconds":204472320000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_memory_byte_seconds":471859200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_memory_byte_seconds":204472320000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_memory_byte_seconds":204472320000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_memory_byte_seconds":471859200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_memory_byte_seconds":157286400000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_memory_byte_seconds":157286400000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_memory_byte_seconds":157286400000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"kube-state-metrics-7449d589bc-rzqnx","pod_request_memory_byte_seconds":12582912000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-84qdg","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-lcjxl","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-79b4b94ff6-rqjmb","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-7bc76c48b9-xfhhg","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-d4c79cfcc-xdqk4","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-752gp","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-8sf7d","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d27kb","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d7x4z","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-lfftk","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-qfdwc","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-x7pdm","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-29zh8","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-5jdcb","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dfjm8","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dqbk8","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-gdzww","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-rgm6j","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-s9dvq","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-694d4bc86-crs7m","pod_request_memory_byte_seconds":644245094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7546ddcbd-pn4z6","pod_request_memory_byte_seconds":644245094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7c7f57955b-tlmrw","pod_request_memory_byte_seconds":644245094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-b669fb545-hwf4h","pod_request_memory_byte_seconds":644245094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-0","pod_request_memory_byte_seconds":18874368000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-1","pod_request_memory_byte_seconds":18874368000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-598c846dd9-qbfzh","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-68c6d4bdb7-7xws6","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-755cc859df-z8z7h","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-854c4495d9-5htqt","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"router-1-9dgxn","pod_request_memory_byte_seconds":80530636800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-6q4m8","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-c65vl","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jd7tm","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jf6r5","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-kxzlf","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-npbmk","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-ssnxk","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"webconsole-7df4f9f689-42kpb","pod_request_memory_byte_seconds":31457280000}] \ No newline at end of file +[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-0","pod_request_memory_byte_seconds":66060288000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-1","pod_request_memory_byte_seconds":66060288000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-2","pod_request_memory_byte_seconds":66060288000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"cluster-monitoring-operator-6465f8fbc7-2lhbb","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"console-5bcb69f49f-n7bdp","pod_request_memory_byte_seconds":31457280000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"docker-registry-1-n92br","pod_request_memory_byte_seconds":80530636800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"grafana-6b9f85786f-8g6jt","pod_request_memory_byte_seconds":31457280000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_memory_byte_seconds":78643200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_memory_byte_seconds":251658240000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_memory_byte_seconds":78643200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_request_memory_byte_seconds":78643200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_memory_byte_seconds":110100480000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_memory_byte_seconds":204472320000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_memory_byte_seconds":110100480000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_request_memory_byte_seconds":110100480000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_memory_byte_seconds":204472320000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_memory_byte_seconds":471859200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_memory_byte_seconds":204472320000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_request_memory_byte_seconds":204472320000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_memory_byte_seconds":471859200000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_memory_byte_seconds":157286400000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_memory_byte_seconds":157286400000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_request_memory_byte_seconds":157286400000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"kube-state-metrics-7449d589bc-rzqnx","pod_request_memory_byte_seconds":12582912000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-84qdg","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-lcjxl","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-79b4b94ff6-rqjmb","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-7bc76c48b9-xfhhg","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-d4c79cfcc-xdqk4","pod_request_memory_byte_seconds":23592960000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-752gp","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-8sf7d","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d27kb","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d7x4z","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-lfftk","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-qfdwc","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-x7pdm","pod_request_memory_byte_seconds":6291456000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-29zh8","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-5jdcb","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dfjm8","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dqbk8","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-gdzww","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-rgm6j","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-s9dvq","pod_request_memory_byte_seconds":94371840000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-694d4bc86-crs7m","pod_request_memory_byte_seconds":644245094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7546ddcbd-pn4z6","pod_request_memory_byte_seconds":644245094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7c7f57955b-tlmrw","pod_request_memory_byte_seconds":644245094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-b669fb545-hwf4h","pod_request_memory_byte_seconds":644245094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-0","pod_request_memory_byte_seconds":18874368000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-1","pod_request_memory_byte_seconds":18874368000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-598c846dd9-qbfzh","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-68c6d4bdb7-7xws6","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-755cc859df-z8z7h","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-854c4495d9-5htqt","pod_request_memory_byte_seconds":15728640000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"router-1-9dgxn","pod_request_memory_byte_seconds":80530636800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-6q4m8","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-c65vl","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jd7tm","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jf6r5","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-kxzlf","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-npbmk","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-ssnxk","pod_request_memory_byte_seconds":62914560000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"webconsole-7df4f9f689-42kpb","pod_request_memory_byte_seconds":31457280000}] diff --git a/test/integration/testdata/reports/pod-memory-usage.json b/test/integration/testdata/reports/pod-memory-usage.json index 0423660cc..71973c946 100755 --- a/test/integration/testdata/reports/pod-memory-usage.json +++ b/test/integration/testdata/reports/pod-memory-usage.json @@ -1 +1 @@ -[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-0","pod_usage_memory_byte_seconds":8695234560},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-1","pod_usage_memory_byte_seconds":9389260800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-2","pod_usage_memory_byte_seconds":10060431360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-infra","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"bootstrap-autoapprover-0","pod_usage_memory_byte_seconds":11915919360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"cluster-monitoring-operator-6465f8fbc7-2lhbb","pod_usage_memory_byte_seconds":10604544000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"console-5bcb69f49f-n7bdp","pod_usage_memory_byte_seconds":3689840640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"docker-registry-1-n92br","pod_usage_memory_byte_seconds":5790105600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"grafana-6b9f85786f-8g6jt","pod_usage_memory_byte_seconds":12290949120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_memory_byte_seconds":77744947200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_memory_byte_seconds":250590412800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_memory_byte_seconds":78105231360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_memory_byte_seconds":78038630400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_memory_byte_seconds":84744192000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_memory_byte_seconds":193209139200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_memory_byte_seconds":109972193280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_memory_byte_seconds":109943685120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_memory_byte_seconds":204315525120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_memory_byte_seconds":392477245440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_memory_byte_seconds":203550228480},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_memory_byte_seconds":193409679360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_memory_byte_seconds":227976806400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_memory_byte_seconds":143128166400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_memory_byte_seconds":106143744000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_memory_byte_seconds":94052352000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"kube-state-metrics-7449d589bc-rzqnx","pod_usage_memory_byte_seconds":21926707200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-api-metering-ci-3-ig-m-91kw","pod_usage_memory_byte_seconds":256341688320},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-controllers-metering-ci-3-ig-m-91kw","pod_usage_memory_byte_seconds":130882437120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-etcd-metering-ci-3-ig-m-91kw","pod_usage_memory_byte_seconds":260340203520},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-84qdg","pod_usage_memory_byte_seconds":17078353920},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-lcjxl","pod_usage_memory_byte_seconds":18819809280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-79b4b94ff6-rqjmb","pod_usage_memory_byte_seconds":19477217280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-7bc76c48b9-xfhhg","pod_usage_memory_byte_seconds":9636741120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-d4c79cfcc-xdqk4","pod_usage_memory_byte_seconds":5976637440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-752gp","pod_usage_memory_byte_seconds":7532544000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-8sf7d","pod_usage_memory_byte_seconds":6586613760},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d27kb","pod_usage_memory_byte_seconds":7335690240},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d7x4z","pod_usage_memory_byte_seconds":9764782080},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-lfftk","pod_usage_memory_byte_seconds":6591283200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-qfdwc","pod_usage_memory_byte_seconds":7529840640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-x7pdm","pod_usage_memory_byte_seconds":7412367360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-29zh8","pod_usage_memory_byte_seconds":0},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-5jdcb","pod_usage_memory_byte_seconds":15592243200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dfjm8","pod_usage_memory_byte_seconds":24895242240},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dqbk8","pod_usage_memory_byte_seconds":24464670720},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-gdzww","pod_usage_memory_byte_seconds":24671109120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-rgm6j","pod_usage_memory_byte_seconds":24715837440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-s9dvq","pod_usage_memory_byte_seconds":24684625920},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-694d4bc86-crs7m","pod_usage_memory_byte_seconds":549407293440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7546ddcbd-pn4z6","pod_usage_memory_byte_seconds":594179112960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7c7f57955b-tlmrw","pod_usage_memory_byte_seconds":574249943040},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-b669fb545-hwf4h","pod_usage_memory_byte_seconds":643965665280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-0","pod_usage_memory_byte_seconds":1056257310720},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-1","pod_usage_memory_byte_seconds":871686881280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-operator-6644b8cd54-4jrd4","pod_usage_memory_byte_seconds":6989168640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"registry-console-1-klv8c","pod_usage_memory_byte_seconds":685670400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-598c846dd9-qbfzh","pod_usage_memory_byte_seconds":9877094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-68c6d4bdb7-7xws6","pod_usage_memory_byte_seconds":6839009280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-755cc859df-z8z7h","pod_usage_memory_byte_seconds":10708008960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-854c4495d9-5htqt","pod_usage_memory_byte_seconds":9948364800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"router-1-9dgxn","pod_usage_memory_byte_seconds":12903628800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-6q4m8","pod_usage_memory_byte_seconds":15163637760},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-c65vl","pod_usage_memory_byte_seconds":20470087680},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jd7tm","pod_usage_memory_byte_seconds":18460508160},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jf6r5","pod_usage_memory_byte_seconds":20558807040},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-kxzlf","pod_usage_memory_byte_seconds":19038289920},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-npbmk","pod_usage_memory_byte_seconds":19833077760},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-ssnxk","pod_usage_memory_byte_seconds":19050086400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-6fmfb","pod_usage_memory_byte_seconds":604569600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-8xrwm","pod_usage_memory_byte_seconds":625213440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-cp5kl","pod_usage_memory_byte_seconds":8514355200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-lgkqw","pod_usage_memory_byte_seconds":610713600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-nbf7m","pod_usage_memory_byte_seconds":600883200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-nngln","pod_usage_memory_byte_seconds":0},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-rbfkg","pod_usage_memory_byte_seconds":599162880},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"webconsole-7df4f9f689-42kpb","pod_usage_memory_byte_seconds":10582425600}] \ No newline at end of file +[{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-0","pod_usage_memory_byte_seconds":8695234560},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-1","pod_usage_memory_byte_seconds":9389260800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"alertmanager-main-2","pod_usage_memory_byte_seconds":10060431360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-infra","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"bootstrap-autoapprover-0","pod_usage_memory_byte_seconds":11915919360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"cluster-monitoring-operator-6465f8fbc7-2lhbb","pod_usage_memory_byte_seconds":10604544000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"console-5bcb69f49f-n7bdp","pod_usage_memory_byte_seconds":3689840640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"docker-registry-1-n92br","pod_usage_memory_byte_seconds":5790105600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"grafana-6b9f85786f-8g6jt","pod_usage_memory_byte_seconds":12290949120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_memory_byte_seconds":77744947200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_memory_byte_seconds":250590412800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_memory_byte_seconds":78105231360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-datanode-0","pod_usage_memory_byte_seconds":78038630400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_memory_byte_seconds":84744192000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_memory_byte_seconds":193209139200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_memory_byte_seconds":109972193280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hdfs-namenode-0","pod_usage_memory_byte_seconds":109943685120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_memory_byte_seconds":204315525120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_memory_byte_seconds":392477245440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_memory_byte_seconds":203550228480},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-metastore-0","pod_usage_memory_byte_seconds":193409679360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_memory_byte_seconds":227976806400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_memory_byte_seconds":143128166400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_memory_byte_seconds":106143744000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"hive-server-0","pod_usage_memory_byte_seconds":94052352000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"kube-state-metrics-7449d589bc-rzqnx","pod_usage_memory_byte_seconds":21926707200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-api-metering-ci-3-ig-m-91kw","pod_usage_memory_byte_seconds":256341688320},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-controllers-metering-ci-3-ig-m-91kw","pod_usage_memory_byte_seconds":130882437120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"kube-system","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"master-etcd-metering-ci-3-ig-m-91kw","pod_usage_memory_byte_seconds":260340203520},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-84qdg","pod_usage_memory_byte_seconds":17078353920},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-78db69b6bc-lcjxl","pod_usage_memory_byte_seconds":18819809280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-79b4b94ff6-rqjmb","pod_usage_memory_byte_seconds":19477217280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-emoss","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-7bc76c48b9-xfhhg","pod_usage_memory_byte_seconds":9636741120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"metering-operator-d4c79cfcc-xdqk4","pod_usage_memory_byte_seconds":5976637440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-752gp","pod_usage_memory_byte_seconds":7532544000},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-8sf7d","pod_usage_memory_byte_seconds":6586613760},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d27kb","pod_usage_memory_byte_seconds":7335690240},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-d7x4z","pod_usage_memory_byte_seconds":9764782080},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-lfftk","pod_usage_memory_byte_seconds":6591283200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-qfdwc","pod_usage_memory_byte_seconds":7529840640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"node-exporter-x7pdm","pod_usage_memory_byte_seconds":7412367360},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-29zh8","pod_usage_memory_byte_seconds":0},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-5jdcb","pod_usage_memory_byte_seconds":15592243200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dfjm8","pod_usage_memory_byte_seconds":24895242240},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-dqbk8","pod_usage_memory_byte_seconds":24464670720},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-gdzww","pod_usage_memory_byte_seconds":24671109120},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-rgm6j","pod_usage_memory_byte_seconds":24715837440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"ovs-s9dvq","pod_usage_memory_byte_seconds":24684625920},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-694d4bc86-crs7m","pod_usage_memory_byte_seconds":549407293440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7546ddcbd-pn4z6","pod_usage_memory_byte_seconds":594179112960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-7c7f57955b-tlmrw","pod_usage_memory_byte_seconds":574249943040},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"presto-coordinator-b669fb545-hwf4h","pod_usage_memory_byte_seconds":643965665280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-0","pod_usage_memory_byte_seconds":1056257310720},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-k8s-1","pod_usage_memory_byte_seconds":871686881280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-monitoring","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"prometheus-operator-6644b8cd54-4jrd4","pod_usage_memory_byte_seconds":6989168640},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"registry-console-1-klv8c","pod_usage_memory_byte_seconds":685670400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-chancez","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-598c846dd9-qbfzh","pod_usage_memory_byte_seconds":9877094400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"telemeter-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-68c6d4bdb7-7xws6","pod_usage_memory_byte_seconds":6839009280},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-tschuy","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-755cc859df-z8z7h","pod_usage_memory_byte_seconds":10708008960},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"metering-ci2-openshift-continuous-upgrade-master","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"reporting-operator-854c4495d9-5htqt","pod_usage_memory_byte_seconds":9948364800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"default","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"router-1-9dgxn","pod_usage_memory_byte_seconds":12903628800},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-6q4m8","pod_usage_memory_byte_seconds":15163637760},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-c65vl","pod_usage_memory_byte_seconds":20470087680},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jd7tm","pod_usage_memory_byte_seconds":18460508160},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-jf6r5","pod_usage_memory_byte_seconds":20558807040},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-kxzlf","pod_usage_memory_byte_seconds":19038289920},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-npbmk","pod_usage_memory_byte_seconds":19833077760},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-sdn","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sdn-ssnxk","pod_usage_memory_byte_seconds":19050086400},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-8p04","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-6fmfb","pod_usage_memory_byte_seconds":604569600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-g0s3","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-8xrwm","pod_usage_memory_byte_seconds":625213440},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-cp5kl","pod_usage_memory_byte_seconds":8514355200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-mvz5","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-lgkqw","pod_usage_memory_byte_seconds":610713600},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-kgpx","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-nbf7m","pod_usage_memory_byte_seconds":600883200},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-qq08","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-nngln","pod_usage_memory_byte_seconds":0},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-node","node":"metering-ci-3-ig-n-dkdn","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"sync-rbfkg","pod_usage_memory_byte_seconds":599162880},{"data_end":"2019-03-18T16:04:00Z","data_start":"2019-03-18T16:00:00Z","namespace":"openshift-web-console","node":"metering-ci-3-ig-m-91kw","period_end":"2019-03-18T16:05:00Z","period_start":"2019-03-18T16:00:00Z","pod":"webconsole-7df4f9f689-42kpb","pod_usage_memory_byte_seconds":10582425600}] diff --git a/test/testhelpers/helpers.go b/test/testhelpers/helpers.go index a653e87d3..d41780d28 100644 --- a/test/testhelpers/helpers.go +++ b/test/testhelpers/helpers.go @@ -26,23 +26,23 @@ func NewReport(name, namespace, testQueryName string, reportStart, reportEnd *ti Namespace: namespace, }, Spec: v1alpha1.ReportSpec{ - GenerationQueryName: testQueryName, - ReportingStart: start, - ReportingEnd: end, - Schedule: schedule, - RunImmediately: runImmediately, + QueryName: testQueryName, + ReportingStart: start, + ReportingEnd: end, + Schedule: schedule, + RunImmediately: runImmediately, }, Status: status, } } -func NewReportGenerationQuery(name, namespace string, columns []v1alpha1.ReportGenerationQueryColumn) *v1alpha1.ReportGenerationQuery { - return &v1alpha1.ReportGenerationQuery{ +func NewReportQuery(name, namespace string, columns []v1alpha1.ReportQueryColumn) *v1alpha1.ReportQuery { + return &v1alpha1.ReportQuery{ ObjectMeta: meta.ObjectMeta{ Name: name, Namespace: namespace, }, - Spec: v1alpha1.ReportGenerationQuerySpec{ + Spec: v1alpha1.ReportQuerySpec{ Columns: columns, }, } @@ -89,24 +89,24 @@ func (store *ReportDataSourceStore) GetReportDataSource(namespace, name string) return nil, errors.NewNotFound(v1alpha1.Resource("ReportDataSource"), name) } -type ReportGenerationQueryStore struct { - queries map[string]*v1alpha1.ReportGenerationQuery +type ReportQueryStore struct { + queries map[string]*v1alpha1.ReportQuery } -func NewReportGenerationQueryStore(queries []*v1alpha1.ReportGenerationQuery) (store *ReportGenerationQueryStore) { - m := make(map[string]*v1alpha1.ReportGenerationQuery) +func NewReportQueryStore(queries []*v1alpha1.ReportQuery) (store *ReportQueryStore) { + m := make(map[string]*v1alpha1.ReportQuery) for _, query := range queries { m[query.Namespace+"/"+query.Name] = query } - return &ReportGenerationQueryStore{m} + return &ReportQueryStore{m} } -func (store *ReportGenerationQueryStore) GetReportGenerationQuery(namespace, name string) (*v1alpha1.ReportGenerationQuery, error) { +func (store *ReportQueryStore) GetReportQuery(namespace, name string) (*v1alpha1.ReportQuery, error) { query, ok := store.queries[namespace+"/"+name] if ok { return query, nil } - return nil, errors.NewNotFound(v1alpha1.Resource("ReportGenerationQuery"), name) + return nil, errors.NewNotFound(v1alpha1.Resource("ReportQuery"), name) } type ReportStore struct {