(id int64, desc *TraceEvent)
| 189 | } |
| 190 | |
| 191 | func (c *channelMap) traceEvent(id int64, desc *TraceEvent) { |
| 192 | c.mu.Lock() |
| 193 | defer c.mu.Unlock() |
| 194 | child := c.findEntry(id) |
| 195 | childTC, ok := child.(tracedChannel) |
| 196 | if !ok { |
| 197 | return |
| 198 | } |
| 199 | childTC.getChannelTrace().append(&traceEvent{Desc: desc.Desc, Severity: desc.Severity, Timestamp: time.Now()}) |
| 200 | if desc.Parent != nil { |
| 201 | parent := c.findEntry(child.getParentID()) |
| 202 | var chanType RefChannelType |
| 203 | switch child.(type) { |
| 204 | case *Channel: |
| 205 | chanType = RefChannel |
| 206 | case *SubChannel: |
| 207 | chanType = RefSubChannel |
| 208 | } |
| 209 | if parentTC, ok := parent.(tracedChannel); ok { |
| 210 | parentTC.getChannelTrace().append(&traceEvent{ |
| 211 | Desc: desc.Parent.Desc, |
| 212 | Severity: desc.Parent.Severity, |
| 213 | Timestamp: time.Now(), |
| 214 | RefID: id, |
| 215 | RefName: childTC.getRefName(), |
| 216 | RefType: chanType, |
| 217 | }) |
| 218 | childTC.incrTraceRefCount() |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | type int64Slice []int64 |
| 224 |
no test coverage detected