Skip to content

Commit

Permalink
Fix not enough big integers used for parsing memory (kuskoman#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuskoman authored Feb 27, 2024
1 parent 76b4104 commit 119ace0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions fetcher/responses/__snapshots__/nodestats_response_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ responses.NodeStatsResponse{
Pipeline: responses.PipelineResponse{Workers:16, BatchSize:125, BatchDelay:50},
Jvm: responses.JvmResponse{
Threads: struct { Count int "json:\"count\""; PeakCount int "json:\"peak_count\"" }{Count:60, PeakCount:60},
Mem: struct { HeapUsedPercent int "json:\"heap_used_percent\""; HeapCommittedInBytes int "json:\"heap_committed_in_bytes\""; HeapMaxInBytes int "json:\"heap_max_in_bytes\""; HeapUsedInBytes int "json:\"heap_used_in_bytes\""; NonHeapUsedInBytes int "json:\"non_heap_used_in_bytes\""; NonHeapCommittedInBytes int "json:\"non_heap_committed_in_bytes\""; Pools struct { Young struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" } "json:\"young\""; Old struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" } "json:\"old\""; Survivor struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" } "json:\"survivor\"" } "json:\"pools\"" }{
Mem: struct { HeapUsedPercent int "json:\"heap_used_percent\""; HeapCommittedInBytes int64 "json:\"heap_committed_in_bytes\""; HeapMaxInBytes int64 "json:\"heap_max_in_bytes\""; HeapUsedInBytes int64 "json:\"heap_used_in_bytes\""; NonHeapUsedInBytes int64 "json:\"non_heap_used_in_bytes\""; NonHeapCommittedInBytes int64 "json:\"non_heap_committed_in_bytes\""; Pools struct { Young struct { PeakMaxInBytes int64 "json:\"peak_max_in_bytes\""; MaxInBytes int64 "json:\"max_in_bytes\""; CommittedInBytes int64 "json:\"committed_in_bytes\""; PeakUsedInBytes int64 "json:\"peak_used_in_bytes\""; UsedInBytes int64 "json:\"used_in_bytes\"" } "json:\"young\""; Old struct { PeakMaxInBytes int64 "json:\"peak_max_in_bytes\""; MaxInBytes int64 "json:\"max_in_bytes\""; CommittedInBytes int64 "json:\"committed_in_bytes\""; PeakUsedInBytes int64 "json:\"peak_used_in_bytes\""; UsedInBytes int64 "json:\"used_in_bytes\"" } "json:\"old\""; Survivor struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" } "json:\"survivor\"" } "json:\"pools\"" }{
HeapUsedPercent: 27,
HeapCommittedInBytes: 1073741824,
HeapCommittedInBytes: 17179869184,
HeapMaxInBytes: 1073741822,
HeapUsedInBytes: 294044784,
NonHeapUsedInBytes: 147703688,
NonHeapCommittedInBytes: 155189248,
Pools: struct { Young struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" } "json:\"young\""; Old struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" } "json:\"old\""; Survivor struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" } "json:\"survivor\"" }{
Young: struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" }{PeakMaxInBytes:-1, MaxInBytes:-1, CommittedInBytes:346030080, PeakUsedInBytes:326107136, UsedInBytes:180355072},
Old: struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" }{PeakMaxInBytes:1073741824, MaxInBytes:1073741824, CommittedInBytes:687865856, PeakUsedInBytes:73986560, UsedInBytes:73986560},
Pools: struct { Young struct { PeakMaxInBytes int64 "json:\"peak_max_in_bytes\""; MaxInBytes int64 "json:\"max_in_bytes\""; CommittedInBytes int64 "json:\"committed_in_bytes\""; PeakUsedInBytes int64 "json:\"peak_used_in_bytes\""; UsedInBytes int64 "json:\"used_in_bytes\"" } "json:\"young\""; Old struct { PeakMaxInBytes int64 "json:\"peak_max_in_bytes\""; MaxInBytes int64 "json:\"max_in_bytes\""; CommittedInBytes int64 "json:\"committed_in_bytes\""; PeakUsedInBytes int64 "json:\"peak_used_in_bytes\""; UsedInBytes int64 "json:\"used_in_bytes\"" } "json:\"old\""; Survivor struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" } "json:\"survivor\"" }{
Young: struct { PeakMaxInBytes int64 "json:\"peak_max_in_bytes\""; MaxInBytes int64 "json:\"max_in_bytes\""; CommittedInBytes int64 "json:\"committed_in_bytes\""; PeakUsedInBytes int64 "json:\"peak_used_in_bytes\""; UsedInBytes int64 "json:\"used_in_bytes\"" }{PeakMaxInBytes:-1, MaxInBytes:-1, CommittedInBytes:346030080, PeakUsedInBytes:326107136, UsedInBytes:180355072},
Old: struct { PeakMaxInBytes int64 "json:\"peak_max_in_bytes\""; MaxInBytes int64 "json:\"max_in_bytes\""; CommittedInBytes int64 "json:\"committed_in_bytes\""; PeakUsedInBytes int64 "json:\"peak_used_in_bytes\""; UsedInBytes int64 "json:\"used_in_bytes\"" }{PeakMaxInBytes:1073741824, MaxInBytes:1073741824, CommittedInBytes:687865856, PeakUsedInBytes:73986560, UsedInBytes:73986560},
Survivor: struct { PeakMaxInBytes int "json:\"peak_max_in_bytes\""; MaxInBytes int "json:\"max_in_bytes\""; CommittedInBytes int "json:\"committed_in_bytes\""; PeakUsedInBytes int "json:\"peak_used_in_bytes\""; UsedInBytes int "json:\"used_in_bytes\"" }{PeakMaxInBytes:-1, MaxInBytes:-1, CommittedInBytes:39845888, PeakUsedInBytes:39703152, UsedInBytes:39703152},
},
},
Expand Down
32 changes: 16 additions & 16 deletions fetcher/responses/nodestats_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ type JvmResponse struct {
PeakCount int `json:"peak_count"`
} `json:"threads"`
Mem struct {
HeapUsedPercent int `json:"heap_used_percent"`
HeapCommittedInBytes int `json:"heap_committed_in_bytes"`
HeapMaxInBytes int `json:"heap_max_in_bytes"`
HeapUsedInBytes int `json:"heap_used_in_bytes"`
NonHeapUsedInBytes int `json:"non_heap_used_in_bytes"`
NonHeapCommittedInBytes int `json:"non_heap_committed_in_bytes"`
HeapUsedPercent int `json:"heap_used_percent"`
HeapCommittedInBytes int64 `json:"heap_committed_in_bytes"`
HeapMaxInBytes int64 `json:"heap_max_in_bytes"`
HeapUsedInBytes int64 `json:"heap_used_in_bytes"`
NonHeapUsedInBytes int64 `json:"non_heap_used_in_bytes"`
NonHeapCommittedInBytes int64 `json:"non_heap_committed_in_bytes"`
Pools struct {
Young struct {
PeakMaxInBytes int `json:"peak_max_in_bytes"`
MaxInBytes int `json:"max_in_bytes"`
CommittedInBytes int `json:"committed_in_bytes"`
PeakUsedInBytes int `json:"peak_used_in_bytes"`
UsedInBytes int `json:"used_in_bytes"`
PeakMaxInBytes int64 `json:"peak_max_in_bytes"`
MaxInBytes int64 `json:"max_in_bytes"`
CommittedInBytes int64 `json:"committed_in_bytes"`
PeakUsedInBytes int64 `json:"peak_used_in_bytes"`
UsedInBytes int64 `json:"used_in_bytes"`
} `json:"young"`
Old struct {
PeakMaxInBytes int `json:"peak_max_in_bytes"`
MaxInBytes int `json:"max_in_bytes"`
CommittedInBytes int `json:"committed_in_bytes"`
PeakUsedInBytes int `json:"peak_used_in_bytes"`
UsedInBytes int `json:"used_in_bytes"`
PeakMaxInBytes int64 `json:"peak_max_in_bytes"`
MaxInBytes int64 `json:"max_in_bytes"`
CommittedInBytes int64 `json:"committed_in_bytes"`
PeakUsedInBytes int64 `json:"peak_used_in_bytes"`
UsedInBytes int64 `json:"used_in_bytes"`
} `json:"old"`
Survivor struct {
PeakMaxInBytes int `json:"peak_max_in_bytes"`
Expand Down
2 changes: 1 addition & 1 deletion fixtures/node_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"mem": {
"heap_used_percent": 27,
"heap_committed_in_bytes": 1073741824,
"heap_committed_in_bytes": 17179869184,
"heap_max_in_bytes": 1073741822,
"heap_used_in_bytes": 294044784,
"non_heap_used_in_bytes": 147703688,
Expand Down

0 comments on commit 119ace0

Please sign in to comment.