Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100099,6 +100099,12 @@ components:
$ref: "#/components/schemas/ComponentRecommendation"
executor:
$ref: "#/components/schemas/ComponentRecommendation"
matched_params:
description: |-
Only returned by the v2 endpoint. The job parameters whose values the recommendation was matched on, as `parameter=value` pairs joined by `|`.
An empty string means the service-wide (coarse) recommendation was used.
example: "detailed_metrics=false|Region=US1"
type: string
required: [driver, executor]
type: object
RecommendationData:
Expand Down Expand Up @@ -100132,7 +100138,7 @@ components:
RecommendationV2RequestAttributes:
description: |-
Attributes for requesting SPA recommendations by forwarding a Spark job's raw arguments
instead of a precomputed shard.
instead of a pre-computed shard.
properties:
arguments:
description: |-
Expand All @@ -100148,7 +100154,7 @@ components:
RecommendationV2RequestBody:
description: |-
Request body for retrieving SPA recommendations by forwarding a Spark job's raw arguments
instead of a precomputed shard.
instead of a pre-computed shard.
properties:
data:
$ref: "#/components/schemas/RecommendationV2RequestData"
Expand Down Expand Up @@ -230935,6 +230941,7 @@ paths:
heap: 3072
memory: 4096
overhead: 1024
matched_params: "detailed_metrics=false"
id: "dedupeactivecontexts:adp_dedupeactivecontexts_org2"
type: recommendation
schema:
Expand Down
38 changes: 37 additions & 1 deletion api/datadogV2/model_recommendation_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ type RecommendationAttributes struct {
Driver ComponentRecommendation `json:"driver"`
// Resource recommendation for a single Spark component (driver or executor). Contains estimation data used to patch Spark job specs.
Executor ComponentRecommendation `json:"executor"`
// Only returned by the v2 endpoint. The job parameters whose values the recommendation was matched on, as `parameter=value` pairs joined by `|`.
// An empty string means the service-wide (coarse) recommendation was used.
MatchedParams *string `json:"matched_params,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
Expand Down Expand Up @@ -116,6 +119,34 @@ func (o *RecommendationAttributes) SetExecutor(v ComponentRecommendation) {
o.Executor = v
}

// GetMatchedParams returns the MatchedParams field value if set, zero value otherwise.
func (o *RecommendationAttributes) GetMatchedParams() string {
if o == nil || o.MatchedParams == nil {
var ret string
return ret
}
return *o.MatchedParams
}

// GetMatchedParamsOk returns a tuple with the MatchedParams field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecommendationAttributes) GetMatchedParamsOk() (*string, bool) {
if o == nil || o.MatchedParams == nil {
return nil, false
}
return o.MatchedParams, true
}

// HasMatchedParams returns a boolean if a field has been set.
func (o *RecommendationAttributes) HasMatchedParams() bool {
return o != nil && o.MatchedParams != nil
}

// SetMatchedParams gets a reference to the given string and assigns it to the MatchedParams field.
func (o *RecommendationAttributes) SetMatchedParams(v string) {
o.MatchedParams = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o RecommendationAttributes) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
Expand All @@ -127,6 +158,9 @@ func (o RecommendationAttributes) MarshalJSON() ([]byte, error) {
}
toSerialize["driver"] = o.Driver
toSerialize["executor"] = o.Executor
if o.MatchedParams != nil {
toSerialize["matched_params"] = o.MatchedParams
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
Expand All @@ -140,6 +174,7 @@ func (o *RecommendationAttributes) UnmarshalJSON(bytes []byte) (err error) {
ConfidenceLevel *float64 `json:"confidence_level,omitempty"`
Driver *ComponentRecommendation `json:"driver"`
Executor *ComponentRecommendation `json:"executor"`
MatchedParams *string `json:"matched_params,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand All @@ -152,7 +187,7 @@ func (o *RecommendationAttributes) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"confidence_level", "driver", "executor"})
datadog.DeleteKeys(additionalProperties, &[]string{"confidence_level", "driver", "executor", "matched_params"})
} else {
return err
}
Expand All @@ -167,6 +202,7 @@ func (o *RecommendationAttributes) UnmarshalJSON(bytes []byte) (err error) {
hasInvalidField = true
}
o.Executor = *all.Executor
o.MatchedParams = all.MatchedParams

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// RecommendationV2RequestAttributes Attributes for requesting SPA recommendations by forwarding a Spark job's raw arguments
// instead of a precomputed shard.
// instead of a pre-computed shard.
type RecommendationV2RequestAttributes struct {
// Raw, unfiltered Spark job arguments as submitted (for example, `--org_id=2`).
// SPA determines which arguments are relevant for the given service.
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/model_recommendation_v2_request_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// RecommendationV2RequestBody Request body for retrieving SPA recommendations by forwarding a Spark job's raw arguments
// instead of a precomputed shard.
// instead of a pre-computed shard.
type RecommendationV2RequestBody struct {
// JSON:API resource object for the SPA v2 recommendation request.
Data RecommendationV2RequestData `json:"data"`
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/model_recommendation_v2_request_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// RecommendationV2RequestData JSON:API resource object for the SPA v2 recommendation request.
type RecommendationV2RequestData struct {
// Attributes for requesting SPA recommendations by forwarding a Spark job's raw arguments
// instead of a precomputed shard.
// instead of a pre-computed shard.
Attributes RecommendationV2RequestAttributes `json:"attributes"`
// JSON:API resource type for the SPA v2 recommendation request.
Type RecommendationV2RequestType `json:"type"`
Expand Down
Loading