Skip to content

Commit

Permalink
CIRC-4040: Fix types used to contain find tags results
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaifley committed Aug 27, 2019
1 parent 8803651 commit bbb75da
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
17 changes: 17 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ to [Semantic Versioning](http://semver.org/) rules.

## [Next Release]

## [v1.3.2] - 2019-08-26

### Changed

- The integer size of the activity data and account ID data in the FindTagsItem
structure returned by calls to FindTags() have been changed from `int32` to
`int64`. As has the type of the account ID parameter in calls to FindTags().
- The integer size in the rollup values returned by calls to GetNodeState() have
been changed from `uint32` to `uint64`.

### Fixed

- Bug (severe): It is possible for some types of IRONdb data to deserialize into
values that overflow the 32-bit variables used to hold them. Created: 2019-07-01
Fixed: 2019-08-27.

## [v1.3.1] - 2019-08-26

### Changed
Expand Down Expand Up @@ -83,6 +99,7 @@ writing to histogram endpoints.
any delay, once started. Created: 2019-03-12. Fixed: 2019-03-13.

[Next Release]: https://github.com/circonus-labs/gosnowth
[v1.3.2]: https://github.com/circonus-labs/gosnowth/releases/tag/v1.3.2
[v1.3.1]: https://github.com/circonus-labs/gosnowth/releases/tag/v1.3.1
[v1.2.1]: https://github.com/circonus-labs/gosnowth/releases/tag/v1.2.1
[v1.2.0]: https://github.com/circonus-labs/gosnowth/releases/tag/v1.2.0
Expand Down
4 changes: 2 additions & 2 deletions state.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type NodeState struct {
// Rollup values represent node state rollups.
type Rollup struct {
RollupEntries
RollupList []uint32 `json:"rollups"`
RollupList []uint64 `json:"rollups"`
Aggregate RollupDetails `json:"aggregate"`
}

Expand All @@ -80,7 +80,7 @@ func (r *Rollup) UnmarshalJSON(b []byte) error {

if rollups, ok := m["rollups"].([]interface{}); ok {
for _, v := range rollups {
r.RollupList = append(r.RollupList, uint32(v.(float64)))
r.RollupList = append(r.RollupList, uint64(v.(float64)))
delete(m, "rollup")
}
}
Expand Down
8 changes: 4 additions & 4 deletions tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type FindTagsItem struct {
MetricName string `json:"metric_name"`
Category string `json:"category"`
Type string `type:"type"`
AccountID int32 `json:"account_id"`
Activity [][]int32 `json:"activity,omitempty"`
AccountID int64 `json:"account_id"`
Activity [][]int64 `json:"activity,omitempty"`
}

// FindTagsResult values contain the results of a find tags request.
Expand All @@ -28,15 +28,15 @@ type FindTagsResult struct {
}

// FindTags retrieves metrics that are associated with the provided tag query.
func (sc *SnowthClient) FindTags(node *SnowthNode, accountID int32,
func (sc *SnowthClient) FindTags(node *SnowthNode, accountID int64,
query string, start, end string) (*FindTagsResult, error) {
return sc.FindTagsContext(context.Background(), node, accountID, query,
start, end)
}

// FindTagsContext is the context aware version of FindTags.
func (sc *SnowthClient) FindTagsContext(ctx context.Context, node *SnowthNode,
accountID int32, query string, start, end string) (*FindTagsResult, error) {
accountID int64, query string, start, end string) (*FindTagsResult, error) {
u := fmt.Sprintf("%s?query=%s",
sc.getURL(node, fmt.Sprintf("/find/%d/tags", accountID)),
url.QueryEscape(query))
Expand Down

0 comments on commit bbb75da

Please sign in to comment.