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
6b1ae1a8
Commit
6b1ae1a8
authored
Sep 06, 2017
by
bergquist
Committed by
Carl Bergquist
Sep 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use internal init for settings
parent
dd9d4ecf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
pkg/cmd/grafana-server/server.go
+1
-2
pkg/metrics/graphitebridge/graphite.go
+0
-6
pkg/metrics/init.go
+8
-2
No files found.
pkg/cmd/grafana-server/server.go
View file @
6b1ae1a8
...
...
@@ -54,8 +54,7 @@ func (g *GrafanaServerImpl) Start() {
g
.
writePIDFile
()
initSql
()
metricsCfg
:=
metrics
.
ReadSettings
(
setting
.
Cfg
)
metrics
.
Init
(
metricsCfg
)
metrics
.
Init
(
setting
.
Cfg
)
search
.
Init
()
login
.
Init
()
social
.
NewOAuthService
()
...
...
pkg/metrics/graphitebridge/graphite.go
View file @
6b1ae1a8
...
...
@@ -360,12 +360,6 @@ func (b *Bridge) replaceCounterWithDelta(mf *dto.MetricFamily, metric model.Metr
}
return
float64
(
value
)
//println("use delta for", metric[model.MetricNameLabel], mf.GetType().String())
//TODO(bergquist): turn _count in summery into delta
//TODO(bergquist): turn _count in histogram into delta
}
func
(
b
*
Bridge
)
returnDelta
(
metric
model
.
Metric
,
value
model
.
SampleValue
)
float64
{
...
...
pkg/metrics/
publish
.go
→
pkg/metrics/
init
.go
View file @
6b1ae1a8
...
...
@@ -3,12 +3,13 @@ package metrics
import
(
"context"
ini
"gopkg.in/ini.v1"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/metrics/graphitebridge"
)
var
metricsLogger
log
.
Logger
=
log
.
New
(
"metrics"
)
var
metricPublishCounter
int64
=
0
type
logWrapper
struct
{
logger
log
.
Logger
...
...
@@ -18,7 +19,12 @@ func (lw *logWrapper) Println(v ...interface{}) {
lw
.
logger
.
Info
(
"graphite metric bridge"
,
v
...
)
}
func
Init
(
settings
*
MetricSettings
)
{
func
Init
(
file
*
ini
.
File
)
{
cfg
:=
ReadSettings
(
file
)
internalInit
(
cfg
)
}
func
internalInit
(
settings
*
MetricSettings
)
{
initMetricVars
(
settings
)
if
settings
.
GraphiteBridgeConfig
!=
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