Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
telegraf-nftables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
vqgroup
telegraf-nftables
Commits
694955c8
Unverified
Commit
694955c8
authored
8 years ago
by
Cameron Sparr
Browse files
Options
Downloads
Patches
Plain Diff
Remove metric.Point from metric interface
parent
b1945c04
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Godeps
+0
-1
0 additions, 1 deletion
Godeps
metric.go
+0
-7
0 additions, 7 deletions
metric.go
metric/metric.go
+0
-8
0 additions, 8 deletions
metric/metric.go
metric/metric_test.go
+0
-20
0 additions, 20 deletions
metric/metric_test.go
with
0 additions
and
36 deletions
Godeps
+
0
−
1
View file @
694955c8
...
...
@@ -26,7 +26,6 @@ github.com/hailocab/go-hostpool e80d13ce29ede4452c43dea11e79b9bc8a15b478
github.com/hashicorp/consul 63d2fc68239b996096a1c55a0d4b400ea4c2583f
github.com/hpcloud/tail 915e5feba042395f5fda4dbe9c0e99aeab3088b3
github.com/influxdata/config 8ec4638a81500c20be24855812bc8498ebe2dc92
github.com/influxdata/influxdb 2fe8ed308439a98a9b01943939b44048ed952c90
github.com/influxdata/toml ad49a5c2936f96b8f5943c3fdba47630ccf45a0d
github.com/influxdata/wlog 7c63b0a71ef8300adc255344d275e10e5c3a71ec
github.com/jackc/pgx c8080fc4a1bfa44bf90383ad0fdce2f68b7d313c
...
...
This diff is collapsed.
Click to expand it.
metric.go
+
0
−
7
View file @
694955c8
...
...
@@ -2,9 +2,6 @@ package telegraf
import
(
"time"
// TODO remove
"github.com/influxdata/influxdb/client/v2"
)
// ValueType is an enumeration of metric types that represent a simple value.
...
...
@@ -62,8 +59,4 @@ type Metric interface {
// aggregator things:
SetAggregate
(
bool
)
IsAggregate
()
bool
// Point returns a influxdb client.Point object
// TODO remove this function
Point
()
*
client
.
Point
}
This diff is collapsed.
Click to expand it.
metric/metric.go
+
0
−
8
View file @
694955c8
...
...
@@ -9,9 +9,6 @@ import (
"time"
"github.com/influxdata/telegraf"
// TODO remove
"github.com/influxdata/influxdb/client/v2"
)
const
MaxInt
=
int
(
^
uint
(
0
)
>>
1
)
...
...
@@ -137,11 +134,6 @@ type metric struct {
nsec
int64
}
func
(
m
*
metric
)
Point
()
*
client
.
Point
{
c
,
_
:=
client
.
NewPoint
(
m
.
Name
(),
m
.
Tags
(),
m
.
Fields
(),
m
.
Time
())
return
c
}
func
(
m
*
metric
)
String
()
string
{
return
string
(
m
.
name
)
+
string
(
m
.
tags
)
+
" "
+
string
(
m
.
fields
)
+
" "
+
string
(
m
.
t
)
+
"
\n
"
}
...
...
This diff is collapsed.
Click to expand it.
metric/metric_test.go
+
0
−
20
View file @
694955c8
...
...
@@ -595,26 +595,6 @@ func TestNewMetricAggregate(t *testing.T) {
assert
.
True
(
t
,
m
.
IsAggregate
())
}
func
TestNewMetricPoint
(
t
*
testing
.
T
)
{
now
:=
time
.
Now
()
tags
:=
map
[
string
]
string
{
"host"
:
"localhost"
,
}
fields
:=
map
[
string
]
interface
{}{
"usage_idle"
:
float64
(
99
),
}
m
,
err
:=
New
(
"cpu"
,
tags
,
fields
,
now
)
assert
.
NoError
(
t
,
err
)
p
:=
m
.
Point
()
pfields
,
_
:=
p
.
Fields
()
assert
.
Equal
(
t
,
fields
,
m
.
Fields
())
assert
.
Equal
(
t
,
fields
,
pfields
)
assert
.
Equal
(
t
,
"cpu"
,
p
.
Name
())
}
func
TestNewMetricString
(
t
*
testing
.
T
)
{
now
:=
time
.
Now
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment