forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noop.go
26 lines (22 loc) · 787 Bytes
/
noop.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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),
}
}
// tick:ignore
func (n *NoOpNode) MarshalJSON() ([]byte, error) { return nil, nil }
// tick:ignore
func (n *NoOpNode) UnmarshalJSON(data []byte) error { return nil }