MCPcopy Create free account
hub / github.com/subtrace/subtrace / sendReflector

Method sendReflector

tracer/parser.go:491–516  ·  view source on GitHub ↗
(tags map[string]string, json []byte, logidx uint64, loglines []string)

Source from the content-addressed store, hash-verified

489}
490
491func (p *Parser) sendReflector(tags map[string]string, json []byte, logidx uint64, loglines []string) error {
492 b, err := proto.Marshal(&pubsub.Message{
493 Concrete: &pubsub.Message_ConcreteV1{
494 ConcreteV1: &pubsub.Message_V1{
495 Underlying: &pubsub.Message_V1_Event{
496 Event: &pubsub.Event{
497 Concrete: &pubsub.Event_ConcreteV1{
498 ConcreteV1: &pubsub.Event_V1{
499 Tags: tags,
500 HarEntryJson: json,
501 Log: &pubsub.Event_Log{
502 Lines: loglines,
503 Index: logidx + 1,
504 },
505 },
506 },
507 },
508 },
509 },
510 },
511 })
512 if err != nil {
513 return fmt.Errorf("marshal proto: %w", err)
514 }
515 return DefaultPublisher.queueWrite(b)
516}
517
518type sampler struct {
519 orig io.ReadCloser

Callers 1

FinishMethod · 0.95

Calls 1

queueWriteMethod · 0.80

Tested by

no test coverage detected