// reportVmFault send report to daemon, notify about that:
//   1. vm op failed due to some reason described in `cause`
170809
func (ctx *VmContext) reportVmFault(cause string) {
	defer func() {
		err := recover()
		if err != nil {
			ctx.Log(WARNING, "panic during send vm fault message to channel")
		}
	}()

	ctx.client <- &types.VmResponse{
		VmId:  ctx.Id,
		Code:  types.E_FAILED,
		Cause: cause,
	}
}
1242874
func (nw *NotifyWorker) Report() map[string]interface{} {
	if r, ok := nw.config.Handler.(worker.Reporter); ok {
		return r.Report()
	}
	return nil
}
629478
func (p *PrometheusReporter) ReportGauge(metric string, labels map[string]string, value float64) error {
	g := p.gaugeReportersMap[metric]
	if g != nil {
		labels = p.ensureLabels(labels)
		g.With(labels).Set(value)
		return nil
	}
	return constants.ErrMetricNotKnown
}
1256154
func (st *insertStats) report(chain []*types.Block, index int, dirty common.StorageSize) {
	// Fetch the timings for the batch
	var (
		now     = mclock.Now()
		elapsed = time.Duration(now) - time.Duration(st.startTime)
	)
	// If we're at the last block of the batch or report period reached, log
	if index == len(chain)-1 || elapsed >= statsReportLimit {
		// Count the number of transactions in this segment
		var txs int
		for _, block := range chain[st.lastIndex : index+1] {
			txs += len(block.Transactions())
		}
		end := chain[index]

		// Assemble the log context and send it to the logger
		context := []interface{}{
			"blocks", st.processed, "txs", txs, "mgas", float64(st.usedGas) / 1000000,
			"elapsed", common.PrettyDuration(elapsed), "mgasps", float64(st.usedGas) * 1000 / float64(elapsed),
			"number", end.Number(), "hash", end.Hash(),
		}
		if timestamp := time.Unix(int64(end.Time()), 0); time.Since(timestamp) > time.Minute {
			context = append(context, []interface{}{"age", common.PrettyAge(timestamp)}...)
		}
		context = append(context, []interface{}{"dirty", dirty}...)

		if st.queued > 0 {
			context = append(context, []interface{}{"queued", st.queued}...)
		}
		if st.ignored > 0 {
			context = append(context, []interface{}{"ignored", st.ignored}...)
		}
		log.Info("Imported new chain segment", context...)

		// Bump the stats reported to the next section
		*st = insertStats{startTime: now, lastIndex: index + 1}
	}
}
686683
func (eng *Engine) Report(metrics interface{}, tags ...Tag) {
	eng.ReportAt(time.Now(), metrics, tags...)
}
28773
func (r *InMemoryReporter) Report(span *Span) {
	r.lock.Lock()
	// Need to retain the span otherwise it will be released
	r.spans = append(r.spans, span.Retain())
	r.lock.Unlock()
}
1017682
func (ac *Context) Report() {
	account := ac.email
	if ac.anonymous {
		account = "anonymous"
	}
	logging.Infof(ac.ctx,
		"%q account is %s (git_auth: %v, devshell: %v, docker:%v, firebase: %v)",
		ac.ID, account, ac.EnableGitAuth, ac.EnableDevShell, ac.EnableDockerAuth, ac.EnableFirebaseAuth)
}
38765
func (s *StartBuildInput) SetReportBuildStatusOverride(v bool) *StartBuildInput {
	s.ReportBuildStatusOverride = &v
	return s
}
623858
func Report(req request.Request, zone, rcode string, size int, start time.Time) {
	// Proto and Family.
	net := req.Proto()
	fam := "1"
	if req.Family() == 2 {
		fam = "2"
	}

	typ := req.QType()

	RequestCount.WithLabelValues(zone, net, fam).Inc()
	RequestDuration.WithLabelValues(zone).Observe(float64(time.Since(start) / time.Millisecond))

	if req.Do() {
		RequestDo.WithLabelValues(zone).Inc()
	}

	if _, known := monitorType[typ]; known {
		RequestType.WithLabelValues(zone, dns.Type(typ).String()).Inc()
	} else {
		RequestType.WithLabelValues(zone, other).Inc()
	}

	ResponseSize.WithLabelValues(zone, net).Observe(float64(size))
	RequestSize.WithLabelValues(zone, net).Observe(float64(req.Len()))

	ResponseRcode.WithLabelValues(zone, rcode).Inc()
}
1183996
func (_m *ClientInterface) ReportHealthStatus(key health.HealthStatusKey, value health.HealthStatus, expires time.Duration) error {
	ret := _m.Called(key, value, expires)

	var r0 error
	if rf, ok := ret.Get(0).(func(health.HealthStatusKey, health.HealthStatus, time.Duration) error); ok {
		r0 = rf(key, value, expires)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
1271210
func (m *RWMutex) ReportEvery(interval time.Duration) close.SimpleCloser {
	ticker := time.NewTicker(interval)
	go func() {
		for range ticker.C {
			m.Report()
		}
	}()
	return &tickerCloser{Ticker: ticker}
}
1282068
func (s *Server) reportGlobalMetricsFlushCounts(ms metricsSummary) {
	// we only report these lengths in FlushGlobal
	// since if we're the global veneur instance responsible for flushing them
	// this avoids double-counting problems where a local veneur reports
	// histograms that it received, and then a global veneur reports them
	// again

	s.Statsd.Count(flushTotalMetric, int64(ms.totalGlobalCounters), []string{"metric_type:global_counter"}, 1.0)
	s.Statsd.Count(flushTotalMetric, int64(ms.totalGlobalGauges), []string{"metric_type:global_gauge"}, 1.0)
	s.Statsd.Count(flushTotalMetric, int64(ms.totalGlobalHistograms), []string{"metric_type:global_histogram"}, 1.0)
	s.Statsd.Count(flushTotalMetric, int64(ms.totalGlobalTimers), []string{"metric_type:global_timers"}, 1.0)
	s.Statsd.Count(flushTotalMetric, int64(ms.totalHistograms), []string{"metric_type:histogram"}, 1.0)
	s.Statsd.Count(flushTotalMetric, int64(ms.totalSets), []string{"metric_type:set"}, 1.0)
	s.Statsd.Count(flushTotalMetric, int64(ms.totalTimers), []string{"metric_type:timer"}, 1.0)
}
1335785
func (m *RWMutex) Report() {
	writers := atomic.LoadInt64(&m.writers)
	str := fmt.Sprintf(
		"writers %d (pending %d) readers %d",
		writers,
		atomic.LoadInt64(&m.pendingWriters),
		atomic.LoadInt64(&m.readers),
	)
	if writers > 0 {
		m.stateMutex.RLock()
		str += fmt.Sprintf(", stack: %s", string(m.lastLockStack))
		m.stateMutex.RUnlock()
	}
	m.println(str)
}
757130
func ReportMessageProcessDelayFromCtx(ctx context.Context, reporters []Reporter, typ string) {
	if len(reporters) > 0 {
		startTime := pcontext.GetFromPropagateCtx(ctx, constants.StartTimeKey)
		elapsed := time.Since(time.Unix(0, startTime.(int64)))
		route := pcontext.GetFromPropagateCtx(ctx, constants.RouteKey)
		tags := getTags(ctx, map[string]string{
			"route": route.(string),
			"type":  typ,
		})
		for _, r := range reporters {
			r.ReportSummary(ProcessDelay, tags, float64(elapsed.Nanoseconds()))
		}
	}
}
311027
func (f *Facade) ReportKeys(machineId string, publicKeys []string) error {
	args := params.SSHHostKeySet{EntityKeys: []params.SSHHostKeys{{
		Tag:        names.NewMachineTag(machineId).String(),
		PublicKeys: publicKeys,
	}}}
	var result params.ErrorResults
	err := f.caller.FacadeCall("ReportKeys", args, &result)
	if err != nil {
		return err
	}
	return result.OneError()
}
1219193
func (h *LogReporter) ReportWithLevel(ctx context.Context, level string, err error) error {
	var file, line string
	var stack errors.StackTrace

	if errWithStack, ok := err.(stackTracer); ok {
		stack = errWithStack.StackTrace()
	}
	if stack != nil && len(stack) > 0 {
		file = fmt.Sprintf("%s", stack[0])
		line = fmt.Sprintf("%d", stack[0])
	} else {
		file = "unknown"
		line = "0"
	}

	if level == "debug" {
		logger.Debug(ctx, "", "debug", fmt.Sprintf(`"%v"`, err), "line", line, "file", file)
	} else if level == "info" {
		logger.Info(ctx, "", "info", fmt.Sprintf(`"%v"`, err), "line", line, "file", file)
	} else {
		logger.Error(ctx, "", level, fmt.Sprintf(`"%v"`, err), "line", line, "file", file)
	}
	return nil
}
1185992
func (c context) ReportAction(actionResponse updater.UpdatePromptResponse, update *updater.Update, options updater.UpdateOptions) {
	if err := c.reportAction(actionResponse, update, options, defaultEndpoints.action, time.Minute); err != nil {
		c.log.Warningf("Error notifying about an action (%s): %s", actionResponse.Action, err)
	}
}