forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deadmans stats by group and for emitted not collected
- Loading branch information
1 parent
4e5a5e5
commit f8b8602
Showing
10 changed files
with
208 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package kapacitor | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/influxdata/kapacitor/pipeline" | ||
) | ||
|
||
type NoOpNode struct { | ||
node | ||
} | ||
|
||
// Create a new NoOpNode which does nothing with the data and just passes it through. | ||
func newNoOpNode(et *ExecutingTask, n *pipeline.NoOpNode, l *log.Logger) (*NoOpNode, error) { | ||
nn := &NoOpNode{ | ||
node: node{Node: n, et: et, logger: l}, | ||
} | ||
nn.node.runF = nn.runNoOp | ||
return nn, nil | ||
} | ||
|
||
func (s *NoOpNode) runNoOp([]byte) error { | ||
switch s.Wants() { | ||
case pipeline.StreamEdge: | ||
for p, ok := s.ins[0].NextPoint(); ok; p, ok = s.ins[0].NextPoint() { | ||
for _, child := range s.outs { | ||
err := child.CollectPoint(p) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
} | ||
case pipeline.BatchEdge: | ||
for b, ok := s.ins[0].NextBatch(); ok; b, ok = s.ins[0].NextBatch() { | ||
for _, child := range s.outs { | ||
err := child.CollectBatch(b) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
} | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package pipeline | ||
|
||
// A node that does not perform any operation. | ||
// | ||
// *Do not use this node in a TICKscript there should be no need for it.* | ||
// | ||
// If a node does not have any children, then its emitted count remains zero. | ||
// Using a NoOpNode is a work around so that statistics are accurately reported | ||
// for nodes with no real children. | ||
// A NoOpNode is automatically appended to any node that is a source for a StatsNode | ||
// and does not have any children. | ||
type NoOpNode struct { | ||
chainnode | ||
} | ||
|
||
func newNoOpNode(wants EdgeType) *NoOpNode { | ||
return &NoOpNode{ | ||
chainnode: newBasicChainNode("noop", wants, wants), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters