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
323e8437
Commit
323e8437
authored
Oct 26, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring: minor refactoring and handling of known data source plugins
parent
3b67a6a2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
18 deletions
+20
-18
pkg/metrics/report_usage.go
+1
-1
pkg/models/datasource.go
+19
-17
No files found.
pkg/metrics/report_usage.go
View file @
323e8437
...
...
@@ -67,7 +67,7 @@ func sendUsageStats() {
// as sending that name could be sensitive information
dsOtherCount
:=
0
for
_
,
dsStat
:=
range
dsStats
.
Result
{
if
m
.
Is
StandardDataSource
(
dsStat
.
Type
)
{
if
m
.
Is
KnownDataSourcePlugin
(
dsStat
.
Type
)
{
metrics
[
"stats.ds."
+
dsStat
.
Type
+
".count"
]
=
dsStat
.
Count
}
else
{
dsOtherCount
+=
dsStat
.
Count
...
...
pkg/models/datasource.go
View file @
323e8437
...
...
@@ -47,23 +47,25 @@ type DataSource struct {
Updated
time
.
Time
}
func
IsStandardDataSource
(
dsType
string
)
bool
{
switch
dsType
{
case
DS_ES
:
return
true
case
DS_INFLUXDB
:
return
true
case
DS_OPENTSDB
:
return
true
case
DS_CLOUDWATCH
:
return
true
case
DS_PROMETHEUS
:
return
true
case
DS_GRAPHITE
:
return
true
default
:
return
false
}
var
knownDatasourcePlugins
map
[
string
]
bool
=
map
[
string
]
bool
{
DS_ES
:
true
,
DS_GRAPHITE
:
true
,
DS_INFLUXDB
:
true
,
DS_INFLUXDB_08
:
true
,
DS_KAIROSDB
:
true
,
DS_CLOUDWATCH
:
true
,
DS_PROMETHEUS
:
true
,
DS_OPENTSDB
:
true
,
"opennms"
:
true
,
"druid"
:
true
,
"dalmatinerdb"
:
true
,
"gnocci"
:
true
,
"zabbix"
:
true
,
}
func
IsKnownDataSourcePlugin
(
dsType
string
)
bool
{
_
,
exists
:=
knownDatasourcePlugins
[
dsType
]
return
exists
}
// ----------------------
...
...
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