This file is indexed.

/usr/share/gocode/src/github.com/influxdata/influxdb/stress/v2/stress_client/response.go is in golang-github-influxdb-influxdb-dev 1.1.1+dfsg1-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package stressClient

import (
	"log"

	influx "github.com/influxdata/influxdb/client/v2"
)

// Response holds data scraped from InfluxDB HTTP responses turned into a *influx.Point for reporting
// See reporting.go for more information
// The Tracer contains a wait group sent from the statement. It needs to be decremented when the Response is consumed
type Response struct {
	Point  *influx.Point
	Tracer *Tracer
}

// NewResponse creates a new instance of Response
func NewResponse(pt *influx.Point, tr *Tracer) Response {
	return Response{
		Point:  pt,
		Tracer: tr,
	}
}

// AddTags adds additional tags to the point held in Response and returns the point
func (resp Response) AddTags(newTags map[string]string) *influx.Point {

	// Pull off the current tags
	tags := resp.Point.Tags()

	// Add the new tags to the current tags
	for tag, tagValue := range newTags {
		tags[tag] = tagValue
	}

	// Make a new point
	pt, err := influx.NewPoint(resp.Point.Name(), tags, resp.Point.Fields(), resp.Point.Time())

	// panic on error
	if err != nil {
		log.Fatalf("Error adding tags to response point\n  point: %v\n  tags:%v\n  error: %v\n", resp.Point, newTags, err)
	}

	return pt
}