-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we need the JSON marshaling?
policy/staged_policy_test.go
Outdated
false, | ||
[]Policy{ | ||
NewPolicy(NewStoragePolicy(10*time.Second, xtime.Second, 6*time.Hour), DefaultAggregationID), | ||
NewPolicy(NewStoragePolicy(time.Minute, xtime.Minute, 24*time.Hour), mustCompress(Lower, Upper)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do mustCompress(Count, Mean) to avoid having to change Lower and Upper to Min and Max later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, sounds good.
|
||
// stagedPoliciesJSON is used for marshaling and unmarshaling staged policies. | ||
type stagedPoliciesJSON struct { | ||
CutoverNanos int64 `json:"cutoverNanos"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just define the json properties in the original StagedPolicies struct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately JSON marshaler doesn't marshal the unexported field policies
in staged policies.
@cw9 To persist policies list in our index. |
As discussed offline, we also need to store version of the policiesList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once unit test is updated
cc @cw9 @prateek @jeromefroe
This PR adds logic to perform JSON marshalling/unmarshaling of a list of policies.