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
Hide 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() {
...
@@ -67,7 +67,7 @@ func sendUsageStats() {
// as sending that name could be sensitive information
// as sending that name could be sensitive information
dsOtherCount
:=
0
dsOtherCount
:=
0
for
_
,
dsStat
:=
range
dsStats
.
Result
{
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
metrics
[
"stats.ds."
+
dsStat
.
Type
+
".count"
]
=
dsStat
.
Count
}
else
{
}
else
{
dsOtherCount
+=
dsStat
.
Count
dsOtherCount
+=
dsStat
.
Count
...
...
pkg/models/datasource.go
View file @
323e8437
...
@@ -47,23 +47,25 @@ type DataSource struct {
...
@@ -47,23 +47,25 @@ type DataSource struct {
Updated
time
.
Time
Updated
time
.
Time
}
}
func
IsStandardDataSource
(
dsType
string
)
bool
{
var
knownDatasourcePlugins
map
[
string
]
bool
=
map
[
string
]
bool
{
switch
dsType
{
DS_ES
:
true
,
case
DS_ES
:
DS_GRAPHITE
:
true
,
return
true
DS_INFLUXDB
:
true
,
case
DS_INFLUXDB
:
DS_INFLUXDB_08
:
true
,
return
true
DS_KAIROSDB
:
true
,
case
DS_OPENTSDB
:
DS_CLOUDWATCH
:
true
,
return
true
DS_PROMETHEUS
:
true
,
case
DS_CLOUDWATCH
:
DS_OPENTSDB
:
true
,
return
true
"opennms"
:
true
,
case
DS_PROMETHEUS
:
"druid"
:
true
,
return
true
"dalmatinerdb"
:
true
,
case
DS_GRAPHITE
:
"gnocci"
:
true
,
return
true
"zabbix"
:
true
,
default
:
}
return
false
}
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