Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
0edaad69
Unverified
Commit
0edaad69
authored
Apr 10, 2023
by
inphi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add input_bytes counter
parent
1ce50bb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
metrics.go
op-batcher/metrics/metrics.go
+7
-1
No files found.
op-batcher/metrics/metrics.go
View file @
0edaad69
...
@@ -64,6 +64,7 @@ type Metrics struct {
...
@@ -64,6 +64,7 @@ type Metrics struct {
ChannelClosedReason
prometheus
.
Gauge
ChannelClosedReason
prometheus
.
Gauge
ChannelNumFrames
prometheus
.
Gauge
ChannelNumFrames
prometheus
.
Gauge
ChannelComprRatio
prometheus
.
Histogram
ChannelComprRatio
prometheus
.
Histogram
ChannelInputBytesTotal
prometheus
.
Counter
ChannelOutputBytesTotal
prometheus
.
Counter
ChannelOutputBytesTotal
prometheus
.
Counter
BatcherTxEvs
opmetrics
.
EventVec
BatcherTxEvs
opmetrics
.
EventVec
...
@@ -145,6 +146,11 @@ func NewMetrics(procName string) *Metrics {
...
@@ -145,6 +146,11 @@ func NewMetrics(procName string) *Metrics {
Help
:
"Compression ratios of closed channel."
,
Help
:
"Compression ratios of closed channel."
,
Buckets
:
append
([]
float64
{
0.1
,
0.2
},
prometheus
.
LinearBuckets
(
0.3
,
0.05
,
14
)
...
),
Buckets
:
append
([]
float64
{
0.1
,
0.2
},
prometheus
.
LinearBuckets
(
0.3
,
0.05
,
14
)
...
),
}),
}),
ChannelInputBytesTotal
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
ns
,
Name
:
"input_bytes_total"
,
Help
:
"Total number of bytes to a channel."
,
}),
ChannelOutputBytesTotal
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
ChannelOutputBytesTotal
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
ns
,
Namespace
:
ns
,
Name
:
"output_bytes_total"
,
Name
:
"output_bytes_total"
,
...
@@ -225,7 +231,7 @@ func (m *Metrics) RecordChannelClosed(id derive.ChannelID, numPendingBlocks int,
...
@@ -225,7 +231,7 @@ func (m *Metrics) RecordChannelClosed(id derive.ChannelID, numPendingBlocks int,
m
.
ChannelNumFrames
.
Set
(
float64
(
numFrames
))
m
.
ChannelNumFrames
.
Set
(
float64
(
numFrames
))
m
.
ChannelInputBytes
.
WithLabelValues
(
StageClosed
)
.
Set
(
float64
(
inputBytes
))
m
.
ChannelInputBytes
.
WithLabelValues
(
StageClosed
)
.
Set
(
float64
(
inputBytes
))
m
.
ChannelOutputBytes
.
Set
(
float64
(
outputComprBytes
))
m
.
ChannelOutputBytes
.
Set
(
float64
(
outputComprBytes
))
m
.
ChannelInputBytesTotal
.
Add
(
float64
(
inputBytes
))
m
.
ChannelOutputBytesTotal
.
Add
(
float64
(
outputComprBytes
))
m
.
ChannelOutputBytesTotal
.
Add
(
float64
(
outputComprBytes
))
var
comprRatio
float64
var
comprRatio
float64
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment