Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladimir Barsukov
zdb
Commits
8666da65
Commit
8666da65
authored
May 22, 2023
by
Vladimir Barsukov
Browse files
fix
parent
c140f0f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
pool.go
View file @
8666da65
...
...
@@ -50,7 +50,7 @@ func New() *Pool {
Continues
:
[]
string
{
"connect"
,
"EOF"
,
"conflict with recovery"
},
ContinuesTry
:
[]
string
{
"conflict with recovery"
},
TryOnError
:
1
,
TryOnSleep
:
time
.
Second
*
5
,
TryOnSleep
:
time
.
Second
,
}
}
...
...
@@ -267,7 +267,7 @@ func (d *Pool) Start() {
d
.
srvMaster
.
Alive
=
d
.
ping
(
d
.
srvMaster
)
==
nil
time
.
Sleep
(
time
.
Second
*
1
)
time
.
Sleep
(
time
.
Second
)
}
}()
}
...
...
stats.go
View file @
8666da65
...
...
@@ -33,11 +33,12 @@ func (d *Pool) StatPool() []*Stat {
for
_
,
q
:=
range
append
(
d
.
srvSlaves
,
d
.
srvSlavesAsync
...
)
{
out
=
append
(
out
,
d
.
stat
(
q
))
}
return
out
return
append
(
out
,
d
.
stat
(
d
.
srvMaster
))
}
func
(
d
*
Pool
)
StatPoolTotal
()
*
Stat
{
m
:=
d
.
Stat
Master
()
m
:=
&
Stat
{
Id
:
"pool"
,
Mode
:
connModePool
}
for
_
,
s
:=
range
d
.
StatPool
()
{
m
.
AcquireCount
+=
s
.
AcquireCount
...
...
@@ -54,12 +55,7 @@ func (d *Pool) StatPoolTotal() *Stat {
m
.
MaxIdleDestroyCount
+=
s
.
MaxIdleDestroyCount
}
m
.
Id
=
"pool"
m
.
Mode
=
connModePool
m
.
Host
=
""
m
.
Port
=
0
return
d
.
stat
(
d
.
srvMaster
)
return
m
}
func
(
d
*
Pool
)
stat
(
q
*
conn
)
*
Stat
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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