1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/serverless-metering-reports.adoc
abrennan b919193344 Updating code blocks to guideline format for OPC 4.3
Conflicts:
	modules/serverless-creating-broker.adoc
	modules/serverless-rn-1-6-0.adoc
2020-09-02 12:38:26 -05:00

57 lines
1.5 KiB
Plaintext

// Module included in the following assemblies:
// serverless-metering.adoc
[id="reports-metering-serverless_{context}"]
= Metering reports for Knative Serving
You can run metering reports against Knative Serving by creating `Report` resources.
Before you run a report, you must modify the input parameter within the `Report` resource to specify the start and end dates of the reporting period.
.YAML file
[source,yaml]
----
apiVersion: metering.openshift.io/v1
kind: Report
metadata:
name: knative-service-cpu-usage
spec:
reportingStart: '2019-06-01T00:00:00Z' <1>
reportingEnd: '2019-06-30T23:59:59Z' <2>
query: knative-service-cpu-usage <3>
runImmediately: true
----
<1> Start date of the report, in ISO 8601 format.
<2> End date of the report, in ISO 8601 format.
<3> Either `knative-service-cpu-usage` for CPU usage report or `knative-service-memory-usage` for a memory usage report.
[id="reports-metering-serverless-run_{context}"]
== Running a metering report
. Run the report by entering the following command:
+
[source,terminal]
----
$ oc apply -f <report-name>.yml
----
. You can then check the report by entering the following command:
+
[source,terminal]
----
$ oc get report
----
+
.Example output
+
[source,terminal]
----
NAME QUERY SCHEDULE RUNNING FAILED LAST REPORT TIME AGE
knative-service-cpu-usage knative-service-cpu-usage Finished 2019-06-30T23:59:59Z 10h
----