{
  "description": "WorkloadProfile represents accumulated operational history for a workload identity tuple.\nUsers never create or modify these; the operator owns them entirely.",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "status": {
      "description": "Status is the observed state. No spec \u2014 operator-managed.",
      "properties": {
        "activeWorkloads": {
          "description": "ActiveWorkloads is the count of workloads currently contributing to this profile.",
          "format": "int32",
          "type": "integer"
        },
        "conditions": {
          "description": "Conditions reflect the current state of the profile.",
          "items": {
            "description": "Condition contains details for one aspect of the current state of this API Resource.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.",
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array",
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "containers": {
          "description": "Containers holds per-container usage statistics and recommendations.",
          "items": {
            "description": "ContainerProfile holds usage statistics and recommendations for a single container.",
            "properties": {
              "name": {
                "description": "Name is the container name.",
                "type": "string"
              },
              "recommendations": {
                "additionalProperties": {
                  "description": "ResourceRecommendation holds the recommended request and limit for a resource.",
                  "properties": {
                    "limit": {
                      "description": "Limit is the recommended resource limit value.",
                      "type": "string"
                    },
                    "request": {
                      "description": "Request is the recommended resource request value.",
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "description": "Recommendations holds the cached recommended resource values.",
                "type": "object"
              },
              "usageStats": {
                "description": "UsageStats holds raw aggregated usage data per resource per source.",
                "items": {
                  "description": "ContainerUsageStats holds aggregated usage statistics for one resource from one source.",
                  "properties": {
                    "cv": {
                      "description": "CV is the coefficient of variation (stddev/mean).",
                      "type": "string"
                    },
                    "lastUpdated": {
                      "description": "LastUpdated is when this stats block was last refreshed.",
                      "format": "date-time",
                      "type": "string"
                    },
                    "mean": {
                      "description": "Mean is the mean observed usage.",
                      "type": "string"
                    },
                    "p50": {
                      "description": "P50 is the 50th percentile of observed usage.",
                      "type": "string"
                    },
                    "p75": {
                      "description": "P75 is the 75th percentile of observed usage.",
                      "type": "string"
                    },
                    "p90": {
                      "description": "P90 is the 90th percentile of observed usage.",
                      "type": "string"
                    },
                    "p95": {
                      "description": "P95 is the 95th percentile of observed usage.",
                      "type": "string"
                    },
                    "p99": {
                      "description": "P99 is the 99th percentile of observed usage.",
                      "type": "string"
                    },
                    "resource": {
                      "description": "Resource is the Kubernetes resource name (e.g. \"cpu\", \"memory\").",
                      "type": "string"
                    },
                    "samples": {
                      "description": "Samples is the number of data points in the window.",
                      "format": "int64",
                      "type": "integer"
                    },
                    "source": {
                      "description": "Source is the MetricsSource name that produced these stats.",
                      "type": "string"
                    },
                    "stdDev": {
                      "description": "StdDev is the standard deviation of observed usage.",
                      "type": "string"
                    },
                    "timeSpan": {
                      "description": "TimeSpan is the duration covered by the samples.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "resource",
                    "source"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "type": "array"
              }
            },
            "required": [
              "name"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "measurementHash": {
          "description": "MeasurementHash identifies the Redis key namespace this profile owns. It\ncovers both TupleLabels and PolicyRef, so profiles that share a tuple but\nresolve to different policies keep separate sample series and the profile\nfinalizer can purge its own keys without reference counting.\n\nRecorded here rather than recomputed on demand so that the collector's\nwrites and the finalizer's purge can never disagree about which keys belong\nto this profile.",
          "type": "string"
        },
        "meetsThreshold": {
          "description": "MeetsThreshold is true when the profile has sufficient history to act on.",
          "type": "boolean"
        },
        "policyRef": {
          "description": "PolicyRef identifies the policy governing this profile, or is unset when no\npolicy currently matches (the metrics collector then has nothing to\nmeasure with and skips the profile).\n\nThe governing policy is part of a profile's identity, not merely an\nobservation about it: the policy chooses the metrics sources, the poll\ncadence, the tracked resources, the aggregation, and the headroom behind\none set of recommendations. Pods that resolve to different policies\ntherefore belong to different profiles. The workloadwatcher resolves policy\nper pod (the only place with a pod's namespace, labels, annotations, and\nowner kind) and records the result here; the metrics collector and resource\nadjuster read it rather than resolving again, so all three agree by\nconstruction.",
          "properties": {
            "kind": {
              "description": "Kind is the referenced policy's kind.",
              "enum": [
                "ClusterResourcePolicy",
                "ResourcePolicy"
              ],
              "type": "string"
            },
            "name": {
              "description": "Name is the policy object's name.",
              "type": "string"
            },
            "namespace": {
              "description": "Namespace is the policy's namespace, empty for a ClusterResourcePolicy.",
              "type": "string"
            }
          },
          "required": [
            "kind",
            "name"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "selectorLabels": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "SelectorLabels are used to query pods from the metrics API.\nKeys absent from the originating pod carry the sentinel value \"--missing--\",\nwhich the metrics plugin translates to a Kubernetes \"!key\" (does-not-exist)\nrequirement. This prevents a profile for \"name=nginx, no-component\" from\naccidentally collecting metrics from \"name=nginx, component=server\" pods.",
          "type": "object"
        },
        "state": {
          "default": "Accruing",
          "description": "State is the human-readable form of MeetsThreshold for kubectl output:\nAccruing until the profile has sufficient history, then Sufficient.\nMaintained by the metrics collector alongside MeetsThreshold; the API\nserver defaults it to Accruing so a profile the collector has not yet\nvisited (or that matches no policy) never shows an empty column. Distinct\nfrom the Ready condition, which reflects collection health, not history\nsufficiency.",
          "enum": [
            "Accruing",
            "Sufficient"
          ],
          "type": "string"
        },
        "tupleLabels": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "TupleLabels are the identity labels that define this profile.",
          "type": "object"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
