Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
5b8ae788
Commit
5b8ae788
authored
Feb 15, 2019
by
Elad
Committed by
Viktor Trón
Feb 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swarm/storage: fix influxdb gc metrics report (#19102)
parent
7f6b05aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
ldbstore.go
swarm/storage/ldbstore.go
+3
-5
No files found.
swarm/storage/ldbstore.go
View file @
5b8ae788
...
...
@@ -317,7 +317,6 @@ func decodeData(addr Address, data []byte) (*chunk, error) {
}
func
(
s
*
LDBStore
)
collectGarbage
()
error
{
// prevent duplicate gc from starting when one is already running
select
{
case
<-
s
.
gc
.
runC
:
...
...
@@ -335,7 +334,6 @@ func (s *LDBStore) collectGarbage() error {
s
.
startGC
(
int
(
entryCnt
))
log
.
Debug
(
"collectGarbage"
,
"target"
,
s
.
gc
.
target
,
"entryCnt"
,
entryCnt
)
var
totalDeleted
int
for
s
.
gc
.
count
<
s
.
gc
.
target
{
it
:=
s
.
db
.
NewIterator
()
ok
:=
it
.
Seek
([]
byte
{
keyGCIdx
})
...
...
@@ -371,15 +369,15 @@ func (s *LDBStore) collectGarbage() error {
}
s
.
writeBatch
(
s
.
gc
.
batch
,
wEntryCnt
)
log
.
Trace
(
"garbage collect batch done"
,
"batch"
,
singleIterationCount
,
"total"
,
s
.
gc
.
count
)
s
.
lock
.
Unlock
()
it
.
Release
()
log
.
Trace
(
"garbage collect batch done"
,
"batch"
,
singleIterationCount
,
"total"
,
s
.
gc
.
count
)
}
s
.
gc
.
runC
<-
struct
{}{}
metrics
.
GetOrRegisterCounter
(
"ldbstore.collectgarbage.delete"
,
nil
)
.
Inc
(
int64
(
s
.
gc
.
count
))
log
.
Debug
(
"garbage collect done"
,
"c"
,
s
.
gc
.
count
)
s
.
gc
.
runC
<-
struct
{}{}
metrics
.
GetOrRegisterCounter
(
"ldbstore.collectgarbage.delete"
,
nil
)
.
Inc
(
int64
(
totalDeleted
))
return
nil
}
...
...
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