-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics.go
142 lines (128 loc) · 4.11 KB
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
//
// Copyright 2019 Insolar Technologies GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package executor
import (
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
)
var (
// StatRequestsOpened specifies a metric about opened requests for the current light
StatRequestsOpened = stats.Int64(
"requests_opened",
"How many requests are opened",
stats.UnitDimensionless,
)
// StatRequestsClosed specifies a metric about closed requests for the current light
StatRequestsClosed = stats.Int64(
"requests_closed",
"How many requests are closed",
stats.UnitDimensionless,
)
statHotObjectsTotal = stats.Int64("hotdata_objects_total", "Amount of hot records prepared to send for next executors", stats.UnitDimensionless)
statHotObjectsSend = stats.Int64("hotdata_objects_send", "Amount of hot records actually sent to next executors", stats.UnitDimensionless)
statJets = stats.Int64("jets", "jets counter", stats.UnitDimensionless)
statJetSplits = stats.Int64("jet_splits", "jet splits counter", stats.UnitDimensionless)
statDrop = stats.Int64("drops", "How many drop records have created", stats.UnitDimensionless)
statDropRecords = stats.Int64("drop_records", "Amount of records in drop", stats.UnitDimensionless)
statLastReplicatedPulse = stats.Int64(
"light_last_sent_pulse",
"last pulse sent to heavy",
stats.UnitDimensionless,
)
statFilamentLength = stats.Int64(
"filament_length",
"How many records are in filaments during iterations",
stats.UnitDimensionless,
)
statFilamentFetchedCount = stats.Int64(
"filament_fetched_count",
"How many records are in fetched from network filament segment",
stats.UnitDimensionless,
)
)
func init() {
err := view.Register(
&view.View{
Name: StatRequestsOpened.Name(),
Description: StatRequestsOpened.Description(),
Measure: StatRequestsOpened,
Aggregation: view.Sum(),
},
&view.View{
Name: StatRequestsClosed.Name(),
Description: StatRequestsClosed.Description(),
Measure: StatRequestsClosed,
Aggregation: view.Sum(),
},
&view.View{
Name: statHotObjectsTotal.Name(),
Description: statHotObjectsTotal.Description(),
Measure: statHotObjectsTotal,
Aggregation: view.Sum(),
},
&view.View{
Name: statHotObjectsSend.Name(),
Description: statHotObjectsSend.Description(),
Measure: statHotObjectsSend,
Aggregation: view.Sum(),
},
&view.View{
Name: "jets_counter",
Description: "how many jets on start of pulse",
Measure: statJets,
Aggregation: view.LastValue(),
},
&view.View{
Name: "jet_splits_total",
Description: "how many jet splits performed",
Measure: statJetSplits,
Aggregation: view.Sum(),
},
&view.View{
Name: "drops_total",
Description: statDrop.Description(),
Measure: statDrop,
Aggregation: view.Sum(),
},
&view.View{
Name: "drop_records_total",
Description: statDropRecords.Description(),
Measure: statDropRecords,
Aggregation: view.Sum(),
},
&view.View{
Name: statLastReplicatedPulse.Name(),
Description: statLastReplicatedPulse.Description(),
Measure: statLastReplicatedPulse,
Aggregation: view.LastValue(),
},
&view.View{
Name: statFilamentLength.Name(),
Description: statFilamentLength.Description(),
Measure: statFilamentLength,
Aggregation: view.Sum(),
},
&view.View{
Name: statFilamentFetchedCount.Name(),
Description: statFilamentFetchedCount.Description(),
Measure: statFilamentFetchedCount,
Aggregation: view.Sum(),
},
)
if err != nil {
panic(err)
}
}