metrics

package
v0.24.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2017 Monax Industries Limited

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMetrics

func AddMetrics() map[string]*prometheus.Desc

AddMetrics - Add's all of the metrics to a map of strings, returns the map.

func StartServer

func StartServer(service *rpc.Service, pattern, listenAddress string, blockSampleSize uint64,
	logger *logging.Logger) (*http.Server, error)

Types

type Datum

type Datum struct {
	LatestBlockHeight   float64
	UnconfirmedTxs      float64
	TotalPeers          float64
	InboundPeers        float64
	OutboundPeers       float64
	BlockSampleSize     uint64
	TotalTxs            float64
	TxPerBlockBuckets   map[float64]float64
	TotalTime           float64
	TimePerBlockBuckets map[float64]float64
	AccountsWithCode    float64
	AccountsWithoutCode float64
}

Datum is used to store data from all the relevant endpoints

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter is used to store Metrics data and embeds the config struct. This is done so that the relevant functions have easy access to the user defined runtime configuration when the Collect method is called.

func (*Exporter) Collect

func (e *Exporter) Collect(ch chan<- prometheus.Metric)

Collect function, called on by Prometheus Client library This function is called when a scrape is peformed on the /metrics page

func (*Exporter) Describe

func (e *Exporter) Describe(ch chan<- *prometheus.Desc)

Describe - loops through the API metrics and passes them to prometheus.Describe

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL