master
go 65 lines 2.16 KB
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 package logstash
4
5 // https://www.elastic.co/guide/en/logstash/current/node-stats-api.html
6
7 type nodeStats struct {
8 JVM jvmStats `json:"jvm" stm:"jvm"`
9 Process processStats `json:"process" stm:"process"`
10 Event eventsStats `json:"event" stm:"event"`
11 Pipelines map[string]pipelineStats `json:"pipelines" stm:"pipelines"`
12 }
13
14 type pipelineStats struct {
15 Event eventsStats `json:"events" stm:"event"`
16 }
17
18 type eventsStats struct {
19 In int `json:"in" stm:"in"`
20 Filtered int `json:"filtered" stm:"filtered"`
21 Out int `json:"out" stm:"out"`
22 DurationInMillis int `json:"duration_in_millis" stm:"duration_in_millis"`
23 QueuePushDurationInMillis int `json:"queue_push_duration_in_millis" stm:"queue_push_duration_in_millis"`
24 }
25
26 type processStats struct {
27 OpenFileDescriptors int `json:"open_file_descriptors" stm:"open_file_descriptors"`
28 }
29
30 type jvmStats struct {
31 Threads struct {
32 Count int `stm:"count"`
33 } `stm:"threads"`
34 Mem jvmMemStats `stm:"mem"`
35 GC jvmGCStats `stm:"gc"`
36 UptimeInMillis int `json:"uptime_in_millis" stm:"uptime_in_millis"`
37 }
38
39 type jvmMemStats struct {
40 HeapUsedPercent int `json:"heap_used_percent" stm:"heap_used_percent"`
41 HeapCommittedInBytes int `json:"heap_committed_in_bytes" stm:"heap_committed_in_bytes"`
42 HeapUsedInBytes int `json:"heap_used_in_bytes" stm:"heap_used_in_bytes"`
43 Pools struct {
44 Survivor jvmPoolStats `stm:"survivor"`
45 Old jvmPoolStats `stm:"old"`
46 Young jvmPoolStats `stm:"eden"`
47 } `stm:"pools"`
48 }
49
50 type jvmPoolStats struct {
51 UsedInBytes int `json:"used_in_bytes" stm:"used_in_bytes"`
52 CommittedInBytes int `json:"committed_in_bytes" stm:"committed_in_bytes"`
53 }
54
55 type jvmGCStats struct {
56 Collectors struct {
57 Old gcCollectorStats `stm:"old"`
58 Young gcCollectorStats `stm:"eden"`
59 } `stm:"collectors"`
60 }
61
62 type gcCollectorStats struct {
63 CollectionTimeInMillis int `json:"collection_time_in_millis" stm:"collection_time_in_millis"`
64 CollectionCount int `json:"collection_count" stm:"collection_count"`
65 }