checker: adopt unified ReportContext reporter signature
Follow the checker-sdk-go interface consolidation: reporter methods now take sdk.ReportContext and read the payload via ctx.Data() instead of the raw json.RawMessage parameter. Backed by the same underlying logic.
This commit is contained in:
parent
1b4b9fc231
commit
e610b72381
1 changed files with 2 additions and 2 deletions
|
|
@ -44,9 +44,9 @@ func (p *dummyProvider) Definition() *sdk.CheckerDefinition {
|
|||
// ExtractMetrics implements sdk.CheckerMetricsReporter.
|
||||
// This is called when happyDomain (or the /report endpoint) needs to turn
|
||||
// raw observation data into time-series metrics for graphing.
|
||||
func (p *dummyProvider) ExtractMetrics(raw json.RawMessage, collectedAt time.Time) ([]sdk.CheckMetric, error) {
|
||||
func (p *dummyProvider) ExtractMetrics(ctx sdk.ReportContext, collectedAt time.Time) ([]sdk.CheckMetric, error) {
|
||||
var data DummyData
|
||||
if err := json.Unmarshal(raw, &data); err != nil {
|
||||
if err := json.Unmarshal(ctx.Data(), &data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue