make sure data is persisted to DB.

pull/228/head
Jason Kulatunga 3 years ago
parent 80f4660130
commit bd19230cbf

@ -446,11 +446,3 @@ func (sr *scrutinyRepository) GetSummary(ctx context.Context) (map[string]*model
return summaries, nil
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Process Thresholds
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
func (sr *scrutinyRepository) ProcessSmartAttributeThresholds() {
}

@ -42,6 +42,12 @@ func (sa *SmartAtaAttribute) Flatten() map[string]interface{} {
fmt.Sprintf("attr.%s.raw_value", idString): sa.RawValue,
fmt.Sprintf("attr.%s.raw_string", idString): sa.RawString,
fmt.Sprintf("attr.%s.when_failed", idString): sa.WhenFailed,
//Generated Data
fmt.Sprintf("attr.%s.transformed_value", idString): sa.TransformedValue,
fmt.Sprintf("attr.%s.status", idString): sa.Status,
fmt.Sprintf("attr.%s.status_reason", idString): sa.StatusReason,
fmt.Sprintf("attr.%s.failure_rate", idString): sa.FailureRate,
}
}
func (sa *SmartAtaAttribute) Inflate(key string, val interface{}) {
@ -70,6 +76,17 @@ func (sa *SmartAtaAttribute) Inflate(key string, val interface{}) {
sa.RawString = val.(string)
case "when_failed":
sa.WhenFailed = val.(string)
//generated
case "transformed_value":
sa.TransformedValue = val.(int64)
case "status":
sa.Status = val.(string)
case "status_reason":
sa.StatusReason = val.(string)
case "failure_rate":
sa.FailureRate = val.(float64)
}
}

@ -29,6 +29,12 @@ func (sa *SmartNvmeAttribute) Flatten() map[string]interface{} {
fmt.Sprintf("attr.%s.name", sa.AttributeId): sa.Name,
fmt.Sprintf("attr.%s.value", sa.AttributeId): sa.Value,
fmt.Sprintf("attr.%s.thresh", sa.AttributeId): sa.Threshold,
//Generated Data
fmt.Sprintf("attr.%s.transformed_value", sa.AttributeId): sa.TransformedValue,
fmt.Sprintf("attr.%s.status", sa.AttributeId): sa.Status,
fmt.Sprintf("attr.%s.status_reason", sa.AttributeId): sa.StatusReason,
fmt.Sprintf("attr.%s.failure_rate", sa.AttributeId): sa.FailureRate,
}
}
func (sa *SmartNvmeAttribute) Inflate(key string, val interface{}) {
@ -47,6 +53,16 @@ func (sa *SmartNvmeAttribute) Inflate(key string, val interface{}) {
sa.Value = val.(int64)
case "thresh":
sa.Threshold = val.(int64)
//generated
case "transformed_value":
sa.TransformedValue = val.(int64)
case "status":
sa.Status = val.(string)
case "status_reason":
sa.StatusReason = val.(string)
case "failure_rate":
sa.FailureRate = val.(float64)
}
}

@ -29,6 +29,12 @@ func (sa *SmartScsiAttribute) Flatten() map[string]interface{} {
fmt.Sprintf("attr.%s.name", sa.AttributeId): sa.Name,
fmt.Sprintf("attr.%s.value", sa.AttributeId): sa.Value,
fmt.Sprintf("attr.%s.thresh", sa.AttributeId): sa.Threshold,
//Generated Data
fmt.Sprintf("attr.%s.transformed_value", sa.AttributeId): sa.TransformedValue,
fmt.Sprintf("attr.%s.status", sa.AttributeId): sa.Status,
fmt.Sprintf("attr.%s.status_reason", sa.AttributeId): sa.StatusReason,
fmt.Sprintf("attr.%s.failure_rate", sa.AttributeId): sa.FailureRate,
}
}
func (sa *SmartScsiAttribute) Inflate(key string, val interface{}) {
@ -47,6 +53,16 @@ func (sa *SmartScsiAttribute) Inflate(key string, val interface{}) {
sa.Value = val.(int64)
case "thresh":
sa.Threshold = val.(int64)
//generated
case "transformed_value":
sa.TransformedValue = val.(int64)
case "status":
sa.Status = val.(string)
case "status_reason":
sa.StatusReason = val.(string)
case "failure_rate":
sa.FailureRate = val.(float64)
}
}

Loading…
Cancel
Save