Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
dd09ece8
Commit
dd09ece8
authored
Sep 24, 2018
by
Axel Pirek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make max open, max idle connections and connection max life time configurable
parent
e35f06b9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
2 deletions
+60
-2
pkg/tsdb/sql_engine.go
+6
-2
public/app/plugins/datasource/mssql/partials/config.html
+18
-0
public/app/plugins/datasource/mysql/partials/config.html
+18
-0
public/app/plugins/datasource/postgres/partials/config.html
+18
-0
No files found.
pkg/tsdb/sql_engine.go
View file @
dd09ece8
...
...
@@ -98,8 +98,12 @@ var NewSqlQueryEndpoint = func(config *SqlQueryEndpointConfiguration, rowTransfo
return
nil
,
err
}
engine
.
SetMaxOpenConns
(
10
)
engine
.
SetMaxIdleConns
(
10
)
maxOpenConns
:=
config
.
Datasource
.
JsonData
.
Get
(
"maxOpenConns"
)
.
MustInt
(
0
)
engine
.
SetMaxOpenConns
(
maxOpenConns
)
maxIdleConns
:=
config
.
Datasource
.
JsonData
.
Get
(
"maxIdleConns"
)
.
MustInt
(
2
)
engine
.
SetMaxIdleConns
(
maxIdleConns
)
connMaxLifetime
:=
config
.
Datasource
.
JsonData
.
Get
(
"connMaxLifetime"
)
.
MustInt
(
14400
)
engine
.
SetConnMaxLifetime
(
time
.
Duration
(
connMaxLifetime
)
*
time
.
Second
)
engineCache
.
versions
[
config
.
Datasource
.
Id
]
=
config
.
Datasource
.
Version
engineCache
.
cache
[
config
.
Datasource
.
Id
]
=
engine
...
...
public/app/plugins/datasource/mssql/partials/config.html
View file @
dd09ece8
...
...
@@ -29,6 +29,24 @@
</div>
</div>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-11"
>
Max open connections
</span>
<input
type=
"number"
min=
"0"
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.maxOpenConns"
placeholder=
"unlimited"
></input>
</div>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-11"
>
Max idle connections
</span>
<input
type=
"number"
min=
"0"
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.maxIdleConns"
placeholder=
"2"
></input>
</div>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-11"
>
Connection lifetime
</span>
<input
type=
"number"
min=
"0"
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.connMaxLifetime"
placeholder=
"14400"
></input>
<info-popover
mode=
"right-absolute"
>
The connection lifetime in seconds.
</info-popover>
</div>
</div>
<h3
class=
"page-heading"
>
MSSQL details
</h3>
<div
class=
"gf-form-group"
>
...
...
public/app/plugins/datasource/mysql/partials/config.html
View file @
dd09ece8
...
...
@@ -24,6 +24,24 @@
</div>
</div>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-11"
>
Max open connections
</span>
<input
type=
"number"
min=
"0"
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.maxOpenConns"
placeholder=
"unlimited"
></input>
</div>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-11"
>
Max idle connections
</span>
<input
type=
"number"
min=
"0"
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.maxIdleConns"
placeholder=
"2"
></input>
</div>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-11"
>
Connection lifetime
</span>
<input
type=
"number"
min=
"0"
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.connMaxLifetime"
placeholder=
"14400"
></input>
<info-popover
mode=
"right-absolute"
>
The connection lifetime in seconds.
</info-popover>
</div>
</div>
<h3
class=
"page-heading"
>
MySQL details
</h3>
<div
class=
"gf-form-group"
>
...
...
public/app/plugins/datasource/postgres/partials/config.html
View file @
dd09ece8
...
...
@@ -38,6 +38,24 @@
</div>
</div>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-11"
>
Max open connections
</span>
<input
type=
"number"
min=
"0"
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.maxOpenConns"
placeholder=
"unlimited"
></input>
</div>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-11"
>
Max idle connections
</span>
<input
type=
"number"
min=
"0"
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.maxIdleConns"
placeholder=
"2"
></input>
</div>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-11"
>
Connection lifetime
</span>
<input
type=
"number"
min=
"0"
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.connMaxLifetime"
placeholder=
"14400"
></input>
<info-popover
mode=
"right-absolute"
>
The connection lifetime in seconds.
</info-popover>
</div>
</div>
<h3
class=
"page-heading"
>
PostgreSQL details
</h3>
<div
class=
"gf-form-group"
>
...
...
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