Drop CollectedAt from the example DummyData

This commit is contained in:
nemunaire 2026-05-20 13:43:57 +08:00
commit 780fbdd57d

View file

@ -133,7 +133,6 @@ const ObservationKeyDummy = "dummy"
type DummyData struct { type DummyData struct {
Message string `json:"message"` Message string `json:"message"`
Score float64 `json:"score"` Score float64 `json:"score"`
CollectedAt time.Time `json:"collected_at"`
} }
``` ```
@ -197,7 +196,6 @@ func (p *dummyProvider) Collect(ctx context.Context, opts CheckerOptions) (any,
return &DummyData{ return &DummyData{
Message: message, Message: message,
Score: score, Score: score,
CollectedAt: time.Now(),
}, nil }, nil
} }
``` ```
@ -525,7 +523,6 @@ Response:
"data": { "data": {
"message": "Testing my checker!", "message": "Testing my checker!",
"score": 73.2, "score": 73.2,
"collected_at": "2026-01-15T10:30:00Z"
} }
} }
``` ```
@ -537,7 +534,7 @@ curl -X POST http://localhost:8080/evaluate \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"observations": { "observations": {
"dummy": "{\"message\":\"test\",\"score\":42.5,\"collected_at\":\"2026-01-15T10:30:00Z\"}" "dummy": "{\"message\":\"test\",\"score\":42.5}"
}, },
"options": { "options": {
"warningThreshold": 50, "warningThreshold": 50,
@ -570,7 +567,7 @@ Status codes: `1` = OK, `3` = Warning, `4` = Critical.
curl -X POST http://localhost:8080/report \ curl -X POST http://localhost:8080/report \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"data": "{\"message\":\"test\",\"score\":73.2,\"collected_at\":\"2026-01-15T10:30:00Z\"}" "data": "{\"message\":\"test\",\"score\":73.2}"
}' }'
``` ```