func makeNodeMetrics(reg *metric.Registry) nodeMetrics { return nodeMetrics{ registry: reg, latency: reg.Latency(execLatencyName), success: reg.Rates(execSuccessName), err: reg.Rates(execErrorName), } }
// makeMetrics makes a new metrics object with rates set on the provided // registry. func makeMetrics(registry *metric.Registry) metrics { return metrics{ bytesReceived: registry.Rates(BytesReceivedRatesName), bytesSent: registry.Rates(BytesSentRatesName), infosReceived: registry.Rates(InfosReceivedRatesName), infosSent: registry.Rates(InfosSentRatesName), } }
// NewTxnMetrics returns a new instance of txnMetrics that contains metrics which have // been registered with the provided Registry. func NewTxnMetrics(txnRegistry *metric.Registry) *TxnMetrics { return &TxnMetrics{ Aborts: txnRegistry.Rates(abortsPrefix), Commits: txnRegistry.Rates(commitsPrefix), Commits1PC: txnRegistry.Rates(commits1PCPrefix), Abandons: txnRegistry.Rates(abandonsPrefix), Durations: txnRegistry.Latency(durationsPrefix), Restarts: txnRegistry.Histogram(restartsKey, 60*time.Second, 100, 3), } }