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
efb9d5b4
Unverified
Commit
efb9d5b4
authored
7 years ago
by
Daniel Nelson
Browse files
Options
Downloads
Patches
Plain Diff
Return Accumulator interface from NewAccumulator
parent
c1742763
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
agent/accumulator.go
+1
-1
1 addition, 1 deletion
agent/accumulator.go
agent/accumulator_test.go
+13
-13
13 additions, 13 deletions
agent/accumulator_test.go
agent/agent.go
+1
-1
1 addition, 1 deletion
agent/agent.go
with
15 additions
and
15 deletions
agent/accumulator.go
+
1
−
1
View file @
efb9d5b4
...
@@ -26,7 +26,7 @@ type MetricMaker interface {
...
@@ -26,7 +26,7 @@ type MetricMaker interface {
func
NewAccumulator
(
func
NewAccumulator
(
maker
MetricMaker
,
maker
MetricMaker
,
metrics
chan
telegraf
.
Metric
,
metrics
chan
telegraf
.
Metric
,
)
*
a
ccumulator
{
)
telegraf
.
A
ccumulator
{
acc
:=
accumulator
{
acc
:=
accumulator
{
maker
:
maker
,
maker
:
maker
,
metrics
:
metrics
,
metrics
:
metrics
,
...
...
This diff is collapsed.
Click to expand it.
agent/accumulator_test.go
+
13
−
13
View file @
efb9d5b4
...
@@ -115,15 +115,15 @@ func TestAddNoIntervalWithPrecision(t *testing.T) {
...
@@ -115,15 +115,15 @@ func TestAddNoIntervalWithPrecision(t *testing.T) {
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
testm
:=
<-
a
.
metrics
testm
:=
<-
metrics
actual
:=
testm
.
String
()
actual
:=
testm
.
String
()
assert
.
Contains
(
t
,
actual
,
"acctest value=101"
)
assert
.
Contains
(
t
,
actual
,
"acctest value=101"
)
testm
=
<-
a
.
metrics
testm
=
<-
metrics
actual
=
testm
.
String
()
actual
=
testm
.
String
()
assert
.
Contains
(
t
,
actual
,
"acctest,acc=test value=101"
)
assert
.
Contains
(
t
,
actual
,
"acctest,acc=test value=101"
)
testm
=
<-
a
.
metrics
testm
=
<-
metrics
actual
=
testm
.
String
()
actual
=
testm
.
String
()
assert
.
Equal
(
t
,
assert
.
Equal
(
t
,
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800000000000
)),
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800000000000
)),
...
@@ -147,15 +147,15 @@ func TestAddDisablePrecision(t *testing.T) {
...
@@ -147,15 +147,15 @@ func TestAddDisablePrecision(t *testing.T) {
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
testm
:=
<-
a
.
metrics
testm
:=
<-
metrics
actual
:=
testm
.
String
()
actual
:=
testm
.
String
()
assert
.
Contains
(
t
,
actual
,
"acctest value=101"
)
assert
.
Contains
(
t
,
actual
,
"acctest value=101"
)
testm
=
<-
a
.
metrics
testm
=
<-
metrics
actual
=
testm
.
String
()
actual
=
testm
.
String
()
assert
.
Contains
(
t
,
actual
,
"acctest,acc=test value=101"
)
assert
.
Contains
(
t
,
actual
,
"acctest,acc=test value=101"
)
testm
=
<-
a
.
metrics
testm
=
<-
metrics
actual
=
testm
.
String
()
actual
=
testm
.
String
()
assert
.
Equal
(
t
,
assert
.
Equal
(
t
,
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800082912748
)),
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800082912748
)),
...
@@ -179,15 +179,15 @@ func TestAddNoPrecisionWithInterval(t *testing.T) {
...
@@ -179,15 +179,15 @@ func TestAddNoPrecisionWithInterval(t *testing.T) {
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
testm
:=
<-
a
.
metrics
testm
:=
<-
metrics
actual
:=
testm
.
String
()
actual
:=
testm
.
String
()
assert
.
Contains
(
t
,
actual
,
"acctest value=101"
)
assert
.
Contains
(
t
,
actual
,
"acctest value=101"
)
testm
=
<-
a
.
metrics
testm
=
<-
metrics
actual
=
testm
.
String
()
actual
=
testm
.
String
()
assert
.
Contains
(
t
,
actual
,
"acctest,acc=test value=101"
)
assert
.
Contains
(
t
,
actual
,
"acctest,acc=test value=101"
)
testm
=
<-
a
.
metrics
testm
=
<-
metrics
actual
=
testm
.
String
()
actual
=
testm
.
String
()
assert
.
Equal
(
t
,
assert
.
Equal
(
t
,
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800000000000
)),
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800000000000
)),
...
@@ -204,7 +204,7 @@ func TestDifferentPrecisions(t *testing.T) {
...
@@ -204,7 +204,7 @@ func TestDifferentPrecisions(t *testing.T) {
a
.
AddFields
(
"acctest"
,
a
.
AddFields
(
"acctest"
,
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
testm
:=
<-
a
.
metrics
testm
:=
<-
metrics
actual
:=
testm
.
String
()
actual
:=
testm
.
String
()
assert
.
Equal
(
t
,
assert
.
Equal
(
t
,
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800000000000
)),
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800000000000
)),
...
@@ -214,7 +214,7 @@ func TestDifferentPrecisions(t *testing.T) {
...
@@ -214,7 +214,7 @@ func TestDifferentPrecisions(t *testing.T) {
a
.
AddFields
(
"acctest"
,
a
.
AddFields
(
"acctest"
,
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
testm
=
<-
a
.
metrics
testm
=
<-
metrics
actual
=
testm
.
String
()
actual
=
testm
.
String
()
assert
.
Equal
(
t
,
assert
.
Equal
(
t
,
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800083000000
)),
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800083000000
)),
...
@@ -224,7 +224,7 @@ func TestDifferentPrecisions(t *testing.T) {
...
@@ -224,7 +224,7 @@ func TestDifferentPrecisions(t *testing.T) {
a
.
AddFields
(
"acctest"
,
a
.
AddFields
(
"acctest"
,
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
testm
=
<-
a
.
metrics
testm
=
<-
metrics
actual
=
testm
.
String
()
actual
=
testm
.
String
()
assert
.
Equal
(
t
,
assert
.
Equal
(
t
,
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800082913000
)),
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800082913000
)),
...
@@ -234,7 +234,7 @@ func TestDifferentPrecisions(t *testing.T) {
...
@@ -234,7 +234,7 @@ func TestDifferentPrecisions(t *testing.T) {
a
.
AddFields
(
"acctest"
,
a
.
AddFields
(
"acctest"
,
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
interface
{}{
"value"
:
float64
(
101
)},
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
map
[
string
]
string
{
"acc"
:
"test"
},
now
)
testm
=
<-
a
.
metrics
testm
=
<-
metrics
actual
=
testm
.
String
()
actual
=
testm
.
String
()
assert
.
Equal
(
t
,
assert
.
Equal
(
t
,
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800082912748
)),
fmt
.
Sprintf
(
"acctest,acc=test value=101 %d
\n
"
,
int64
(
1139572800082912748
)),
...
...
This diff is collapsed.
Click to expand it.
agent/agent.go
+
1
−
1
View file @
efb9d5b4
...
@@ -143,7 +143,7 @@ func (a *Agent) gatherer(
...
@@ -143,7 +143,7 @@ func (a *Agent) gatherer(
func
gatherWithTimeout
(
func
gatherWithTimeout
(
shutdown
chan
struct
{},
shutdown
chan
struct
{},
input
*
models
.
RunningInput
,
input
*
models
.
RunningInput
,
acc
*
a
ccumulator
,
acc
telegraf
.
A
ccumulator
,
timeout
time
.
Duration
,
timeout
time
.
Duration
,
)
{
)
{
ticker
:=
time
.
NewTicker
(
timeout
)
ticker
:=
time
.
NewTicker
(
timeout
)
...
...
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